It supports recovering transactions in case of low/no network bandwidth so as to reduce drop-offs.
Sure Pay in action


Add below permission in your application's AndroidManifest.xml.

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

SurePay Configurations

SurePay Mode

Sets the SurePay mode from Warn mode(to show SurePay Dialog in case of low speed network) of Fail mode( to show SurePay Dialog in case of no network/ network error).Recommended flow is Fail Mode.

setSurePayMode​(int surePay)
Input params: Can be WARN_MODE/FAIL_MODE
Default: WARN_MODE


By the time CustomBrowser detects good network, if CBWebview is destroyed, we resume the transaction by passing payment post data to, this, merchant checkout activity.

customBrowserConfig.setMerchantCheckoutActivityPath(<Absolute Activity Path>);

Customising Notifications

All the notifications which will appear during a SurePay transaction can be customised as per the merchant’s needs. You can customise the icon, the header, sub-header and the message body of all the notifications which appear.

  • Better network Identified : This notification is fired when a better network is identified by SurePay. Use below method to customise notification when a better network is identified.Default value is Internet Restored.

  • No network found after timeout : This notification is fired when the threshold value until which SurePay looks for a good network is over and the user cannot resume the transaction from that point. Use below mentioned methods to customise notification when threshold value is elapsed.

customBrowserConfig.setSurePayNotificationPoorNetWorkTitle();//Default Value is “No Internet Found”
customBrowserConfig.setSurePayNotificationPoorNetWorkBody();//Default value is “We could not detect internet on your device”
  • Notification for Success transaction : This notification is fired when bank confirms the status of the transaction when it is dropped in the backward leg. Use below mentioned methods to customise notification for success transaction.

customBrowserConfig.setSurePayNotificationTransactionVerifiedHeader();//Default value is "Transaction Verified"
customBrowserConfig.setSurePayNotificationTransactionVerifiedBody();//Default value is "The bank has verified this transaction and we are good to go.”
  • Notification for unknown Transaction : This notification is fired when the bank cannot confirm the status of the transaction dropped in the backward leg at that given point of time. Use below mentioned methods to customise notification for unknown transaction.

customBrowserConfig.setSurePayNotificationTransactionNotVerifiedHeader(); //Default value is "Transaction Status Unknown"
customBrowserConfig.setSurePayNotificationTransactionNotVerifiedBody();//Default value is "The bank could not verify the transaction at this time."
  • Set SurePay notification icon :

// input param:​ Drawable Resource (Default value is R.drawable.surepay_logo)
customBrowserConfig.setSurePayNotificationIcon(int intRes)

Important Points to Consider

  • Even​ after following the steps mentioned above, if Sure pay is not working - make sure that any Custom webviewclient is not set or is set to a class that must extends PayUSurePayWebViewClient.

  • It is important for SurePay to work correctly that you set PG URL and POST data in respective methods. If you are not hitting the PG from app and the traffic is being route through your web server, please provide the corresponding url and post data in the methods mentioned above.

  • MerchantCheckoutActivity​ is an important configuration to set. This will help in recovering transactions even if the user has killed CB.

  • Settings on Admin Panel Values of flags that should be set on merchant panel for SurePay (Please contact your Key account manager to get this done.)

    1. disable_duplicate_txnid​ : 0

    2. include_txnid_in_duplicacy​: 0

    3. overseas_merchant​: 0