paytm integration android example sdk 2.1

Paytm Integration Android Example SDK 2.1 Step by Step

Paytm Intergration SDK 2.1 Android Example

If you want to receive payment in India then paytm integration is very popular and easy to use. Paytm accept all types of payment like wallet payment and Debit card/credit card payment. In this android tutorial, You will learn how to integrate Paytm SDK 2.1 on android app in four easy steps. Here is the office link for Paytm SDK integration. First create a developer account using this link – Paytm Developer Account

Paytm Integration Android Step

Easy 4 Step Process

1) Create Login & Get Credentials from paytm integration
2) Upload PHP file on your server for Checksum Generation
3) Add Paytm SDK 2.1 jar file & Gradle Dependency
4) Get Checksum value from your server PHP file
5) Call Paytm Service to Make Payment

Login & Download source code



Get Credentials from Paytm

You need to create developer account on Paytm. There you don’t need to upload doc to start your development. You can go to sandbox and can get credential. Please note down all the values for future use.

paytm integration android example

Upload PHP file on your server for Checksum Generation

Now Let’s start with server side code. You don’t need to write single line of code on server side to create checksum. Paytm provides all the file that you need for checksum generation. You can find paytm android SDK link here and Get Paytm PHP kit here. Please download PHP file folder and Upload it on your server.

Now Inside the folder we have a file named generateChecksum.php and we need to use it for generating checksum for paytm integration.
But first we need to put our Paytm Merchant Key in the configuration.
Go to inside lib folder ( paytm/lib/config_paytm.php) and there you will find config_paytm.php, and put your Paytm Merchant Key. This is for server side only.
Staging And Production Credentials: Following credentials will be provided by Paytm after registering:

A Unique Merchant ID – This ID is unique for each merchant.
Website: A website name.
Industry Type ID: An ID for the Industry Type.
Paytm Merchant Key: This is a unique key which will be needed for generating & verifying checksums. This is a secret key and should never be passed along with request parameters in API calls to Paytm Servers.
Paytm CALLBACK_URL: this url is provided by Paytm so app can read the data from paytm
Channel id: An Id for the channel being used.

Add Paytm SDK 2.1 jar file & Gradle Dependency

Please download Paytm PGSDK from this link. Now Create new Android project and inside lib folder put the PGSDKv2.1.jar file. Add dependency on android project module gradle file – implementation files(‘libs/PGSDK_V2.1.jar’)

Adding Permissions and Paytm Activity

You need to add INTERNET and ACCESS_NETWORK_STATE permission, and PaytmPGActivity ( Get it from Here) for paytm integration. So open AndroidManifest.xml and modify it as below.

Get Checksum value from your server PHP file

Now, First understand the process of paytm integration and payment transaction. You need to generate Checksum on your server then send this checksum along with other parameter to paytm transaction service. Please Remember All the param the you will use during checksum generation must pass topaytm transaction service. Also Order Id must be unique for each transaction other wise you will get OOPS Fail Transaction .

You can use Retrofit or Volley or HttpConnection for get checksum from your server. Once you get the checksum then you need to call PaytmPGService for test transaction.

Then you need to initialize paytm order and start trasaction.

Get Checksum & Call Payment Transaction

Run Code

Run the code and you will see paytm login screen. If you are seeing only transaction amount and not Login & signup text( as show on video) that means you are passing wrong paramHash for checksum and to Paytm service. Please cross check all the paramHash value and rerun the code with new Order-ID.

paytm android integration

If you have any question please comment below.


Posted in andorid and tagged , , , , , .

kamal bunkar

I Am Post Graduation (M.Tech. C.S.E) from VNIT, Nagpur. I Have Published Two Research Paper On International Journal. My Apps on Google Play Store- Sanyukt Parivar(Mp Police ), NOTOtag- Digital Chhindwara, The Tubby-VoiceRecognizer & More.
Contact me at

Leave a Reply

Your email address will not be published. Required fields are marked *