Are you looking for test card numbers?

Would you like to contact support?

No momento, esta página não está disponível em português
Payment-method icon

PayNow iOS Component

Add PayNow to your existing iOS Components integration.

Our PayNow Component renders PayNow in your payment form.

Before you begin

This page explains how to add PayNow to your existing iOS Components integration. The iOS Components integration works the same way for all payment methods. If you haven't done this integration yet, refer to our Components integration guide.

Before starting your PayNow integration:

  1. Make sure that you have set up your back end implementation for making API requests.
  2. Contact our Support Team to enable PayNow.

Show PayNow in your payment form

Include PayNow in the list of available payment methods.

  1. Specify in your /paymentMethods request:

  2. Decode the /paymentMethods response with the PaymentMethods structure.

    let paymentMethods = try JSONDecoder().decode(PaymentMethods.self, from: paymentMethodsResponse)

    Find paymentMethods.type paynow and put it into an object. For example, paynowPaymentMethod.

  3. Create an instance of APIContext with the following parameters:

Parameter name Required Description
clientKey -white_check_mark- Your client key.
environment -white_check_mark- Use test. When you're ready to accept live payments, change the value to one of our live environments
  1. Initialize the PayNow Component:
    let paynowComponent = paynowComponent(paymentMethod: paynowPaymentMethod, apiContext: apiContext)
    paynowComponent.delegate = self
    // In this example, the Pay button will show 10 SGD.
    // The value is in minor units. Change the currencyCode to the currency for the PayNow Component.
    paynowComponent.payment = Payment(amount: Amount(value: 1000,
                                                                  currencyCode: "SGD"))
    present(paynowComponent.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 request, specifying paymentMethod.type: the data.paymentMethod from your client app.

    The response contains the following data:

    • resultCode: Pending
    • action: Contains the QR code qrCodeData.

Show the QR code

Use the information in the action object of the /payments response to render 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.

Test and go live

Test PayNow payments with real payment details and small amounts.

Check the status of your test PayNow payments in your Customer Area > Transactions > Payments.

To accept live payments, you must contact our Support Team to add in your live Customer Area.

See also