Integration
You can integrate with the CheckoutPro mobile SDK in 5 steps:
1.Include the SDK in your app project (Mandatory Step)
The CheckoutPro SDK is offered via npm.
Use below step to include CheckoutPro SDK in your app:
Next, add the following imports in the class where you need to initiate a payment
For iOS
Checkoutpro is a dynamic framework. If you are not using 'use_frameworks!', then please add the following line at the end of your podfile.
After updating the podfile, install the pod using below command.
2. Set up the payment hashes (Mandatory Step)
Detailed document is present here.
3. Build the payment parameters (Mandatory Step)
To initiate a payment, your app will need to send transactional information to the Checkout Pro SDK.
Payment Params:
Parameter | Type | Description | Data Type & Validation | Mandatory |
key | String | Merchant key received from PayU | Can not be null or empty | Yes |
transactionId | String | It should be unique for each transaction | Can not be null or empty and should be unique for each transaction. It can not contain special characters like :-_/ | Yes |
amount | String | Total transaction amount | Can not be null or empty and should be valid double stringified eg, “100.0” | Yes |
productInfo | String | Information about product | Can not be null or empty | Yes |
firstName | String | Customer’s first name | Can not be null or empty | Yes |
String | Customer’s email id | Can not be null or empty | Yes | |
phone | String | Customer’s phone number | Should be a valid phone number | Yes |
ios_surl | String | [iOS] When the transaction gets success, PayU will load this url and pass transaction response | Should be a valid URL | Yes |
ios_furl | String | [iOS] When the transaction gets fail, PayU will load this url and pass transaction response | Should be a valid URL | Yes |
android_surl | String | [Android] When the transaction gets success, PayU will load this url and pass transaction response | Should be a valid URL | Yes |
android_furl | String | [Android] When the transaction gets fail, PayU will load this url and pass transaction response | Should be a valid URL | Yes |
environment | String | Environment of SDK | "0" for Production and "1" for Test | Yes |
User Credential | String | This is used for the store card feature. PayU will store cards corresponding to passed user credentials and similarly, user credentials will be used to access previously saved cards | Should be a unique value Format : <merchantKey>:<userId> Here, UserId is any id/email/phone number to uniquely identify the user | No |
Refer here for help regarding SI Params.
Additional Params:
Additional params are optional params that can be passed to SDK like udf params, static hashes. More details on static hash generation and passing is mentioned in hash generation section. Below is list of params that can be passed in additional params -
Parameter | Type | Description | Mandatory |
udf1 | String | User defined field, Merchant can store their customer id, etc. | No |
udf2 | String | User defined field, Merchant can store their customer id, etc. | No |
udf3 | String | User defined field, Merchant can store their customer id, etc. | No |
udf4 | String | User defined field, Merchant can store their customer id, etc. | No |
udf5 | String | User defined field, Merchant can store their customer id, etc. | No |
Static Hashes | String | Covered in the Hash Generation section | No |
Payment param and additional param can be passed as below:
4. Initiate the payment (Mandatory Step)
Initialise and launch the Checkout Pro SDK by calling the following method
5.Handle the payment completion (Mandatory Step)
To get the callbacks for payment-related statuses create an object of NativeEventEmitter and subscribe to the below events.
Native Changes For Android
Build.gradle
AndroidManifest.xml
In order to Autofill OTP on bank pages SDK requires "RECEIVE_SMS" permission so kindly add the same in your AndroidManifest.xml like below.
Native Changes For iOS
For UPI Intent (Optional Step)
Currently we support only PhonePe and GooglePay via Intent. Add the query schemes in info.plist
Distributing your app (App Store / Ad-hoc) (Mandatory Step)
What you get by default is a fat framework that allows you to test your app seamlessly on device as well as simulator. But before archiving your app, you need to remove simulator slices from the framework. Please see the doc which assists in archiving your app with PayUChekoutPro integrated.
Last updated