Sessions flow Component
Before-You-Begin
Requirements
Add-Parameters-Sessions-Request
Add additional parameters to your /sessions request
When you create a payment session, add the following parameters:
Example /sessions request
Import
Import MB Way
When you import Adyen Web, includeMBWay.
Import
Add-Configuration
Add additional configuration for MB Way
You do not need to add any configuration parameters for MB Way.Initialize
Initialize the Component for MB Way
To initialize MB Way, use theMBWay class.
Initialize the Component
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:
For example, to receive
resultCode: Refused, include the following in your /payments request:"shopperStatement": "MBWay shopper statement-c5"
Advanced flow Component
Requirements
Import
Import MB Way
When you import Adyen Web, includeMBWay.
Import
Initialize
Initialize the Component for MB Way
To initialize MB Way, use theMBWay class.
Initialize the Component
Add-Parameters-Payments-Request
Add additional parameters to your /payments request
When you make a payment, add the following parameters to the /payments request:
Example payment request for MB Way
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.
App2app
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 theaction 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:
For example, to receive
resultCode: Refused, include the following in your /payments request:"shopperStatement": "MBWay shopper statement-c5"