iOS Native SDK
The iOS Native SDK(v5.3.2) is a tool that enables you to seamlessly integrate payment instruments saved in the customer’s PhonePe app into your iOS app’s checkout flow.
- With iOS Native SDK, businesses can effortlessly access and utilise the user’s saved payment methods like UPI accounts and Cards through their own checkout, making the checkout process smooth and convenient for users.
- This will help in enhancing overall user experience and will also help in improving SR.
How it works
- Step 1: Fetch and Display Payment Options: This is the initial setup when a user enters your checkout page.
- When the user lands on the checkout page, your app must call your backend to request an SDK Token.
- Your backend will then call two PhonePe APIs in sequence: first the Fetch Auth Token API for authorization, followed by the Init API to get the final SDK Token for User Accounts.
- Your backend returns this token to your app.
- Your app passes this token to the PhonePe SDK. Based on the SDK’s response, your app will render one of two options:
- A “Link” button for new users.
- A list of saved payment methods for returning users.
- Step 2: Create an Order and Initiate Payment: This process begins after the user selects a payment method and decides to pay.
- When the user clicks ‘Pay’, your app calls your backend to create a transaction order.
- Your backend calls PhonePe’s Create Order API to create the order and receive an order token.
- This order token is sent back to your app.
- Your app triggers the PhonePe SDK to perform the final payment, passing the order token and the selected instrument details.
- Step 3: Verify Payment Status: After the user completes the payment attempt, you must confirm the outcome.
- Your backend needs to verify the final transaction status. You can do this in two ways:
- Listen for the webhook: Receive an automated server-to-server update from PhonePe.
- Use the Check Status API: To check the transaction status.
- Based on the confirmed status, inform the user of the outcome (e.g., “Payment Successful”) within your app.
- Your backend needs to verify the final transaction status. You can do this in two ways:
By integrating the PhonePe iOS Native SDK, you can deliver a seamless checkout, provide faster payments, and improve overall customer experience.
What’s Next?
The next section will guide you through the initial setup of the iOS Native SDK. This is the first required step to begin the integration process.
Head over to the next section to learn how to securely setup the iOS SDK.