How to implement - MBWAY Updated on 18-04-2018

Workflow of how to implement MB WAY payments using easypay's webservice.

1 - Request a Reference

Call api_easypay_01BG.php to request a payment identifier.


Mbway Operations

Phone numbers you're required to use for testing, at our testing environment only:

mbway_phone_indicative=351:

a) -  mbway_phone=911234567 - Authorized for all operations

b) -  mbway_phone=917654321 - Declined for all operations

c) -  mbway_phone=919876543 - Pending for all operations


This payment type allows you to do several operations below using api_easypay_05AG.php

a) -   authorization

b) -   Capture

c) -  purchase

d) -  refund

e) -  cancel


2 - Request payment authorization

To request a payment authorization just call api_easypay_05AG.php , setting the additional parameters for MBWay as shown here: api_easypay_05AG.php

Note: This step will return success, however, this means only that you successfully sent a request. You need to wait for a notification in order to proceed.

3 - MBWAY Auth Notification

When you client accepts the authorization, easypay will send a callback though "Url de Notificação de Autorização MBWAY” / "MBWAY Auth Notification” you have configured in the backoffice. Find out more here:https://docs.easypay.pt/workflow/mbway-auth-notification

Note: Operation 3 (MBWAY Auth Notification) is exclusive for Operation 2 (authorization)

4 - Request payment (capture)

After you receive a notification, you can then proceed with capturing the funds. The value can be either total or partial. You can find out more here:api_easypay_05AG.php

5 - Request purchase (sale)

A Purchase is a direct capture of funds. As such, this is independent from operation 2-4, and you should implement either one or the other. Find how to implement here:api_easypay_05AG.php

6 - Request Cancelation (cancel)

A cancelation will remove the request from the user interface. If for some reason, within the 15 allotted minutes for the user to accept the payment, you need to prevent it, or if you need to cancel an auth, you can use this. Find how to implement here:api_easypay_05AG.php

7 - Request Refund (operation d)

If you need to refund your customer, you can use this operation. Valid for operation 4 and 5 ( api_easypay_05AG.php) (api_easypay_05AG.php)

8 - Payment notification

After you request payment and the user confirms it (in operation 5) or you request a capture(operation 4), Easypay will notify your payment notification url (in real time). If you don't need real time notification you can fetch all payments once a day to perform you reconciliations (you should do this once a day, regardless of implementing real time)