Airwallex logo
Airwallex logo

Native UI integration

Airwallex iOS SDK provides native UI screens to facilitate the integration of payment functions. You can use the prebuilt payment flow to present payment flow to your shopper and the edit shipping info flow to manage shipping info of the order.

Payment flow

General steps for initiating a one-off payment (guest user checkout) and retrieving the payment result are as follows:

  1. (Optional) Create a Customer API if you want to save your customer's details and attach payment information to them. Note that this step is compulsory when you process recurring payment for a new customer.
  2. Create a Payment Intent API on your server and pass it to your client.
  3. Create a payment session with the corresponding payment type and order information.
  4. Present payment flow by passing payment session to the Airwallex iOS SDK.
  5. Query and present payment result in callback functions.

See integration steps for Apple Pay, Card, Redirect.

When incorporating the WeChat Pay module, you will need to implement another callback function onResp declared by WeChat SDK to check the payment result. This function will be invoked when the shopper completes the payment in WeChat app and gets redirected back to your app.

For recurring payments, see iOS recurring payments integration guide.

Edit shipping info flow

Use AWXShippingViewController to allow users to provide a shipping address as well as select a shipping method. The shipping parameter is optional. After successfully saving the shipping details, it will return a shipping object.

swift
1let controller = AWXShippingViewController(nibName: nil, bundle: nil)
2controller.delegate = self
3controller.shipping = shippingAddress
4let nav = UINavigationController(rootViewController: controller)
5navigationController?.present(nav, animated: true)

Custom theme

You can overwrite the color value in your app to customize the theme of SDK pages.

swift
1AWXTheme.shared().tintColor = .red
Was this page helpful?