paymentCompletion- You receive the payment response here.
backPressed- If user has not yet initiated the transaction and she presses back button from the UPI payment options page, this callback is triggered. You can dismiss SDK's UI screen here.
onEnteringVPA- For validating the VPA entered by the user, we need to hit PayU's validate VPA api. This api needs hash. In this callback, you will get the vpa entered by the user. Use this value to generate required hash. When the hash is received from your server, send us the updated post params with the new hash.
paymentParams. Hashes authenticates that API request originates from the original source and not from any Man in the middle. Property
hashesis of type
PayUHasheshas 3 properties. Each of these 3 is used for a distinct API call. These 3 properties are defined below:
paymentRelatedDetailsForMobileSDKHash: This is required to get available upi payment options from which payment can be made.
paymentHash: This is required to create transaction at PayU's end.
validateVPAHash: This is required by validateVPA API in upi collect flow to check if provided VPA is registered with a bank account and is active or not. Not required in intent transactions.
validateVPAHashare given below
userCredentials(You have set it in
paymentParams, call following method of class
PayUAPIto get all available payment options to the you, "Merchant" :
Resultwith the value of type
PayUUPIPaymentOptionsin response's success param. Sample code shown below
PayUUPIPaymentOptionsobject received above, you can populate relevant UPI options on your checkout screen. As stated at the beginning of this document, you have three options to make payment 1. Intent 2. UPI Collect 3. Fallback for Google Pay
PayUUPIPaymentOptionsobject, you get array of objects of type
PayUSupportedIntentApp. These are essentially the apps which are supported by the SDK for intent payments. You can now query the SDK for payment options available for the "Current User" based on factors like if Bank/Payment-Service-Provider(PSP) apps are installed on the current user's device or not.
canUseGpayCollectmethods give you fallback options of Google Pay intent app which have approx 10% more success rate than general UPI collect payments . This means, if your user does not have Google Pay app installed, you can still show Google Pay option on your checkout and we will display these two fallback options upon Google pay selection by the user. Google Pay omni payment option takes user's phone number for UPI collect payment.
PayUIntentPaymentVCand following data to it.
PayCollectPaymentVCby following code convenience method