You can add MB Way to your existing integration. The following instructions show only what you must add to your integration specifically for MB Way.
If an instruction on this page corresponds with a step in the main integration guide, it includes a link to corresponding step of the main integration guide.
Requirements
| Requirement | Description | |
|---|---|---|
| Integration type | Make sure that you have an existing API-only integration. | |
| Action handling | Make sure that your existing integration is set up to handle the additional action. action.type: await. |
|
| Setup steps | Before you begin, add MB WAY in your Customer Area. |
How it works
On web:
- The shopper selects MB WAY as the payment method.
- The shopper enters their details in the payment form that you build.
- When you make the payment request, you include additional information about the items that the shopper intends to purchase.
- Your existing integration setup will handle the await action, while you display the waiting screen.
On app (if App2App flow is enabled):
- The shopper selects MB WAY as the payment method.
- The shopper is automatically redirected to the MB WAY app.
- The shopper authorizes the payment in the MB WAY app.
- The shopper is automatically redirected back to your app.
Build your payment form
Include MB WAY in the list of available payment methods. You do not need to collect any information from the shopper in your payment form.
You can download the logo for MB WAY to use in your form.
Get MB WAY as an available payment method
When you make the /paymentMethods to get available payment methods, specify the following so that MB WAY is included in the response.
| Parameter | Values |
|---|---|
| countryCode | PT |
| amount.currency | EUR |
| amount.value | The value of the payment, in minor units. |
Add additional parameters to your /payments request
When you make a payment, add the following parameters:
| Parameter | Required | Description |
|---|---|---|
| paymentMethod.type | ![]() |
Set this value to mbway. |
| paymentMethod.telephoneNumber | ![]() |
The shopper's mobile phone number. |
| shopperStatement | The text to be shown on the shopper's bank statement. |
The /payments response contains:
resultCode: Pending (The shopper must complete the payment in their MB WAY app.)action: Use this object to display the waiting screen while the shopper completes the payment in their MB WAY app.
The /payments response contains:
resultCode: Pending (The shopper must complete the payment in their MB WAY app.)action: Use this object to display the waiting screen while the shopper completes the payment in their MB WAY app.
Show the waiting screen
- Show a waiting screen to the shopper, telling them you are waiting for them to complete the payment.
- Check your webhooks to see the payment result. We send you a webhook after the shopper completes the payment in their MB WAY app.
- Once the shopper finalizes the payment, redirect them to your website, and present the payment result.
Enable App2App switch
To provide shoppers with a seamless experience on mobile devices, you can implement the App2App flow. This removes the need for the shopper to manually enter their phone number and links them directly to the MB WAY app.
Step 1: Send a payment request
When making a /payments request, include:
channel- the shopper's platform, either iOS or Android. If thechannelparameter is missing or set to Web, the standard flow (requiring a phone number) will apply.returnUrl- the URL to where the shopper will be redirected after authorizing the payment in the MB WAY app.
Step 2: Handle the response
If the request is successful, you will receive an action object in the response.
- The
action.urlwill contain the MB WAY deep link (mbway://...). - The
returnUrlyou provided in the request is automatically appended to this deep link.
Step 3: Redirect the shopper
Use the URL provided in the action object to redirect the shopper.
- When the user authorizes the transaction in the MB WAY app, they are automatically redirected back to your application via the
returnUrl.
Test and go live
To test your MB WAY integration, you can use any telephone number; for example +351234567890.
You can check the status of MB WAY test payments in your Customer Area > Transactions > Payments.
Before you can accept live MB WAY payments, add MB WAY in your live Customer Area.
Trigger a resultCode
To trigger a specific resultCode value, append a code to the shopperStatement value in your /payments request:
resultCode |
Code to append to shopperStatement |
|---|---|
| Authorised (default test response) |
-c1 |
| Pending | -c3 |
| Refused | -c5 |
For example, to receive resultCode: Refused, include the following in your /payments request:
"shopperStatement": "MBWay shopper statement-c5"
