Before you start
Follow these steps to set up Airwallex iOS SDK.
Requirements
- Requires Xcode 15.4 or later and is compatible with apps targeting iOS 13 or above
- Available through Swift Package Manager and CocoaPods . Please install the latest version of CocoaPods to ensure you can add Airwallex SDK to your application.
Step 1: Set up SDK
Swift Package Manager
Airwallex for iOS is available via Swift Package Manager. To integrate it into your project, follow these steps:
Follow Apple's guide on how to add a package dependency in Xcode.
Use the following URL for the Airwallex package: https://github.com/airwallex/airwallex-payment-ios
Ensure you specify version 6.1.1 or later.
You can add Airwallex
for a comprehensive integration that includes everything except WeChat Pay. Alternatively, you can selectively add specific products to your project for a more modular setup, depending on your payment needs:
AirwallexPaymentSheet
: For UI integration.AirwallexPayment
: For low-level API integration.AirwallexWeChatPay
: Required for WeChat Pay integration.
CocoaPods
Airwallex for iOS is available via CocoaPods .
You can add Airwallex
for a comprehensive integration that includes everything except WeChat Pay:
Alternatively, you can selectively add specific products to your project for a more modular setup, depending on your payment needs:
Run the following command:
Step 2: Set up your server to access Airwallex API
Obtain your access token API using your unique Client ID and API key accessible via web app (Account > Developer > API keys).
Before processing a payment, your server must create a PaymentIntent API and pass it to the client. After the payment is completed, your server needs to retrieve the PaymentIntent API to check the payment result.
Step 3: Configure SDK
- Import the module where you want to use the Airwallex iOS SDK
- Configure the working mode for SDK and the client secret
When your app starts:
- Set the mode for SDK to connect with different Airwallex server environments.
- Pass your client secret to the SDK, which can be obtained from the response of either Create a Payment Intent API and Generate a client secret for a Customer API.