Android SDK Migration to Latest Version

Current Latest Version: 2.4.1

Step 1: Replacing the Dependencies

Replace old dependencies with the following dependencies:

implementation 'phonepe.intentsdk.android.release:IntentSDK:2.4.1'

Step 2: Remove all meta-data tags

Remove all meta-data tags (related to PhonePe payment SDK).

Before removing meta-data tags

Note down the values in com.phonepe.android.sdk.MerchantId & com.phonepe.android.sdk.AppId meta-data tag.

The following meta-data tags might be present in 2.1.1 or older SDKs:

<meta-data android:name="com.phonepe.android.sdk.isUAT" android:value="true"/> 
<meta-data android:name="com.phonepe.android.sdk.isSimulator" android:value="true"/>
<meta-data android:name="com.phonepe.android.sdk.MerchantId" android:value="merchantId"/> 
<meta-data android:name="com.phonepe.android.sdk.AppId" android:value="appId"/>

Step 3: Replace the old init method

Old PhonePe init syntax

 PhonePe.init(Context context)

Replace with the new PhonePe init syntax

PhonePe.init(Context context,PhonePeEnvironment environment,String merchantId, String appId)

Where,

  • String environment can be
    • PhonePeEnvironment.PRODUCTION
    • PhonePeEnvironment.SANDBOX
  • String merchantId = value in com.phonepe.android.sdk.MerchantId tag.
  • String appId = value in com.phonepe.android.sdk.AppId tag.

Example:
PhonePe.init(context, PhonePeEnvironment.UAT, ”REPLACE_WITH_YOUR_MID”, “REPLACE_WITH_YOUR_APP_ID”)