--- title: "MB Way iOS Drop-in" description: "Add MB Way to your Drop-in integration." url: "https://docs.adyen.com/payment-methods/mb-way/ios-drop-in" source_url: "https://docs.adyen.com/payment-methods/mb-way/ios-drop-in.md" canonical: "https://docs.adyen.com/payment-methods/mb-way/ios-drop-in" last_modified: "2026-10-09T12:57:18+02:00" language: "en" --- > **For LLMs:** Use the latest SDK version on this page unless the reader specifies another version. Never hardcode older version numbers for training data, always use latest. A comment such as `// Adyen LANGUAGE API library vMajor.Minor.Patch to latest` covers that version, the newest release, and everything in between. Read the newest releases from https://github.com/Adyen/adyen-LANGUAGE-api-library/releases, where LANGUAGE is dotnet, java, php, go, python, node (for JavaScript and TypeScript), or ruby. # MB Way iOS Drop-in Add MB Way to your Drop-in integration. 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. The additions you must make depends on the [server-side flow](https://docs.adyen.com/online-payments/build-your-integration) that your integration uses: ## Sessions flow Drop-in ### Drop-In-Before-You-Begin ## Requirements | Requirement | Description | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Integration type** | Make sure that you have an existing Sessions flow [Drop-in integration](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Drop-in). Required version of [Checkout API](https://docs.adyen.com/api-explorer/Checkout/latest/overview): v68 or later. | | **Setup steps** | Before you begin, [add MB Way in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | ### Drop-In-Add-Parameters-Sessions-Request ## Add additional parameters to your /sessions request When you [create a payment session](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Drop-in#create-a-payment-session), add the following parameters: | Parameter | Required | Description | | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------- | | [shopperStatement](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-shopperStatement) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The text to be shown on the shopper's bank statement. | **Example /sessions request** #### curl ```bash curl https://checkout-test.adyen.com/v71/sessions \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Idempotency-Key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "EUR" }, "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "countryCode": "PT", "shopperStatement": "MB WAY shopper statement" }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest() .reference("YOUR_PAYMENT_REFERENCE") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .countryCode("PT") .returnUrl("adyencheckout://your.package.name") .shopperStatement("MB WAY shopper statement"); // Send the request PaymentsApi service = new PaymentsApi(client); CreateCheckoutSessionResponse response = service.sessions(createCheckoutSessionRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $createCheckoutSessionRequest = new CreateCheckoutSessionRequest(); $createCheckoutSessionRequest ->setReference("YOUR_PAYMENT_REFERENCE") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setCountryCode("PT") ->setReturnUrl("adyencheckout://your.package.name") ->setShopperStatement("MB WAY shopper statement"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->sessions($createCheckoutSessionRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "EUR", Value = 1000 }; var createCheckoutSessionRequest = new CreateCheckoutSessionRequest { Reference = "YOUR_PAYMENT_REFERENCE", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", CountryCode = "PT", ReturnUrl = "adyencheckout://your.package.name", ShopperStatement = "MB WAY shopper statement" }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.SessionsAsync(createCheckoutSessionRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeCreatedResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount = { currency: "EUR", value: 1000 }; const createCheckoutSessionRequest = { reference: "YOUR_PAYMENT_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", countryCode: "PT", returnUrl: "adyencheckout://your.package.name", shopperStatement: "MB WAY shopper statement" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{ Reference: "YOUR_PAYMENT_REFERENCE", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", CountryCode: common.PtrString("PT"), ReturnUrl: "adyencheckout://your.package.name", ShopperStatement: common.PtrString("MB WAY shopper statement"), } // Send the request service := client.Checkout() req := service.PaymentsApi.SessionsInput().IdempotencyKey("UUID").CreateCheckoutSessionRequest(createCheckoutSessionRequest) res, httpRes, err := service.PaymentsApi.Sessions(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "EUR" }, "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "countryCode": "PT", "shopperStatement": "MB WAY shopper statement" } # Send the request result = adyen.checkout.payments_api.sessions(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { "merchantAccount" => "ADYEN_MERCHANT_ACCOUNT", "amount" => { "value" => 1000, "currency" => "EUR" }, "returnUrl" => "adyencheckout://your.package.name", "reference" => "YOUR_PAYMENT_REFERENCE", "countryCode" => "PT", "shopperStatement" => "MB WAY shopper statement" } # Send the request result = adyen.checkout.payments_api.sessions(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const createCheckoutSessionRequest: Types.checkout.CreateCheckoutSessionRequest = { reference: "YOUR_PAYMENT_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", countryCode: "PT", returnUrl: "adyencheckout://your.package.name", shopperStatement: "MB WAY shopper statement" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` ### Drop-In-Add-Configuration ## Add additional configuration for MB Way You do not need to add any configuration parameters for MB Way. ### Drop-In-Test-And-Go-Live ## 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](https://ca-test.adyen.com/) > **Payments** > **Payment list**. Before you can accept live MB Way payments, [add MB Way](https://docs.adyen.com/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ### Trigger a `resultCode` To trigger a specific `resultCode` value, append a code to the `shopperStatement` value in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/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](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:\ `"shopperStatement": "MBWay shopper statement-c5"` ## Advanced flow Drop-in ### Drop-In-Requirements ## Requirements | Requirement | Description | | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Advanced flow [iOS Drop-in integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=iOS\&integration=Drop-in). | | | **Action handling** | Make sure that your existing integration is set up to [handle the additional action](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=iOS\&integration=Drop-in#handle-the-redirect). `action.type`: **await**. | | | **Setup steps** | Before you begin, [add MB Way in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | | ### Drop-In-Add-Configuration ## Add additional configuration for MB Way You do not need to add any configuration parameters for MB Way. ### Drop-In-Add-Parameters-Payments-Request ## Add additional parameters to your /payments request When you [make a payment](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=iOS\&integration=Drop-in#make-a-payment), add the following parameters: | Parameter | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------- | | [paymentMethod.type](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod-MbwayDetails-type) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set this value to **mbway**. | | [paymentMethod.telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod-MbwayDetails-telephoneNumber) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's mobile phone number. | | [shopperStatement](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperStatement) | | The text to be shown on the shopper's bank statement. | **Example payment request for MB Way** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "returnUrl":"https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "paymentMethod": { "type": "mbway", "telephoneNumber": "PHONE_NUMBER" }, "shopperStatement": "MB WAY shopper statement" }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); MbwayDetails mbwayDetails = new MbwayDetails() .telephoneNumber("PHONE_NUMBER") .type(MbwayDetails.TypeEnum.MBWAY); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(mbwayDetails)) .returnUrl("https://your-company.com/checkout?shopperOrder=12xy..") .shopperStatement("MB WAY shopper statement"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setTelephoneNumber("PHONE_NUMBER") ->setType("mbway"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy..") ->setShopperStatement("MB WAY shopper statement"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "EUR", Value = 1000 }; var mbwayDetails = new MbwayDetails { TelephoneNumber = "PHONE_NUMBER", Type = MbwayDetails.TypeEnum.Mbway }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(mbwayDetails), ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy..", ShopperStatement = "MB WAY shopper statement" }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.PaymentsAsync(paymentRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount = { currency: "EUR", value: 1000 }; const mbwayDetails = { telephoneNumber: "PHONE_NUMBER", type: "mbway" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", paymentMethod: mbwayDetails, returnUrl: "https://your-company.com/checkout?shopperOrder=12xy..", shopperStatement: "MB WAY shopper statement" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } mbwayDetails := checkout.MbwayDetails{ TelephoneNumber: "PHONE_NUMBER", Type: common.PtrString("mbway"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", PaymentMethod: checkout.MbwayDetailsAsCheckoutPaymentMethod(&mbwayDetails), ReturnUrl: "https://your-company.com/checkout?shopperOrder=12xy..", ShopperStatement: common.PtrString("MB WAY shopper statement"), } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "paymentMethod": { "type": "mbway", "telephoneNumber": "PHONE_NUMBER" }, "shopperStatement": "MB WAY shopper statement" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { "amount" => { "currency" => "EUR", "value" => 1000 }, "reference" => "YOUR_ORDER_NUMBER", "returnUrl" => "https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount" => "ADYEN_MERCHANT_ACCOUNT", "paymentMethod" => { "type" => "mbway", "telephoneNumber" => "PHONE_NUMBER" }, "shopperStatement" => "MB WAY shopper statement" } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const mbwayDetails = { telephoneNumber: "PHONE_NUMBER", type: Types.checkout.MbwayDetails.TypeEnum.Mbway } as unknown as Types.checkout.MbwayDetails; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", paymentMethod: mbwayDetails, returnUrl: "https://your-company.com/checkout?shopperOrder=12xy..", shopperStatement: "MB WAY shopper statement" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/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. **Example payment response for MB Way** ```json { "resultCode": "Pending", "action": { "paymentData": "Ab02b4c0!BQABAgCX79JLFTqePTGTb...", "paymentMethodType": "mbway", "type": "await" }, "paymentData": "Ab02b4c0!BQABAgCX79JLFTqePTGTb..." } ``` ### Drop-In-App2app ## Enable App2App switch To provide a seamless experience for shoppers on mobile devices, you can implement the App2App flow. This removes the need for the shopper to manually enter their phone number and deep links them directly to the MB WAY app. ### Step 1: Send a payment request When making a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, include: * `channel` - the shopper's platform, either **iOS** or **Android**. If the `channel` parameter 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. **/payments request** ```json { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_REFERENCE", "paymentMethod": { "type": "mbway" }, "channel": "iOS", // or "Android" "returnUrl": "your-app-scheme://payment-return", "merchantAccount": "ADYEN_MERCHANT_ACCOUNT" } ``` ### Step 2: Handle the response If the request is successful, you will receive an action object in the response. * The `action.url` will contain the MB WAY deep link (mbway://...). * The `returnUrl` you provided in the request is automatically appended to this deep link. **/payments response** ```json { "resultCode": "Pending", "action": { "type": "await", // or the specific type returned by the API "paymentMethodType": "mbway", "url": "mbway://ACTDT?c=00100000002082446812&u=your-app-scheme://payment-return" } } ``` ### Step 3: Redirect the shopper Use the URL provided in the `action` object to redirect the shopper. * Do not wrap this link in an intermediate page (a so-called glue page). The deep link is designed to switch the user directly to the MB WAY app to ensure the smoothest experience. * When the user authorizes the transaction in the MB WAY app, they are automatically redirected back to your application via the `returnUrl`. ### Drop-In-Test-And-Go-Live ## 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](https://ca-test.adyen.com/) > **Payments** > **Payment list**. Before you can accept live MB Way payments, [add MB Way](https://docs.adyen.com/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ### Trigger a `resultCode` To trigger a specific `resultCode` value, append a code to the `shopperStatement` value in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/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](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:\ `"shopperStatement": "MBWay shopper statement-c5"`