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/android-turbo-sample-app- sample app repository.- In this repository, you will find the AAR files (libraries for Turbo) and the sample app source code to help you with the integration.
- The AARs on the main branch are for the UAT environment, the ones on the prod branch are for the production environment, and the mock branch is for the mock environment.
app/libs: All libraries (Bank, SecureComponent and Turbo) common for headless and UI SDKapp/build.gradle: All transitive dependencies needed to integrate Turbo SDK.
- Integrate with the Razorpay Android Custom SDK.
-
Import the following frameworks:
- Razorpay Turbo Wrapper Plugin SDK (maven)
- Razorpay Turbo Core SDK
- Mock SDK
-
Add the following lines to your Android project’s
gradle.propertiesfile:android.enableJetifier=trueandroid.useAndroidX=true
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.
- 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 that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should then transition to
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - The expected response should be
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data.
3.2 SIM not found
3.2 SIM not found
- Remove all SIM cards from the device.
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should then transition to
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant all the required permissions as prompted.
- The expected response should be
UpiTurboLinkAction = SELECT_SIMwithaction.getError()!=null(no errors).
3.3 Denied Permissions or Access Restricted
3.3 Denied Permissions or Access Restricted
- Remove all SIM cards from the device.
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should then trasition from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Deny the required permissions when prompted.
- The expected response should be
UpiTurboLinkAction = SHOW_PERMISSION_ERROR.
3.4 Account Found
3.4 Account Found
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - The SDK response should then transition from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the required permissions when prompted.
- After the permissions are granted, the SDK response should change to
UpiTurboLinkAction = SELECT_SIMwithaction.getError()==null(no errors). - Select Axis Bank or SBI Bank as mentioned in the Test Data.
- The expected response should be
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==null(no errors).
3.5 PIN
3.5 PIN
PIN set
PIN set
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - Check the response from SDK, which should switch from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the necessary permissions when prompted.
- The SDK response should then transition to
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==null(no errors). - Subsequently, you will receive another SDK response of
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select SBI Bank as specified in the Test Data.
- Following that, the SDK response should become
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select an account ending with xxxx0203.
- Expect the final response to confirm that an account with a PIN is already set and the UPI ID is linked.
PIN not set
PIN not set
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - Check the response from SDK, which should switch from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the necessary permissions when prompted.
- Subsequently, you will receive an SDK response of
UpiTurboLinkAction = SELECT_SIMwithaction.getError()==null(no errors). - Following that, you will receive another SDK response of
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Choose SBI Bank as specified in the Test Data.
- The SDK response should then become
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select an account ending with xxxx0001.
- Expect the final response to be
UpiTurboLinkAction = SETUP_UPI_PINwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data.
No Account for Specified Number
No Account for Specified Number
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - Check the response from SDK, which should switch from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the necessary permissions when prompted.
- Subsequently, you will receive an SDK response of
UpiTurboLinkAction = SELECT_SIMwithaction.getError()==null(no errors). - Following that, you will receive another SDK response of
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select HDFC or Yes Bank as mentioned in the Test Data.
- The expected response should be
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==null(no errors).
PIN set Successfully
PIN set Successfully
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - Check the response from SDK, which should switch from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the necessary permissions when prompted.
- Subsequently, you will receive an SDK response of
UpiTurboLinkAction = SELECT_SIMwithaction.getError()==null(no errors). - Following that, you will receive another SDK response of
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - The SDK response should then become
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select an account ending with xxxx0001.
- Following that, you will receive another SDK response of
UpiTurboLinkAction = SETUP_UPI_PINwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Enter the card details.
- The expected final response should be
UpiTurboLinkAction = STATUSwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data.
PIN Changed Successfully
PIN Changed Successfully
- Call the
razorpay.upiTurbo.changeUpiPinmethod with the correct PIN. - Expect a callback
onSuccess. Your PIN change has been successfully completed.
Invalid PIN or PIN not Matching
Invalid PIN or PIN not Matching
- Call the
razorpay.upiTurbo.changeUpiPinmethod with the correct PIN. - Expect a callback
onFailure. This means the PIN provided was invalid or did not match the expected PIN.
Incorrect OTP
Incorrect OTP
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - Check the response from SDK, which should switch from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the necessary permissions when prompted.
- Subsequently, you will receive an SDK response of
UpiTurboLinkAction = SELECT_SIMwithaction.getError()==null(no errors). - Following that, you will receive another SDK response of
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select SBI Bank as specified in the Test Data.
- The SDK response should then become
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select an account ending with xxxx0001.
- Following that, you will receive another SDK response of
UpiTurboLinkAction = SETUP_UPI_PINwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Enter the card details.
- Enter any random OTP except for 123456.
Incorrect Card Details(Reset PIN)
Incorrect Card Details(Reset PIN)
- Call the
razorpay.upiTurbo.resetUpiPinmethod with incorrect PIN and card details that are not mentioned in the Test Data. - Expect a callback
onFailure. This indicates that the reset attempt has failed due to incorrect card details.
5.6 UPI ID
5.6 UPI ID
UPI ID Present
UPI ID Present
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - Check the response from SDK, which should switch from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the necessary permissions when prompted.
- Subsequently, you will receive an SDK response of
UpiTurboLinkAction = SELECT_SIMwithaction.getError()==null(no errors). - Following that, you will receive another SDK response of
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select SBI Bank as specified in the Test Data.
- The SDK response should then become
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select an account ending with xxxx0203.
- Expect the final response to confirm that an account with a UPI ID is linked successfully.
New UPI ID Creation
New UPI ID Creation
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.linkNewUpiAccountmethod. - Check the response from SDK, which should switch from
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==null(no errors). - Grant the necessary permissions when prompted.
- Subsequently, you will receive an SDK response of
UpiTurboLinkAction = SELECT_SIMwithaction.getError()==null(no errors). - Following that, you will receive another SDK response of
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select Axis Bank as mentioned in Test Data.
- The SDK response should then become
UpiTurboLinkAction = SELECT_BANK_ACCOUNTwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Select an account ending with xxxx0001.
- Following that, you will receive another SDK response of
UpiTurboLinkAction = SETUP_UPI_PINwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data. - Enter the card details.
- The expected final response should be
UpiTurboLinkAction = STATUSwithaction.getError()==nullandaction.getData != null. This response should not have any errors, and it should contain some relevant data.
5.7 Transactions
5.7 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.
- 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.
- 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.
- 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.
- 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.
- Expect a callback on
onSuccess. 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.
- Expect a callback on
onFailure. 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 on
onSuccess. This confirms that your account has been successfully delinked.
5.8 Prefetch
5.8 Prefetch
5.8.1 First time onboarding
5.8.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
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==nullindicating no errors. - Prompt the user to grant the necessary permissions by calling
action.consents([consent]).requestPermission(). - Upon successful device binding, the process of fetching accounts will commence.
- Subsequently, expect the SDK’s response to transition to
UpiTurboLinkAction = STATUSwithaction.getError()==null, indicating no errors. - Once the account is successfully linked, you will receive a callback asynchronously in the
UpiTurboLinkAction=STATUSwith updated lists.
Denied Prefetch Consent
Denied Prefetch Consent
- Enter a mobile number that exists on the user’s device.
- Call
razorpay.upiTurbo.prefetchAndLinkUpiAccountsmethod. - The SDK’s initial response should shift to
UpiTurboLinkAction = ASK_FOR_PERMISSIONwithaction.getError()==nullindicating no errors. - Call either
action.requestPermission()oraction.consents([consent]).requestPermission()with afalsevalue in the consent object. - The device binding process is initiated, including SMS sending.
- After successful device binding, the expected response should transition to
UpiTurboLinkAction = SELECT_BANKwith no errorsaction.getError()==nulland should contain relevant data availableaction.getData != null.
PIN Set
PIN Set
- Call the
action.selectBankAccount(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.8.2 Accounts Already Onboarded
3.8.2 Accounts Already Onboarded
- Call the
razorpay.upiTurbo.prefetchAndLinkUpiAccountsmethod. - The SDK response should transition to
UpiTurboLinkAction = SELECT_BANKwithaction.getError()==nullandaction.getData != null. This response should not have any errors and should contain relevant data.
2.4 Additional Cases
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.2.5 TPV Cases
The following points are be considered for TPV flow:- 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.
- Payment can be made multiple times when using Mock for any given
order_id, which is not the case in production. - Use the
rzp_test_V5AtnjYvupQXm1API key id for TPV testing on the Mock environment.