Payment-method icon

MB WAY for API only

Add MB WAY to an existing API-only integration

Accept MB WAY payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Before you begin

This page assumes you have already:

Build your payment form for MB WAY

Include MB WAY in the list of available payment methods. You don't need to collect any information from the shopper in your payment form.

Adyen provides an MB WAY logo which you can use on your payment form. For more information, refer to Downloading logos.

You can also get the required fields from the /paymentMethods response as explained in our API-only integration guide. In your request, specify:

  • countryCode: PT
  • amount.currency: EUR
  • amount.value: The amount of the transaction, in minor units.

The required fields are included in the object with type: mbway.

Make a payment

In your /payments request, specify the following parameters:

  • paymentMethod.type: mbway.
  • paymentMethod.telephoneNumber: The shopper's mobile phone number, which must be a Portuguese phone number; for example +351234567890.

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

  1. Show a waiting screen to the shopper, telling them you're waiting for them to complete the payment.
  2. Check your webhooks to see the payment result. We send you a webhook after the shopper completes the payment in their MB WAY app.
  3. Once the shopper finalizes the payment, redirect them to your website, and present the payment result.

Present the payment result

Use the resultCode from the /payments response to show the payment outcome on your frontend.

The resultCode values you can receive for MB WAY are:

resultCode Description Action to take
Error There was an error when the payment was being processed. Inform the shopper that there was an error processing their payment. The response contains a refusalReason, indicating the cause of the error.
Pending or
Received
The shopper has completed the payment but the final result is not yet known. It may take minutes or hours for the payments network to confirm this. Inform the shopper that you've received their order, and are waiting for the payment to be completed.
You will receive the final result of the payment in an AUTHORISATION webhook.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

You will receive the outcome of the payment asynchronously in a webhook:

eventCode success Description Action to take
AUTHORISATION true The shopper successfully completed the payment. Inform the shopper that the payment has been successful and proceed with the order.
AUTHORISATION false The transaction failed. Cancel the order and inform the shopper that the payment failed.

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"

See also