--- title: "MOLPay online banking iOS Component" description: "Add MOLPay online banking to your existing iOS Components integration." url: "https://docs.adyen.com/payment-methods/molpay/ios-component" source_url: "https://docs.adyen.com/payment-methods/molpay/ios-component.md" canonical: "https://docs.adyen.com/payment-methods/molpay/ios-component" last_modified: "2026-05-13T17:03:13+02:00" language: "en" --- # MOLPay online banking iOS Component Add MOLPay online banking to your existing iOS Components integration. The MOLPay online banking Component renders MOLPay online banking in your payment form and collects your shopper's selected bank. When making a MOLPay online banking payment, you additionally need to: * [Handle the redirect](#handle-the-redirect). ## Requirements Select the [server-side flow](/online-payments/build-your-integration) that your integration uses: ### Tab: Sessions flow | Requirement | Description | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built a Sessions flow [integration](/online-payments/build-your-integration/sessions-flow?platform=%7B%7BgetParameter%28%27platform%27%29%7D%7D\&integration=%7B%7BgetParameter%28%27integration%27%29%7D%7D). | | **Setup steps** | Before you begin, [add MOLPay in your Customer Area](/payment-methods/add-payment-methods). | ### Tab: Advanced flow | Requirement | Description | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built an Advanced flow [integration](/online-payments/build-your-integration/advanced-flow?platform=%7B%7BgetParameter%28%27platform%27%29%7D%7D\&integration=%7B%7BgetParameter%28%27integration%27%29%7D%7D). | | **Setup steps** | Before you begin, [add MOLPay in your Customer Area](/payment-methods/add-payment-methods). | ## Show MOLPay online banking in your payment form Include MOLPay in the list of available payment methods. 1. Specify in your [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request: * [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-countryCode): Array. * [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount-currency): Array. * [channel](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-channel): Specify **iOS**. 2. Decode the `/paymentMethods` response with the `PaymentMethods` structure. ```swift let paymentMethods = try JSONDecoder().decode(PaymentMethods.self, from: paymentMethodsResponse) ``` Find `paymentMethods.type` **Array** and put it into an object. For example, `molpayPaymentMethod`. 3. Create an instance of `APIContext` with the following parameters: | Parameter name | Required | Description | | -------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `clientKey` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your [client key](/development-resources/client-side-authentication). | | `environment` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Use **test**. When you are ready to accept live payments, change the value to one of our [live environments](https://adyen.github.io/adyen-ios/5.0.0/documentation/adyen/environment/).  | **APIContext initialization** ```swift // When you are ready to go live, change environment to Environment.live // You can also use other environment values described in https://adyen.github.io/adyen-ios/Docs/Structs/Environment.html let apiContext = APIContext(environment: Environment.test, clientKey: clientKey) ``` 4. Initialize the MOLPay Component: ```swift let molpayComponent = MolPayComponent(paymentMethod: molpayPaymentMethod, apiContext: apiContext) molpayComponent.delegate = self // In this example, the Pay button will show 10 EUR. // The value is in minor units. Change the currencyCode to the currency for the MOLPay Component. molpayComponent.payment = Payment(amount: Amount(value: 1000, currencyCode: "EUR")) present(molpayComponent.viewController, animated: true) ``` ## Make a payment When the shopper proceeds to pay, the Component invokes the `didSubmit` method containing the `data.paymentMethod` from the `PaymentComponentDelegate`. 1. Pass the `data.paymentMethod` to your server. 2. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying: * `paymentMethod.type`: The `data.paymentMethod` from your client app. #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "reference":"YOUR_ORDER_NUMBER", "amount":{ "currency":"MYR", "value":1000 }, "{hint:data.paymentMethod from didSubmit}paymentMethod{/hint}":{ "type":"molpay_ebanking_fpx_MY", "issuer":"fpx_bkrm" }, "returnUrl":"my-app://adyen" }' ``` #### Java ```java // Adyen Java API Library v27.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("MYR") .value(1000L); MolPayDetails molPayDetails = new MolPayDetails() .type(MolPayDetails.TypeEnum.FPX_MY) .issuer("fpx_bkrm"); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(molPayDetails)) .returnUrl("my-app://adyen"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\CheckoutPaymentMethod; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Service\Checkout\PaymentsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("MYR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType("fpx_MY") ->setIssuer("fpx_bkrm"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("my-app://adyen"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "MYR", Value = 1000 }; MolPayDetails molPayDetails = new MolPayDetails { Type = MolPayDetails.TypeEnum.FpxMY, Issuer = "fpx_bkrm" }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(molPayDetails), ReturnUrl = "my-app://adyen" }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", reference: "YOUR_ORDER_NUMBER", amount: { currency: "MYR", value: 1000 }, paymentMethod: { type: "molpay_ebanking_fpx_MY", issuer: "fpx_bkrm" }, returnUrl: "my-app://adyen" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "MYR", Value: 1000, } molPayDetails := checkout.MolPayDetails{ Type: "molpay_ebanking_fpx_MY", Issuer: "fpx_bkrm", } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", PaymentMethod: checkout.MolPayDetailsAsCheckoutPaymentMethod(&molPayDetails), ReturnUrl: "my-app://adyen", } // 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 v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "reference": "YOUR_ORDER_NUMBER", "amount": { "currency": "MYR", "value": 1000 }, "paymentMethod": { "type": "molpay_ebanking_fpx_MY", "issuer": "fpx_bkrm" }, "returnUrl": "my-app://adyen" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :reference => 'YOUR_ORDER_NUMBER', :amount => { :currency => 'MYR', :value => 1000 }, :paymentMethod => { :type => 'molpay_ebanking_fpx_MY', :issuer => 'fpx_bkrm' }, :returnUrl => 'my-app://adyen' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "MYR", value: 1000 }; const molPayDetails: Types.checkout.MolPayDetails = { type: Types.checkout.MolPayDetails.TypeEnum.FpxMy, issuer: "fpx_bkrm" }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", paymentMethod: molPayDetails, returnUrl: "my-app://adyen" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` In the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, check the `action` object for the information that you must use to redirect the shopper. **/payments response** ```json { "resultCode":"RedirectShopper", "action":{ "paymentMethodType":"molpay", "method":"GET", "url":"https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=...", "type":"redirect" } } ``` 2. Pass the `action` object to your client app. You need this to initialize the Redirect Component. ## Handle the redirect 1. Use the [Redirect Component](/online-payments/build-your-integration/sessions-flow/?platform=iOS\&integration=Components#handle-the-redirect) to redirect the shopper to the issuing bank's app or website. 2. After the shopper returns to your app, make a POST [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request from your server and provide the `data` from the `didProvide` method from your client app. **/payments/details request** ```bash curl https://checkout-test.adyen.com/v72/payments/details \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "details": { "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ==" } }' ``` You receive a response containing: * `resultCode`: Use this to present the result to your shopper. * `pspReference`: Our unique identifier for the transaction. **/payments/details response** ```json { "resultCode": "Authorised", "pspReference": "FJM726V375BV9D82" } ``` ## Present the payment result Use the [resultCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-resultCode) that you received in the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to present the payment result to your shopper. The `resultCode` values you can receive for MOLPay online banking 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. | | **Cancelled** | The shopper cancelled the payment while on their bank's website. | Ask the shopper whether they want to continue with the order, or ask them to select a different payment method. | | **Error** | There was an error when the payment was being processed. | Inform the shopper that there was an error processing their payment. You'll receive a `refusalReason` in the same response, 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 MOLPay online banking payments network to confirm this. | Inform the shopper that you have 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](/development-resources/webhooks/webhook-types). | | **Refused** | The payment was refused by the shopper's bank. | Ask the shopper to try the payment again using a different payment method. | []()If the shopper failed to return to your website or app, wait for webhooks to know the outcome of the payment: | eventCode | success field | Description | Action to take | | ----------------- | ------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------- | | **AUTHORISATION** | **false** | The transaction failed. | Cancel the order and inform the shopper that the payment failed. | | **AUTHORISATION** | **true** | The shopper successfully completed the payment. | Inform the shopper that the payment has been successful and proceed with the order. | ## Test and go live Using any issuer ID that is available for the MOLPay eBanking Component for the respective country/region, make MOLPay online banking test payments to test the different payment results. Check the status of the MOLPay test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. Before you can accept live MOLPay payments, you need to [submit a request for MOLPay](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## See also * [iOS Components integration guide](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components) * [Webhooks](/development-resources/webhooks) * [Tokenization for recurring payments](/online-payments/tokenization) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)