Integrate Turbo UPI UI Mock SDK
Steps to integrate the Razorpay Turbo UPI UI Mock SDK with your app.
Mock SDK is a tool designed to facilitate your integration with Turbo UPI. Unlike conventional integration methods that rely on the stability of partner banks and NPCI UAT environments, Mock SDK removes this dependency, streamlining the integration process.
- No Dependency on UAT Environment: Traditional integration methods often encounter obstacles due to issues with UAT environments. Mock SDK removes this roadblock, enabling you to integrate without external dependency.
- Streamlines Integration: Mock SDK is designed to create a smoother integration experience, ensuring a hassle-free process. This allows you to quickly offer Turbo UPI services to the users.
- Effortless Integration for Essential Flows: Mock SDK simplifies the process of integrating Turbo for important scenarios. This enables you to expand your range of UPI services for customers without dealing with complex requirements.
- Seamless Transition to Production: After testing your integration with Mock SDK, you can smoothly transition to the Production SDK for final testing. This ensures a seamless and secure transition from development to live production.
-
Contact our
to get your app, and GitHub account whitelisted to get access to thehttps://github.com/upi-turbo/ios-sample-app
- sample app repository.- In this repository, you will find the framework files (libraries for Turbo) and the sample app source code to help you with the integration.
- Use branch
custom_ui/turbo_ui
to access the sample app and frameworks for Turbo UPI. The sample app workspace is divided into Prod, UAT and Mock environment targets with separate pod dependencies.
-
Integrate with the
. -
Add the below line of code to your the
Podfile
, to install Turbo pods:pod 'razorpay-customui-pod'pod 'razorpay-turbo-pod' -
Import the Turbo plugins as given below:
import Razorpayimport TurboUpiPlugin
Watch Out!
- The minimum supported iOS version for using Turbo UPI is currently 11.0.
- API Key Usage for Different Environments:
- Use the
rzp_test_0wFRWIZnH65uny
API key id for testing on the UAT environment. - Use the
rzp_test_vacN5cmVqNIlhO
API key id for testing on the Mock environment. - Use the for prod testing.
- Use the
Follow these steps to integrate with
.Razorpay has three environments: Mock, UAT and Prod. We recommend the following:
- Complete the integration with the Mock environment.
- Complete developer testing using to cover all the
- Perform the UAT using the Razorpay-provided API keys.
Use the following data to test the integration.
Following are the various scenarios based on the dependencies.
Given are the various test cases and their sequential steps.
In the scenario of successful device binding, follow these simple steps:
- Enter a mobile number which exists in the user's device.
- Call
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will be displayed.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will appear for bank selection.
In the event of a SIM card not being found, follow these steps:
- Remove all SIM cards from the device.
- Enter a mobile number which exists in the user's device.
- Call
razorpay.upiTurboUI.linkNewUpiAccount
method. - Expect the
completionHandler
function to be triggered with an error indicating SIM not founderror!=null
.
In the scenario where an account is found, follow these steps:
- Enter a mobile number which exists in the user's device.
- Call
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will be displayed for bank selection.
- Select either Axis Bank or SBI Bank, as mentioned in the .
- A screen with a list of bank accounts will appear for bank account selection.
Follow these steps to set or manage your PIN:
- Enter a mobile number which exists in the user's device.
- Call
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will be displayed for bank selection.
- Select SBI Bank, as mentioned in the .
- A screen with a list of bank accounts will appear for bank account selection.
- Select the account ending with xxxx0203, as mentioned in the .
- Expect the
completionHandler
function to be triggered with no errorserror==null
andupiAccounts != null
. The newly linked account will be the first object in the list.
Follow these steps when a PIN is not set:
- Enter a mobile number which exists in the user's device.
- Call
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will be displayed for bank selection.
- Select SBI Bank, as mentioned in the .
- A screen with a list of bank accounts will appear for bank account selection.
- Select an account ending with xxxx0001, as mentioned in the .
- A screen to enter card details will be displayed for this final step, allowing you to set your UPI PIN.
When there is no account associated with a particular number, follow these steps:
- Enter a mobile number which exists in the user's device.
- Call the
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will be displayed for bank selection.
- Select HDFC Bank, as mentioned in the .
- An empty screen for the list of bank accounts will be displayed.
For a successful PIN setup, follow these steps:
- Enter a mobile number which exists in the user's device.
- Call
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will be displayed for bank selection.
- Select Axis Bank, as mentioned in the .
- A screen with a list of bank accounts will appear for bank account selection.
- Select the account ending with xxxx0001, as mentioned in the .
- A screen to enter card details will be displayed to set your UPI PIN.
- Enter card details as mentioned in the and select Next.
- Submit the OTP as mentioned in the and the new PIN on the Mock NPCI screen.
- Expect the
completionHandler
function to be triggered with no errorserror==null
andupiAccounts != null
. The newly linked account will be the first object in the list.
When you need to change your PIN successfully, follow these steps:
- Call the
razorpay.upiTurboUI.manageUpiAccount
method. - A screen with a list of UPI accounts and their options will be displayed.
- Select Change PIN on any UPI account.
- Submit the old and new PIN on the Mock NPCI screen.
- An alert will be displayed confirming your PIN change was successful.
When dealing with an invalid PIN or a PIN that does not match, follow these steps:
- Call the
razorpay.upiTurboUI.manageUpiAccount
method. - A screen with a list of UPI accounts and their options will be displayed.
- Select Change Pin on any UPI account.
- Submit an incorrect old and new PIN on the Mock NPCI screen.
- An alert will be displayed, indicating that the provided PIN was invalid or did not match the expected PIN.
In situations where an incorrect OTP is encountered, follow these steps:
- Enter a mobile number which exists in the user's device.
- Call the
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will be displayed for bank selection.
- Select Axis Bank, as mentioned in the .
- A screen with a list of bank accounts will appear for bank account selection.
- Select the account ending with xxxx0001, as mentioned in the .
- A screen to enter card details will be displayed to set your UPI PIN.
- Enter card details as mentioned in the and select Next.
- Submit any random incorrect OTP except for 123456 as mentioned in the and the new PIN on the Mock NPCI screen.
- Expect the
completionHandler
function to be triggered with an errorerror!=null
.
When dealing with resetting your PIN with incorrect card details, follow these steps:
- Call the
razorpay.upiTurboUI.resetUpiPin
method. - A screen to enter card details will be displayed to set your UPI PIN.
- Enter incorrect card details that are not mentioned in the and select Next.
- Submit the OTP as mentioned in the and the new PIN on the Mock NPCI screen.
- An alert will be displayed, indicating that the reset attempt has failed due to incorrect card details.
When working with scenarios involving the presence of a UPI ID (Roaming Profile), follow these steps:
- Enter a mobile number which exists in the user's device.
- Call the
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- Expect the
completionHandler
function to be triggered with no errorserror==null
andupiAccounts != null
.
When dealing with scenarios related to UPI ID, such as new UPI ID creation, follow these steps:
- Enter a mobile number which exists in the user's device.
- Call the
razorpay.upiTurboUI.linkNewUpiAccount
method. - A screen with the Send SMS button will appear.
- Select Send SMS and send the SMS when prompted on the screen.
- A screen with a list of banks will be displayed for bank selection.
- Select SBI Bank, as mentioned in the .
- A screen with a list of bank accounts will appear for bank account selection.
- Select the account ending with xxxx0203, as mentioned in the .
- Expect the
completionHandler
function to be triggered with no errorserror==null
andupiAccounts != null
. The newly linked account will be the first object in the list.
When it comes to transactional scenarios, with a focus on ensuring a successful payment, follow these steps:
- Begin by following the , specifically the
submit
method. - Enter an amount that is lower than the account balance.
- Enter the correct PIN, on the Mock NPCI screen.
- Subsequently, you will receive a callback on
onPaymentSuccess
. This indicates that the payment has been successfully processed.
Handy Tips
The account balance remains unchanged, and the paid amount is not deducted.
In situations where an invalid PIN is entered, follow these steps:
- Begin by following the , specifically the
submit
method. - Enter an amount lower than the account balance mentioned in .
- Enter the incorrect PIN, on the Mock NPCI screen.
- Subsequently, you will receive a callback on
onPaymentError
. This indicates that an error occurred during the payment process due to the invalid PIN.
When dealing with transactional scenarios, specifically focusing on handling timeouts, follow these steps:
- Begin by following the , specifically the
submit
method. - Enter the amount as 24.
- Enter the correct PIN, on the Mock NPCI screen.
- Subsequently, you will receive a callback on
onPaymentError
. This indicates that an error occurred during the payment process due to a timeout.
When it comes to transactional scenarios with a focus on handling insufficient balance, follow these steps:
- Begin by following the , specifically the
submit
method. - Enter an amount greater than the account balance as mentioned in .
- Enter the correct PIN, on the Mock NPCI screen.
- Subsequently, you will receive a callback on
onPaymentError
. This indicates that an error occurred during the payment process due to insufficient balance.
For scenarios related to checking your balance, follow these steps:
- Call the
razorpay.upiTurboUI.manageUpiAccount
method. - A screen with a list of UPI accounts and their options will be displayed.
- Select Check Balance on any UPI account.
- Enter the correct PIN on the Mock NPCI screen.
- The requested balance information will be displayed for the selected UPI account.
When it comes to scenarios focused on checking your balance, follow these steps:
- Call the
razorpay.upiTurboUI.manageUpiAccount
method. - A screen with a list of UPI accounts and their options will be displayed.
- Select Check Balance on any UPI account.
- Enter an incorrect PIN, on the Mock NPCI screen.
- An alert will be displayed, indicating that the provided PIN was invalid or did not match the expected PIN.
When it comes to scenarios related to delinking your account, follow these steps:
- Call the
razorpay.upiTurboUI.manageUpiAccount
method. - A screen with a list of UPI accounts and their options will be displayed.
- Select the delete icon on any UPI account.
- An alert will be displayed, confirming that your account has been successfully delinked.
Follow these simple steps for the first time onboarding:
- Enter a mobile number that exists on the user's device.
- Call
razorpay.upiTurboUI.prefetchAndLinkUpiAccountsWithUI
method. - Grant the necessary permissions for prefetching and linking the account.
- The device binding process will then commence, which includes sending an SMS for verification.
- After successful device binding, a screen titled Fetching Accounts will be displayed, indicating that the system is retrieving bank account details.
- You will receive a callback
onResponse
containing two lists: accounts with PINs set and accounts without PINs set, helping you identify which accounts require further actions. - Once an account is linked, you will receive another callback
onResponse
asynchronously with updated lists of accounts. This callback indicates that the accounts are now fully linked and updated in the system.
For the first time onboarding, follow these steps:
- Enter a mobile number that exists on the user's device.
- Begin the onboarding process by calling the
razorpay.upiTurboUI.prefetchAndLinkUpiAccountsWithUI
method. - Deny the permissions for prefetching and linking when prompted.
- Despite denying permissions, the device binding process will initiate, including the sending of an SMS for verification.
- After successful device binding, a screen will appear displaying a list of banks available for selection. This step allows you to proceed with selecting a bank even after the initial permission denial.
Follow the below steps to set or manage your PIN:
- Initiate the UPI PIN setup by calling the
razorpay.upiTurboUI.setUpiPinWithUI
method. - A screen requesting card details will be displayed. Enter the necessary information from the provided.
- After submitting the card details, you will be prompted to enter an OTP. Use the OTP from the Test Data to proceed.
- Next, you will be directed to a screen to enter and confirm your new UPI PIN. Make sure the PIN entered matches the confirmation PIN to ensure successful setup.
- Call the
razorpay.upiTurboUI.prefetchAndLinkUpiAccountsWithUI
method. This action initiates the process for users who have previously completed the onboarding process. - After the method is called, a screen displaying a list of banks will be shown. This list allows the selection of a new or different bank for which the user wants to link an additional account.
- Select the bank for which you want to link the account.
Businesses should have the capability to display a user-friendly message to their customers for certain special or additional error scenarios. The SDK is equipped to simulate some of these cases.
Watch Out!
- Device Binding will only work if the user has at least one SIM card in their mobile device.
- Users can set/reset the UPI PIN. The configured PIN will be used to validate the transaction.
- Based on the for bank accounts, choose a bank for a single, multiple or no bank account.
- Use the same ATM PIN and card Number mentioned in the .
- The UPI PIN will revert to its default setting or be removed when you uninstall or clear storage.
- Amount ₹24 is blocked for special cases. Please refer to .
- Only one TPV whitelisted account (ending with xxxx0203) is permitted. Payments made using any other accounts will fail with the error Payment failed because the account linked to VPA is invalid.
- In the Mock environment, multiple payments can be made for a given
order_id
, which differs from the production environment where this is not allowed.
Complete this
to take your integration live.Is this integration guide useful?