Search

Are you looking for test card numbers?

Would you like to contact support?

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

These instructions explain how to add MB WAY to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your MB WAY integration:

  1. Make sure that you have set up your back end implementation.
  2. Add MB WAY in your test Customer Area.

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.

We provide 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

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

Make a payment

In your /payments request, specify the following parameters:

  • paymentMethod.type: Set to mbway.
  • telephoneNumber: The shopper's telephone which must be a Portugese phone number, for example +351234567890.
curl https://checkout-test.adyen.com/v53/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
  "amount": {
    "currency": "EUR",
    "value": 1000
  },
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
  "paymentMethod": {
    "type": "mbway",
    "shopperEmail": "SHOPPER_EMAIL@example.com",
    "telephoneNumber": "+351213822199"
  },
  "reference": "YOUR_ORDER_NUMBER",
  "shopperStatement": "MBWay shopper statement"
}'

The /payments response contains:

  • resultCode: Pending, means the shopper needs to complete the payment in their MB WAY app.
  • action.type: await, means you need to wait for the notification webhook to know the payment outcome.
/payments response
{
  "resultCode": "Pending",
  "action": {
    "paymentData": "Ab02b4c0!BQABAgCX79JLFTqePTGTb...",
    "paymentMethodType": "mbway",
    "type": "await"
  },
  "paymentData": "Ab02b4c0!BQABAgCX79JLFTqePTGTb..."
}

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 webhook notifications to see the payment result. We send you a notification 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/details response to show the payment outcome on your frontend.
You will also receive the outcome of the payment asynchronously in a notification webhook.
The resultCode values you can receive for MB WAY are:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
You will receive the funds in 2-3 days.
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 notification.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

Test and go live

Use the following MB WAY account details to test your integration:

Shopper e-mail Shopper phone number
Any correctly formatted e-mail Any Portuguese telephone number, for example +351234567890

You can test each payment result scenario by appending a code to the shopperStatement value in your /payments request:

resultCode Code to append
AUTHORISED
default test response
-c1
PENDING -c3 and wait 15 minutes
after making the /payments request
REFUSED -c5

For example, to produce a REFUSED payment result, include the following in your /payments request:

{
  // ...
  "shopperStatement": "MBWay shopper statement-c5"
}

You can check the status of MB WAY test payments in your Customer Area > Transactions > Payments.

Before you can accept live MB WAY payments, you need to add MB WAY in your live Customer Area.

See also