Use this guide to integrate Pesaswap SDK to your iOS app. You can use the following app as a reference with your Pesaswap credentials to test the setup. You can also check out the app on Apple TestFlight to test the payment flow.
Requirements
- iOS 13.0 and above
- CocoaPods
- npm
1. Setup the Server
Follow the Server Setup section.2. Build Checkout Page on Your App
2.1 Configure Your Repository with Pesaswap Dependency
CocoaPods Setup (only required if not already done)
Install the latest version of CocoaPods. To create a Podfile, run the following command:SDK Setup
Add these lines to your Podfile:.xcworkspace file rather than the .xcodeproj file.
To update to the latest version of the SDK, run:
2.2 Setup the SDK and Fetch a Payment
Set up the SDK using your publishable key. This is essential for initializing a PaymentSession.2.3 Complete the Payment on Your App
Fetch a Payment
Request your server to fetch a payment as soon as your view is loaded. Store theclient_secret returned by your server. The PaymentSession will use this secret to complete the payment process.