Search code examples
phpandroidpayment-gatewaypaytm

How to fix Paytm Session Expired failure error in android?


I'm integrating Paytm payment gateway in android application, I had followed all basic requirements and steps given by Paytm. also copy files from GitHub for generating checksum and verifychecksum. also set my merchant id and merchant key. but while integrating to android application it shows me error like: 1) This MID is not available in staging environment 2) Session Expired failure 3) Checksum mismatch.

I'm had solved 1st error but not able to complete 2nd and 3rd i had already mailed to Paytm still not get any response from them.

I'm using Android studio, with XAMPP with gradle for Paytm is

implementation('com.paytm:pgplussdk:1.3.3') {
        transitive = true;
    }

here i share some sample code of android and php too.

Android:

 HashMap<String, String> paramMap = new HashMap<>();
    paramMap.put( "MID", paytm.getMID() );
    paramMap.put( "ORDER_ID", ordId );
    paramMap.put( "CUST_ID", "cust123" );
    paramMap.put( "MOBILE_NO", paytm.getUserPhone() );
    paramMap.put( "EMAIL", paytm.getUserEmail() );
    paramMap.put( "CHANNEL_ID", "WAP" );
    paramMap.put( "TXN_AMOUNT", "100.12" );
    paramMap.put( "WEBSITE", "WEBSTAGING" );
    paramMap.put( "INDUSTRY_TYPE_ID", "Retail" );
    paramMap.put( "CALLBACK_URL", paytm.getCallBackUrl() );
    paramMap.put( "CHECKSUMHASH", checksumHash );

Backend generateChecksum.php

$paytmParams = array();
$paytmParams["MID"] = merchantMid;
$paytmParams["ORDER_ID"] = orderId;
$paytmParams["CUST_ID"] = custId;
$paytmParams["MOBILE_NO"] = mobileNo;
$paytmParams["EMAIL"] = email;
$paytmParams["CHANNEL_ID"] = channelId;
$paytmParams["TXN_AMOUNT"] = txnAmount;
$paytmParams["WEBSITE"] = website;
$paytmParams["INDUSTRY_TYPE_ID"] = industryTypeId;
$paytmParams["CALLBACK_URL"] = callbackUrl;

Solution

  • Issue resolved by Paytm. my staging merchant id is not working so i'm getting that kind of issue.