Key Notes

  • Debit init call is allowed only in the ACTIVE state of the subscription.

  • Cancel/Revoke flows are only allowed after the subscription is ACTIVE.

  • Recurring debit payment will be skipped if cancellation/revoke flow is triggered after notification callback and before the Debit Execute call.

  • Recurring debit payment will succeed if Cancellation/Revoke flow is triggered after the Debit Execute call and before the Debit Execute callback.

  • If Revoke flow is triggered then cancel flow will throw an exception, and vice versa is also true.

Code Snippet to Get PhonePe App VersionCode

  1. Code Snippet to fetch the PhonePe App version code installed in the user's device.
public long getPhonePeVersionCode(Context context)
    PackageInfo packageInfo = null;
    long phonePeVersionCode = -1L;
    try {
        packageInfo = getPackageManager().getPackageInfo(PHONEPE_PACKAGE_NAME_UAT,PackageManager.GET_ACTIVITIES);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
            phonePeVersionCode = packageInfo.getLongVersionCode();
        } else {
            phonePeVersionCode = packageInfo.versionCode;
    } catch (PackageManager.NameNotFoundException e) {
        Log.e(TAG, String.format("failed to get package info for package name = {%s}, exception message = {%s}",
                PHONEPE_PACKAGE_NAME_UAT, e.getMessage()));
    return  phonePeVersionCode;
  1. Add the below line in your AndroidManifest.xml file
    <package android:name="" />
    <package android:name="" />