Advantages
Advantages
- 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.
Prerequisites
Prerequisites
-
Contact our integrations team to get your app, and GitHub account whitelisted to get access to the
https://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 do the entire integration.
- Use branch
custom_ui/turboto access sample app and framework for Turbo UPI. The sample app workspace is divided into Prod, UAT and Mock environment targets with separate pod dependencies.
- Integrate with the Razorpay iOS Custom SDK.
-
Add the below line of code to your
Podfile, to install Turbo pods:
- Import the Turbo plugin as given below:
1. Integration Steps
Follow these steps to integrate with Turbo UPI Headless.2. Test Integration
Razorpay has three environments: Mock, UAT and Prod. We recommend the following:- Complete the integration with the Mock environment.
- Complete the developer testing using the Test Data to cover all the Test Cases.
- Perform the UAT using the Razorpay-provided API keys.
2.1 Test Data
Use the following data to test the integration.Bank List
Bank List
Bank Accounts
Bank Accounts
2.2 Test Case Coverage
Following are the various scenarios based on the dependencies.Dependencies and Scenarios
Dependencies and Scenarios
2.3 How to Test?
Given are the various test cases and their sequential steps.3.1 Device Binding Success
3.1 Device Binding Success
- Enter a mobile number which exists in the user’s device.
- Call the
razorpay.upiTurbo.linkNewUpiAccountmethod. - The expected response should be
LinkUpiAction = .selectBankwithaction.error==null(no errors) andaction.data != nullindicating a list of available banks for selection.
3.2 SIM not found
3.2 SIM not found
- Remove all SIM cards from the device.
- Enter a mobile number which exists in the user’s device.
- Call the
razorpay.upiTurbo.linkNewUpiAccountmethod. - The expected response should be
LinkUpiAction = .linkAccountResponsewithaction.error!=nullincluding an error message sim not found.
3.3 Account Found
3.3 Account Found
- Enter a mobile number which exists in the user’s device.
- Call the
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should change to
LinkUpiAction = .sendSmswithaction.error==null(no errors). - Call
action.registerDevice(), send the SMS when prompted on the screen. - The SDK response should change to
LinkUpiAction = SELECT_BANKwithaction.error==null(no errors) andaction.data != nullindicating a list of available banks for selection. - Call
action.selectedBank()with the Axis Bank or SBI Bank object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .selectBankAccountwith no errorsaction.error==nulland a list of available bank accounts for selectionaction.data != null, with at least one object.
3.4 PIN
3.4 PIN
PIN set
PIN set
- Enter a mobile number which exists in the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response changes to
LinkUpiAction = .sendSmswith no errorsaction.error==null. - Call
action.registerDevice()and send the SMS when prompted on the screen. - The SDK response changes to
LinkUpiAction = .selectBankwith no errorsaction.error==nulland a list of available banks for selectionaction.data != null. - Call
action.selectedBank()with the SBI Bank object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .selectBankAccountwith no errorsaction.error==nulland a list of available bank accounts for selectionaction.data != null. - Select the bank account ending with xxxx0203, as mentioned in the Test Data.
- The expected response should be
LinkUpiAction = .linkAccountResponsewith no errorsaction.error==nulland UpiAccounts data availableaction.data != null.action.datawill have a list of UpiAccounts for which PIN is already set and UPI ID linked, including the newly linked account as the first object.
PIN not set
PIN not set
- Enter a mobile number which exists in the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response changes to
LinkUpiAction = .sendSmswith no errorsaction.error==null. - Call
action.registerDevice()and send the SMS when prompted on the screen. - The SDK response changes to
LinkUpiAction = .selectBankwith no errorsaction.error==nulland a list of available banks for selectionaction.data != null. - Call action.selectedBank() with Axis Bank or SBI Bank object from action.data as mentioned in the Test Data.
- The expected response should be
LinkUpiAction = .selectBankAccountwith no errorsaction.error==nulland a list of available bank accounts for selectionaction.data != null. - Call
action.selectedBankAccount()with bank account ending with xxxx0001 object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .setUpiPinwith no errorsaction.error==nulland bank account data availableaction.data != null.
No Account for Specified Number
No Account for Specified Number
- Enter a mobile number which exists in the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response changes to
LinkUpiAction = .sendSmswith no errorsaction.error==null. - Call
action.registerDevice()and send the SMS when prompted on the screen. - The SDK response changes to
LinkUpiAction = .selectBankwith no errorsaction.error==nulland a list of available banks for selectionaction.data != null. - Call
action.selectedBank()with HDFC object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .selectBankAccountwith no errorsaction.error==nulland an empty array foraction.data.
PIN set Successfully
PIN set Successfully
- Enter a mobile number which exists in the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response changes to
LinkUpiAction = .sendSmswith no errorsaction.error==null. - Call
action.registerDevice()and send the SMS when prompted on the screen. - The SDK response changes to
LinkUpiAction = .selectBankwith no errorsaction.error==nulland a list of available banks for selectionaction.data != null. - Call
action.selectedBank()with Axis Bank or SBI Bank object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .selectBankAccountwith no errorsaction.error==nulland a list of available bank accounts for selectionaction.data != null. - Call
action.selectedBankAccount()with the bank account ending with xxxx0001 object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .setUpiPinwith no errorsaction.error==nulland data availableaction.data != null. - Call
action.setUpiPin()with bank account and card details data as mentioned in the Test Data. - Submit OTP (as mentioned in the Test Data) and New PIN on Mock NPCI screen.
- The expected final response should be
LinkUpiAction = .linkAccountResponsewith no errorsaction.error==nulland data availableaction.data != null.action.datawill have a list of UPI Accounts for which PIN is already set and UPI ID linked. The list will include the newly linked account as the first object.
PIN Changed Successfully
PIN Changed Successfully
- Call
razorpay.upiTurbo.changeUpiPinwith the specified upiAccount. - Submit the old and new PIN on the Mock NPCI screen.
- Expect a callback with
onSuccess. Your PIN change has been successfully completed.
Invalid PIN or PIN not Matching
Invalid PIN or PIN not Matching
- Call
razorpay.upiTurbo.changeUpiPinwith the specified upiAccount. - Submit incorrect old and new PIN on the Mock NPCI screen.
- Expect a callback with an error that is not null. This indicates that the provided PIN was either invalid or did not match the expected PIN.
Incorrect OTP
Incorrect OTP
- Enter a mobile number which exists in the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should change to
LinkUpiAction = .sendSmswithaction.error==nullno errors. - Call
action.registerDevice(), and send the SMS when prompted on the screen. - The SDK response should change to
LinkUpiAction = .selectBankwithaction.error==null(no errors) and a list of available banks for selectionaction.data != null. - Call
action.selectedBank()with the Axis Bank or SBI Bank object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .selectBankAccountwithaction.error==null(no errors) and a list of available bank accounts for selectionaction.data != null. - Call
action.selectedBankAccount()with the bank account ending with xxxx0001 object from action.data as mentioned in the Test Data. - The expected response should be
LinkUpiAction = .setUpiPinwithaction.error==nulland action.data != null. - Call
action.setUpiPin()with bank account and card details data as mentioned in the Test Data. - Submit any random incorrect OTP except for 123456 as mentioned in the Test Data and the new PIN on the Mock NPCI screen.
- The expected final response should be
LinkUpiAction = .linkAccountResponsewithaction.error!=null.
Incorrect Card Details (Reset PIN)
Incorrect Card Details (Reset PIN)
- Call the
razorpay.upiTurbo.resetUpiPinmethod, providing an incorrect PIN and card details not mentioned in the Test Data. - Expect a callback, and if the response includes an error
error != nil, it signifies that the reset attempt has failed due to incorrect card details.
3.5 UPI ID
3.5 UPI ID
UPI ID Present (Roaming Profile)
UPI ID Present (Roaming Profile)
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should change to
LinkUpiAction = .sendSmswithaction.error==nullno errors. - Call
action.registerDevice()and send the SMS when prompted on the screen. - The expected final response should be
LinkUpiAction = .linkAccountResponsewithaction.error==nullandaction.data != null.action.datawill contain a list of UPI Accounts for which the PIN is already set, and the UPI ID is linked.
New UPI ID Creation
New UPI ID Creation
- Enter a mobile number which exists in the user’s device.
- Call the
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should change to
LinkUpiAction = .sendSmswith action.error==nullno errors. - Call
action.registerDevice()and send the SMS when prompted on the screen. - The SDK response should change to
LinkUpiAction = .selectBankwithaction.error==nullno errors and a list of available banks for selectionaction.data != null. - Call
action.selectedBank()with Axis Bank or SBI Bank object fromaction.dataas mentioned in the Test Data. - The expected response should be
LinkUpiAction = .selectBankAccountwithaction.error==nullno errors and a list of available bank accounts for selectionaction.data != null. - Call
action.selectedBankAccount()with the bank account ending with xxxx0001 object fromaction.dataas mentioned in the Test Data. - The expected final response should be
LinkUpiAction = .linkAccountResponsewithaction.error==nulland action.data != null.action.datawill contain a list of UPI Accounts for which the PIN is already set, and the UPI ID is linked. The list will include the newly linked account as the first object.
3.6 Transactions
3.6 Transactions
Payments Successful
Payments Successful
- Begin by following the integration steps, specifically the
submitmethod. - 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.
Invalid PIN
Invalid PIN
- Begin by following the integration steps, specifically the
submitmethod. - Enter an amount lower than the account balance mentioned in Test Data.
- 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.
Timeout
Timeout
- Begin by following the integration steps, specifically the
submitmethod. - 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.
Insufficient Balance
Insufficient Balance
- Begin by following the integration steps, specifically the
submitmethod. - Enter an amount greater than the account balance as mentioned in Test Data.
- 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.
Show Balance
Show Balance
- Call the
razorpay.upiTurbo.getBalancemethod. - Enter the correct PIN on the Mock NPCI screen.
- Expect a callback with
AccountBalanceanderror != nil. This confirms that you will receive the requested balance information.
Check Balance - Invalid PIN
Check Balance - Invalid PIN
- Call the
razorpay.upiTurbo.getBalancemethod. - Enter an incorrect PIN on the Mock NPCI screen.
- Expect a callback with
error != nil. This indicates that an error occurred during the payment process due to the invalid PIN.
Delink Account - Success
Delink Account - Success
- Call the
razorpay.upiTurbo.delinkmethod. - Expect a callback with
error != nil. This confirms that your account has been successfully delinked.
3.7 Prefetch
3.7 Prefetch
3.7.1 First Time Onboarding
3.7.1 First Time Onboarding
Onboarding Success
Onboarding Success
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.prefetchAndLinkUpiAccountsmethod. - The SDK’s initial response should shift to
LinkUpiAction = .consentwithaction.error==nullindicating no errors andaction.data != nullshowing a list of prefetch banks. - Prompt the user to grant the necessary consent by calling
action.consents([consent]). - The SDK response should change to
LinkUpiAction = .sendSmswithaction.error==nullno errors. - Use
action.registerDevice()to send the SMS when prompted on the screen. - After successful device binding, account fetching will commence automatically.
- Expect the final response to be
LinkUpiAction = .linkAccountResponsewithaction.error==nullno errors andaction.data != null. Theaction.datawill containUpiAllAccountsas a response, which includesaccountsWithPinSetandaccountsWithPinNotSet. - Once the account is successfully linked, you will receive a callback asynchronously in the
LinkUpiAction = .linkAccountResponsewith updated lists.
Denied Prefetch Consent
Denied Prefetch Consent
- Enter a mobile number that exists on the user’s device.
- Initiate the onboarding process by calling
razorpay.upiTurbo.prefetchAndLinkUpiAccountsmethod. - Verify the SDK response, which should transition to
LinkUpiAction = .consentwithaction.error==nullindicating no errors andaction.data != null, providing a list of prefetchBanks. - Proceed by calling
action.consents([consent])with acknowledge set to false. - Check the SDK response, which should change to
LinkUpiAction = .sendSmswithaction.error==nullindicating no errors. - Use
action.registerDevice()to send the SMS when prompted on the screen. - After successful device binding, expect the response to transition to
LinkUpiAction = .selectBankwithaction.error==nullindicating no errors andaction.data != null, indicating a list of available banks for selection.
PIN Set
PIN Set
- Call the
action.setUpiPin(bankAccount, card)method to select the desired bank account fetched during the prefetch process. - On the next screen, enter the bank OTP from the Test Data and proceed.
- Enter and confirm the PIN on the subsequent screens.
3.7.2 Accounts Already Onboarded
3.7.2 Accounts Already Onboarded
- Call the
razorpay.upiTurbo.prefetchAndLinkUpiAccountsmethod. - After successful device binding, the expected SDK response should be
LinkUpiAction = .selectBankwithaction.error==nullandaction.data != null. This response should not have any errors and should contain relevant data.