CustomBrowserCallback
Describes how to create an object of PayUCustomBrowserCallback.
PayUCustomBrowserCallback provides following callback methods.
onPaymentFailure(String payuResult,String merchantResponse) - Calls when payment fails.
onPaymentSuccess(String payuResult,String merchantResponse) - Calls when payment succeeds.
onCBErrorReceived(int errorCode,String errormsg) - Called for any error in custom browser.
Following error messages are thrown in callback method.
setCBProperties(WebView webview, Bank payUCustomBrowser) - Callback where webview setting is done.
onBackButton(AlertDialog.Builder alertDialogBuilder) - This callback provides alert dialog access, so customisation can be done to alert dialog.
onBackApprove() - Calls when ‘ok’ is selected from alert dialog.
onBackDismiss()- Calls when ‘cancel’ is selected from alert dialog.
onPaymentTerminate() - Called when payment is terminated.
isPaymentOptionAvailable(CustomBrowserResultData resultData):Merchant must check for Samsung Pay/PhonePe payment option availability on customer device before showing Samsung Pay/PhonePe/Google Pay/UPI as payment option.This callback is called in response of checkForPaymentAvailability method present in CustomBrowser.Merchant can use value of resultData object like below.
onVpaEntered(String vpa, PackageListDialogFragment packageListDialogFragment)(Available since version 7.3.0) - Merchant must override this function and provide verifyVpaHash in case they want payment via UPI Collect flow.
To generate verifyVpaHash use command as validateVPA and var1 as Vpa address and calculate hash as described here.
Sample code for PayUCustomBrowserCallback:
Last updated