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

download-code350-100

 

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 kamal.bunkar@blueappsoftware.in

33 Comments

  1. I love your blog.. very nice colors & theme. Did you create this
    website yourself or did you hire someone to do it for you?
    Plz respond as I’m looking to create my own blog and would like to find
    out where u got this from. appreciate it

  2. Pretty great post. I just stumbled upon your weblog and wanted to say
    that I’ve truly loved browsing your blog posts.
    In any case I’ll be subscribing for your feed and I hope you write once more very soon!

  3. Hi there! This post could not be written any better!
    Reading through this post reminds me of my good old room mate!
    He always kept talking about this. I will forward this article to him.
    Fairly certain he will have a good read. Thank you for sharing!

  4. Hi there! Quick question that’s totally off topic.
    Do you know how to make your site mobile friendly?
    My weblog looks weird when browsing from my iphone4.
    I’m trying to find a template or plugin that might
    be able to fix this issue. If you have any recommendations, please share.
    Thank you!

  5. This is really attention-grabbing, You are an overly skilled blogger.
    I have joined your feed and look forward to in the hunt
    for extra of your great post. Also, I have shared your site in my social networks

  6. I’m really enjoying the theme/design of your blog.

    Do you ever run into any browser compatibility issues?

    A few of my blog audience have complained about my site not
    working correctly in Explorer but looks great in Chrome.
    Do you have any solutions to help fix this issue?

  7. I was recommended this web site by my cousin. I’m
    not sure whether this post is written by him as no one else
    know such detailed about my problem. You are wonderful!

    Thanks!

  8. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your
    blog and I look forward to your new updates.

  9. Having read this I thought it was very informative. I appreciate you finding the time and
    energy to put this short article together. I once again find myself personally spending a lot of time both reading and posting comments.
    But so what, it was still worthwhile!

  10. hi! may i know is your code complete? because i run the program and does nothing, i have download the given source code.

    • Yes this code is working…You have to create file on php server to store FCM key into your database for future use. First check on your android studio log whether FCM token is printing OR not. If it is printing in log than send token to your web server.

  11. Good day! I could have sworn I’ve been to
    this website before but after going through
    a few of the articles I realized it’s new to me.

    Nonetheless, I’m certainly delighted I found it and I’ll be book-marking it and checking back regularly!

  12. Spot on with this write-up, I absolutely feel this website needs much more attention. I’ll probably be returning to read
    through more, thanks for the info!

  13. Hey very cool website!! Man .. Excellent ..
    Amazing .. I will bookmark your site and take the feeds additionally?
    I am glad to search out numerous useful info here
    in the submit, we need work out more strategies
    on this regard, thanks for sharing. . . . . .

  14. Pingback: ExoPlayer Android Example- Best Alternative of VideoView By Kamal

  15. Pingback: Simplest way to get WordPress Post in Android App- REST API

  16. I just like the helpful information you supply to your articles.

    I’ll bookmark your blog and test once more here frequently.
    I’m fairly sure I will learn many new stuff proper here!
    Good luck for the following!

Comments are closed.