--- title: "DuitNow iOS Component" description: "Add DuitNow to your existing iOS Components integration." url: "https://docs.adyen.com/payment-methods/duitnow/ios-component" source_url: "https://docs.adyen.com/payment-methods/duitnow/ios-component.md" canonical: "https://docs.adyen.com/payment-methods/duitnow/ios-component" last_modified: "2026-05-24T12:54:31+02:00" language: "en" --- # DuitNow iOS Component Add DuitNow to your existing iOS Components integration. [View source](/payment-methods/duitnow/ios-component.md) Our DuitNow Component renders DuitNow in your payment form and collects your shopper's selected bank. ## 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, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to add DuitNow in your Customer Area. | ### 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, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to add DuitNow in your Customer Area. | ## Show DuitNow in your payment form Include DuitNow 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): MY. * [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount-currency): MYR. * [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` **duitnow** and put it into an object. For example, `duitnowPaymentMethod`. 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 DuitNow Component: ```swift let duitnowComponent = DuitNowComponent(paymentMethod: duitnowPaymentMethod, apiContext: apiContext) duitnowComponent.delegate = self // In this example, the Pay button will show 10 MYR. // The value is in minor units. Change the currencyCode to the currency for the DuitNow Component. duitnowComponent.payment = Payment(amount: Amount(value: 1000, currencyCode: "MYR")) present(duitnowComponent.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/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "currency": "MYR", "value": 10000 }, "paymentMethod": { "type": "duitnow" }, "reference": "YOUR_ORDER_NUMBER" }' ``` #### Java ```java // Adyen Java API Library v39.3.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, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) // 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) $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v32.1.1 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the LIVE environment, also include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) // 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 v29.0.0 const { Client, 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 paymentRequest = { merchantAccount: "YOUR_MERCHANT_ACCOUNT", amount: { currency: "MYR", value: 10000 }, paymentMethod: { type: "duitnow" }, reference: "YOUR_ORDER_NUMBER" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 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) // 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 v13.6.0 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", "amount": { "currency": "MYR", "value": 10000 }, "paymentMethod": { "type": "duitnow" }, "reference": "YOUR_ORDER_NUMBER" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.0 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', :amount => { :currency => 'MYR', :value => 10000 }, :paymentMethod => { :type => 'duitnow' }, :reference => 'YOUR_ORDER_NUMBER' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.0.0 import { Client, 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) // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The response contains the following data: * `resultCode`: **Pending** * `action`: Contains the QR code `url` and `qrCodeData`. **/payments response** ```json { "pspReference": "8815658961765250", "resultCode": "Pending", "action": { "paymentData": "Ab02b4c0!BQABAgA...", "paymentMethodType": "duitnow", "type": "qrCode", "url": "https://test.adyen.com/hpp/generateQRCodeImage.shtml?url=DMhpN90TFR2e7TzwHYRFkhw4brxm2wHBg", "qrCodeData": "DMhpN90TFR2e7TzwHYRFkhw4brxm2wHBg" } } ``` ## Show the QR code Use the information in the `action` object of the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response to render the QR code. * `action.url`: Use this URL to download the QR code. * `action.qrCodeData`: Use this to render the QR code on your checkout page. The shopper can either scan the QR code, or take a screenshot of the QR code and upload it to their bank app. ## Show the payment result Use the `resultCode` from the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to show the payment outcome on your frontend. You will also receive the outcome of the payment asynchronously in a [webhook](/development-resources/webhooks). The `resultCode` values you can receive for DuitNow are: | 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. | If you are implementing an additional use case, you can [make a /payments/details call to receive an immediate response](/online-payments/build-your-integration). ## Test and go live Test DuitNow payments with real payment details and small amounts. Check the status of your test DuitNow payments in your **Customer Area** > **Transactions** > **Payments**. To accept live DuitNow payments, you must contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to add DuitNow in your live Customer Area. ## See also * [iOS Components integration guide](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components) * [Webhooks](/development-resources/webhooks) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)