--- title: "MobilePay iOS Component" description: "Add MobilePay to your Components integration." url: "https://docs.adyen.com/payment-methods/mobilepay/ios-component" source_url: "https://docs.adyen.com/payment-methods/mobilepay/ios-component.md" canonical: "https://docs.adyen.com/payment-methods/mobilepay/ios-component" last_modified: "2026-11-06T17:06:40+01: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. # MobilePay iOS Component Add MobilePay to your Components integration. You can add MobilePay to your existing integration. The following instructions show only what you must add to your integration specifically for MobilePay. 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 Component ### Before-You-Begin ## Requirements | Requirement | Description | | | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Sessions flow [iOS Components integration](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components). | | | **Checkout API** | Make sure that you use Checkout API v68 or later. | | | **Redirect handling** | Make sure that your existing integration is set up to [handle the redirect](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components#handle-the-redirect). `action.type`: **redirect** | | | **Setup steps** | Before you begin, [add MobilePay in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | | ### Add-Parameters-Sessions-Request ## Add additional parameters to your /sessions request You do not need to add any parameters when you [create a payment session](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components#create-a-payment-session). ### Add-Configuration ## Add additional configuration for MobilePay You do not need to add any configuration parameters for MobilePay. ### Initialize ## Initialize the Component for MobilePay To [initialize](https://docs.adyen.com/payment-methods/mobilepay/ios-component#initialize-the-component) MobilePay, use the `InstantPaymentComponent` class. **Initialize the InstantPaymentComponent** ```swift let paymentMethods = session.sessionContext.paymentMethods // Check that the payment method is supported before showing the Component. guard let paymentMethod = paymentMethods.paymentMethod(ofType: .other("mobilepay")) else { return } // Create an instance of InstantPaymentComponent. let component = InstantPaymentComponent(paymentMethod: paymentMethod, context: context, order: nil) self.currentComponent = component // Set the session as the delegate. component.delegate = session component.initiatePayment() ``` ## Test and go live MobilePay cannot be tested in the test environment. You must make penny test (low-amount) payments in the live environment. 1. Submit a request for MobilePay in your [live Customer Area](https://ca-live.adyen.com/). 2. After MobilePay is added to your live Customer Area, do the following for each test payment: 1. Make a MobilePay payment for a low amount. 2. Get the [**AUTHORISATION** webhook](https://docs.adyen.com/development-resources/webhooks/webhook-types/#default-event-codes) on your server. It includes the status of the payment. 3. In your live Customer Area, go to **Payments** > **Payment list** to see the status of the payment. ### Test payouts to MobilePay wallets The MobilePay payout feature is experimental, and supported only with the `/payments` endpoint. Do the following to test MobilePay payouts: 1. Get a test app following the instructions in the [VippsMobilePay documentation](https://developer.vippsmobilepay.com/docs/knowledge-base/test-environment/#app-installation). When prompted for a phone number and NIN (national identity number), use one of the following sets: * NIN 0407640091\ Phone +45 22105837 * NIN 0702860109\ Phone +45 34817154 * NIN 0111500196\ Phone +45 73920021 2. Test your integration end-to-end: * Make a test payment that generates a payout token, using the Vipps MobilePay test app to simulate the customer side. * Check that you receive and process the recurring lifecycle webhook. * Make a [Transfers API](https://docs.adyen.com/api-explorer/transfers/latest/overview) request using the token that you receive in the webhook. ## Advanced flow Component ### Before-You-Begin ## Requirements | Requirement | Description | | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Advanced flow [iOS Components integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=iOS\&integration=Drop-in). | | | **Redirect handling** | Make sure that your existing integration is set up to [handle the redirect](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=iOS\&integration=Components#handle-the-redirect). `action.type`: **redirect** | | | **Setup steps** | Before you begin, [add MobilePay in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | | ### Add-Configuration ## Add additional configuration for MobilePay You do not need to add any configuration parameters for MobilePay. ### Initialize ## Initialize the Component for MobilePay To [initialize](https://docs.adyen.com/payment-methods/mobilepay/ios-component#initialize-the-component) MobilePay, use the `InstantPaymentComponent` class. **Initialize the InstantPaymentComponent** ```swift // Check that the payment method is supported before showing the Component. guard let paymentMethod = paymentMethods.paymentMethod(ofType: .other("mobilepay")) else { return } // Create an instance of InstantPaymentComponent. let component = InstantPaymentComponent(paymentMethod: paymentMethod, context: context, order: nil) self.currentComponent = component // Set the Component as the delegate. component.delegate = self component.initiatePayment() ``` ### Add-Parameters-Payments-Request ## Add additional parameters to your /payments request You do not need to add any parameters to the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request when you [make a payment](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=iOS\&integration=Components#make-a-payment), unless you make a payment to generate a token for future payouts to MobilePay wallets. #### Latest version ##### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "reference":"YOUR_ORDER_NUMBER", "amount":{ "currency":"", "value":1000 }, "paymentMethod":{ "type":"" }, "returnUrl":"", "{hint:Required when creating a payout token. Optional for normal payment - include for a better shopper experience.}telephoneNumber{/hint}": "+4512345678", "{hint:Required when creating a payout token.}shopperReference{/hint}": "YOUR_SHOPPER_REFERENCE", "{hint:Required when creating a payout token.}enablePayOut{/hint}": "true" }' ``` ##### 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("String") .value(1000L); AchDetails achDetails = new AchDetails() .type(AchDetails.TypeEnum.ACH); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .enablePayOut(true) .amount(amount) .telephoneNumber("+4512345678") .merchantAccount("YOUR_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(achDetails)) .returnUrl("String") .shopperReference("YOUR_SHOPPER_REFERENCE"); // 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("") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType(""); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setEnablePayOut(true) ->setAmount($amount) ->setTelephoneNumber("+4512345678") ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("") ->setShopperReference("YOUR_SHOPPER_REFERENCE"); $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 = "", Value = 1000 }; var achDetails = new AchDetails { Type = AchDetails.TypeEnum. }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", EnablePayOut = true, Amount = amount, TelephoneNumber = "+4512345678", MerchantAccount = "YOUR_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(achDetails), ReturnUrl = "", ShopperReference = "YOUR_SHOPPER_REFERENCE" }; 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: "", value: 1000 }; const achDetails = { type: "" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", enablePayOut: true, amount: amount, telephoneNumber: "+4512345678", merchantAccount: "YOUR_MERCHANT_ACCOUNT", paymentMethod: achDetails, returnUrl: "", shopperReference: "YOUR_SHOPPER_REFERENCE" }; // 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: "", Value: 1000, } achDetails := checkout.AchDetails{ Type: common.PtrString(""), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", EnablePayOut: common.PtrBool(true), Amount: amount, TelephoneNumber: common.PtrString("+4512345678"), MerchantAccount: "YOUR_MERCHANT_ACCOUNT", PaymentMethod: checkout.AchDetailsAsCheckoutPaymentMethod(&achDetails), ReturnUrl: "", ShopperReference: common.PtrString("YOUR_SHOPPER_REFERENCE"), } // 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 = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_ORDER_NUMBER", "amount": { "currency": "", "value": 1000 }, "paymentMethod": { "type": "" }, "returnUrl": "", "telephoneNumber": "+4512345678", "shopperReference": "YOUR_SHOPPER_REFERENCE", "enablePayOut": "true" } # 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 = { "merchantAccount" => "YOUR_MERCHANT_ACCOUNT", "reference" => "YOUR_ORDER_NUMBER", "amount" => { "currency" => "", "value" => 1000 }, "paymentMethod" => { "type" => "" }, "returnUrl" => "", "telephoneNumber" => "+4512345678", "shopperReference" => "YOUR_SHOPPER_REFERENCE", "enablePayOut" => "true" } # 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: "", value: 1000 }; const achDetails = { type: "" } as unknown as Types.checkout.AchDetails; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", enablePayOut: true, amount: amount, telephoneNumber: "+4512345678", merchantAccount: "YOUR_MERCHANT_ACCOUNT", paymentMethod: achDetails, returnUrl: "", shopperReference: "YOUR_SHOPPER_REFERENCE" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Earlier versions ##### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "reference":"YOUR_ORDER_NUMBER", "amount":{ "currency":"", "value":1000 }, "paymentMethod":{ "type":"" }, "returnUrl":"", "{hint:Required when creating a payout token. Optional for normal payment - include for a better shopper experience.}telephoneNumber{/hint}": "+4512345678", "{hint:Required when creating a payout token.}shopperReference{/hint}": "YOUR_SHOPPER_REFERENCE", "{hint:Required when creating a payout token.}enablePayOut{/hint}": "true" }' ``` ##### NodeJS (JavaScript) ```js // Adyen Node API Library v16.1.0 to v27.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "YOUR_X_API_KEY", environment: "TEST"}); // Create the request object const paymentRequest = { merchantAccount: "YOUR_MERCHANT_ACCOUNT", reference: "YOUR_ORDER_NUMBER", amount: { currency: "", value: 1000 }, paymentMethod: { type: "" }, telephoneNumber: "+4512345678", returnUrl: "" } // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ##### Python ```py # Adyen Python API Library v12.0.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "YOUR_X_API_KEY" adyen.client.platform = "test" # The environment to use library in. json_request = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_ORDER_NUMBER", "amount": { "currency": "", "value": 1000 }, "paymentMethod": { "type": "" }, "telephoneNumber": "+4512345678", "returnUrl": "" } result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` ##### Ruby ```rb # Adyen Ruby API Library v9.1.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'YOUR_X_API_KEY' adyen.env = :test # Set to "live" for live environment request_body = { :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :reference => 'YOUR_ORDER_NUMBER', :amount => { :currency => '', :value => 1000 }, :paymentMethod => { :type => '' }, :telephoneNumber => '+4512345678', :returnUrl => '' } result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` ### Payment with payout token creation To make a MobilePay payment and generate a token for future [payouts to MobilePay wallets](https://docs.adyen.com/payment-methods/mobilepay/#payouts): 1. Make sure that you have [set up the recurring lifecycle webhook](https://docs.adyen.com/payment-methods/mobilepay#payouts). 2. Make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request as usual, but include the parameters to create a token: * `telephoneNumber` * `shopperReference` * `enablePayout` set to **true** 3. When you receive the recurring lifecycle webhook for the payment, save the `storedPaymentMethodId` (the token) for your customer, identified by the `shopperReference`. **Webhook containing the payout token** ```bash { "createdAt" : "2025-01-29T20:50:37+01:00", "environment" : "test", "type" : "recurring.token.created", "data" : { "merchantAccount" : "YOUR_MERCHANT_ACCOUNT", "operation" : "created", "shopperReference" : "YOUR_SHOPPER_REFERENCE", "storedPaymentMethodId" : "NFX5L4DL4J2ZTL65", "type" : "visa_mobilepay" }, "eventId" : "JF89C8JSHVTFWR82" } ``` 4. When you want to [make a payout](https://docs.adyen.com/payouts/payout-service/pay-out-to-cards/card-payout-request/?tab=one-off-request-token_2) to the shopper's MobilePay wallet, send a POST [/transfers](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers) request specifying the payout token in the [counterparty.card.cardIdentification](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers#request-counterparty-card-cardIdentification) field. ## Test and go live MobilePay cannot be tested in the test environment. You must make penny test (low-amount) payments in the live environment. 1. Submit a request for MobilePay in your [live Customer Area](https://ca-live.adyen.com/). 2. After MobilePay is added to your live Customer Area, do the following for each test payment: 1. Make a MobilePay payment for a low amount. 2. Get the [**AUTHORISATION** webhook](https://docs.adyen.com/development-resources/webhooks/webhook-types/#default-event-codes) on your server. It includes the status of the payment. 3. In your live Customer Area, go to **Payments** > **Payment list** to see the status of the payment. ### Test payouts to MobilePay wallets The MobilePay payout feature is experimental, and supported only with the `/payments` endpoint. Do the following to test MobilePay payouts: 1. Get a test app following the instructions in the [VippsMobilePay documentation](https://developer.vippsmobilepay.com/docs/knowledge-base/test-environment/#app-installation). When prompted for a phone number and NIN (national identity number), use one of the following sets: * NIN 0407640091\ Phone +45 22105837 * NIN 0702860109\ Phone +45 34817154 * NIN 0111500196\ Phone +45 73920021 2. Test your integration end-to-end: * Make a test payment that generates a payout token, using the Vipps MobilePay test app to simulate the customer side. * Check that you receive and process the recurring lifecycle webhook. * Make a [Transfers API](https://docs.adyen.com/api-explorer/transfers/latest/overview) request using the token that you receive in the webhook.