Migration From Android Embedded to Android Intent SDK

  1. Remove the below code from ‘repositories’ section of your project level build.gradle file
maven {
  url  '<url>'
  credentials {
    username '<username>'
    password '<password>'
  }
}
  1. Add the below code to ‘repositories’ section of your project level build.gradle file.
maven {
 url  "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"
}
  1. Remove below line from ‘dependencies’ section of your app build.gradle.
compile 'phonepe.thinsdk.android.release:merchantsdk:x.x.x'
  1. Add below line to ‘dependencies’ section of your app build.gradle.
    For release notes.
implementation 'phonepe.intentsdk.android.release:IntentSDK:0.1.5.3'
implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
  1. Remove the import statements as mentioned below in your java class:
import com.phonepe.android.sdk.api.PhonePeInitException;
import com.phonepe.android.sdk.api.builders.TransactionRequestBuilder;
import com.phonepe.android.sdk.base.model.TransactionRequest;
  1. Add the import statements as mentioned below in your java class:
import com.phonepe.intent.sdk.api.PhonePeInitException;
import com.phonepe.intent.sdk.api.TransactionRequest;
import com.phonepe.intent.sdk.api.TransactionRequestBuilder;
  1. Add below lines inside application tag of your AndroidManifest.xml file.
<!-- Keep it true in testing environment to view the log statements-->
<meta-data
   android:name="com.phonepe.android.sdk.Debuggable"
   android:value="false"/>

<!-- Keep it true in testing environment-->
<meta-data
   android:name="com.phonepe.android.sdk.isUAT"
   android:value="false"/>
  1. Display the PhonePe option only when PhonePe app is installed in the device.
  • Display the PhonePe option on your checkout page only when PhonePe app is installed on the device.
  • You may call below SDK function to check the PhonePe app availability in the device.
try {
    PhonePe.isUPIAccountRegistered(new ShowPhonePeCallback() {
        @Override
        public void onResponse(boolean show) {
            Log.d(TAG, "onResponse: "+show);
            Toast.makeText(MainActivity.this, show? "YES":"NO", Toast.LENGTH_SHORT).show();
        }
    });
} catch (PhonePeInitException e) {
    e.printStackTrace();
}