Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Invalid checksum for ios only #38

Open
IntelliJAbhishek opened this issue Feb 28, 2020 · 8 comments
Open

Invalid checksum for ios only #38

IntelliJAbhishek opened this issue Feb 28, 2020 · 8 comments

Comments

@IntelliJAbhishek
Copy link

IntelliJAbhishek commented Feb 28, 2020

I have integrated this plugin with ionic 3 its working fine in android. but I'm getting invalid checksum in ios.

Here is log from xcode

ionViewDidLoad PaymentPage
2020-02-28 14:16:46.152371+0530 Bruveg[26926:302383] {"CHECKSUMHASH":"iBP7YBhSbMQJqvQEdx06MAmqWd1C7yysjL+ifYQEPgHZalCLW4IKPvBs8tSVH2VEW3w096CBwY0sbbb0zs4nyMqpLddkXTZo4kXniAdfFGo=","ORDER_ID":"12431","payt_STATUS":"1"}
2020-02-28 14:16:46.156764+0530 Bruveg[26926:302383] PGTransactionViewController::loadView
2020-02-28 14:16:46.157799+0530 Bruveg[26926:302383] PGTransactionViewController::viewDidLoad
2020-02-28 14:16:46.162082+0530 Bruveg[26926:302383] PGTransactionViewController::viewWillAppear
2020-02-28 14:16:46.717476+0530 Bruveg[26926:302383] PGTransactionViewController::viewDidAppear
2020-02-28 14:16:46.738579+0530 Bruveg[26926:302383] PGTransactionViewController::showProgress
2020-02-28 14:16:46.740607+0530 Bruveg[26926:302383] WEB VIEW is loading with Parms:
{
"CALLBACK_URL" = "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=12431";
"CHANNEL_ID" = WAP;
CHECKSUMHASH = "iBP7YBhSbMQJqvQEdx06MAmqWd1C7yysjL+ifYQEPgHZalCLW4IKPvBs8tSVH2VEW3w096CBwY0sbbb0zs4nyMqpLddkXTZo4kXniAdfFGo=";
"CUST_ID" = 114;
"INDUSTRY_TYPE_ID" = Retail109;
MID = Sobhaa37519274706529;
"ORDER_ID" = 12431;
"TXN_AMOUNT" = "65.00";
WEBSITE = WEBPROD;
}
2020-02-28 14:16:46.833051+0530 Bruveg[26926:302383] webView:shouldStartLoadWithRequest: https://securegw.paytm.in/theia/processTransaction domain = securegw.paytm.in
2020-02-28 14:16:46.833729+0530 Bruveg[26926:302383] PGTransactionViewController::showProgress
2020-02-28 14:16:47.354567+0530 Bruveg[26926:303781] WF: === Starting WebFilter logging for process Bruveg
2020-02-28 14:16:47.354763+0530 Bruveg[26926:303781] WF: _userSettingsForUser : (null)
2020-02-28 14:16:47.354888+0530 Bruveg[26926:303781] WF: _WebFilterIsActive returning: NO
2020-02-28 14:16:47.369368+0530 Bruveg[26926:302383] webView:shouldStartLoadWithRequest: https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=12431 domain = securegw.paytm.in
2020-02-28 14:16:47.370813+0530 Bruveg[26926:302383] PGTransactionViewController::showProgress
2020-02-28 14:16:47.377013+0530 Bruveg[26926:304267] Connection 24: unable to determine interface type without an established connection
2020-02-28 14:16:47.377204+0530 Bruveg[26926:304267] Connection 24: unable to determine fallback status without a connection
2020-02-28 14:16:47.378532+0530 Bruveg[26926:304267] Task .<0> HTTP load failed, 0/0 bytes (error code: -999 [1:89])
2020-02-28 14:16:47.446128+0530 Bruveg[26926:303781] WF: _userSettingsForUser : (null)
2020-02-28 14:16:47.446634+0530 Bruveg[26926:303781] WF: _WebFilterIsActive returning: NO
2020-02-28 14:16:47.500771+0530 Bruveg[26926:302383] webViewDidFinishLoad of https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=12431
2020-02-28 14:16:47.500970+0530 Bruveg[26926:302383] PGTransactionViewController::hideProgress
2020-02-28 14:16:47.501466+0530 Bruveg[26926:302383] Found Callback url
2020-02-28 14:16:47.569831+0530 Bruveg[26926:302383] dataStr =

<title>Paytm</title><script type='text/javascript'>function response(){return document.getElementById('response').value;}</script>Redirect back to the app
2020-02-28 14:16:47.570787+0530 Bruveg[26926:302383] response() JS method returned = {"ORDERID":"12431", "MID":"Sobhaa37519274706529", "TXNAMOUNT":"65.00", "CURRENCY":"INR", "STATUS":"TXN_FAILURE", "RESPCODE":"330", "RESPMSG":"Invalid checksum", "BANKTXNID":""} 2020-02-28 14:16:47.570928+0530 Bruveg[26926:302383] Calling Delegate didFinishedResponse 2020-02-28 14:16:47.571045+0530 Bruveg[26926:302383] ViewController::didFinishedResponse:response = {"ORDERID":"12431", "MID":"Sobhaa37519274706529", "TXNAMOUNT":"65.00", "CURRENCY":"INR", "STATUS":"TXN_FAILURE", "RESPCODE":"330", "RESPMSG":"Invalid checksum", "BANKTXNID":""} 2020-02-28 14:16:47.577937+0530 Bruveg[26926:302383] PGTransactionViewController::viewWillDisappear 2020-02-28 14:16:48.165785+0530 Bruveg[26926:302383] {"STATUS":"TXN_FAILURE","MID":"Sobhaa37519274706529","RESPCODE":"330","TXNAMOUNT":"65.00","CURRENCY":"INR","BANKTXNID":"","RESPMSG":"Invalid checksum","ORDERID":"12431"}
@IntelliJAbhishek
Copy link
Author

@ArunYogi please help with this

@ArunYogi
Copy link
Owner

ArunYogi commented Apr 3, 2020

@IntelliJAbhishek , based on the logs , what I can infer is, checksum has been created for transaction check parameters
{"CHECKSUMHASH":"iBP7YBhSbMQJqvQEdx06MAmqWd1C7yysjL+ifYQEPgHZalCLW4IKPvBs8tSVH2VEW3w096CBwY0sbbb0zs4nyMqpLddkXTZo4kXniAdfFGo=","ORDER_ID":"12431","payt_STATUS":"1"}
and the same checksum is used for start a payment transaction method. that's why this is going wrong. are you having separate code for ios and android?

@IntelliJAbhishek
Copy link
Author

@ArunYogi No I don't have separate code.

i create a checksum at backend which gives {"CHECKSUMHASH":"iBP7YBhSbMQJqvQEdx06MAmqWd1C7yysjL+ifYQEPgHZalCLW4IKPvBs8tSVH2VEW3w096CBwY0sbbb0zs4nyMqpLddkXTZo4kXniAdfFGo=","ORDER_ID":"12431","payt_STATUS":"1"} this type response.

After that I use this checksum for transaction.

I'm totally blank now. what can I do?

@ArunYogi
Copy link
Owner

ArunYogi commented Apr 3, 2020

@IntelliJAbhishek ,whats the request you are sending for checksum creation before startPayment method is called? post the whole request body (mask the sensitive information)

@IntelliJAbhishek
Copy link
Author

IntelliJAbhishek commented Apr 3, 2020

@ArunYogi Here is the code

let txnRequest = {
  MID: "XXXXXX",                                                            // PayTM Credentials
  ORDER_ID: this.orderDetails.id.toString(),                //Should be unique for every order.
  CUST_ID: this.orderDetails.customer_id.toString(),
  INDUSTRY_TYPE_ID: "Retail109",                               // PayTM Credentials
  CHANNEL_ID: "WEB",                                                  // PayTM Credentials
  TXN_AMOUNT: this.orderDetails.total.toString(),   // Transaction Amount should be a String
  WEBSITE: "WEBPROD",                                               // PayTM Credentials
  CALLBACK_URL:
    "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=" +
    this.orderDetails.id
};

this.loader.showWithMessage("Generating Checksum");
this.WC.generateChecksumAPI(txnRequest).subscribe(
  (res: any) => {
    this.loader.dismiss();
    console.log(res);
    txnRequest["CHECKSUMHASH"] = res.CHECKSUMHASH;
    txnRequest["ENVIRONMENT"] = "production";
    paytm.startPayment(
      txnRequest,
      (response: any) => {
        console.log(response);
        if (response.STATUS == "TXN_SUCCESS") {
          this.refreshPage(response.TXNID);
        } else {
          alert(
            "Transaction Failed for reason: - " +
              response.RESPMSG +
              " (" +
              response.RESPCODE +
              ")"
          );
        }
      },
      error => {
        alert(
          "Transaction Failed for reason: - " +
            error.RESPMSG +
            " (" +
            error.RESPCODE +
            ")"
        );
        console.log(error);
      }
    );
  },
  err => {
    this.loader.dismiss();
    alert("Error Generating Checksum " + err);
  }

@ArunYogi
Copy link
Owner

ArunYogi commented Apr 3, 2020

@IntelliJAbhishek , channel_id cant be "WEB" while using this plugin, it has to be "WAP". still facing issue. If you are facing issue even after changing to "WAP", its best you post this checksum request and checksumhash to Paytm and ask for explanation..
NOTE: checksum creation logic from Patym, for WEB is different from WAP

@IntelliJAbhishek
Copy link
Author

@ArunYogi

But the same channel work on Android?

@ArunYogi
Copy link
Owner

ArunYogi commented Apr 3, 2020

@IntelliJAbhishek , actually should not be working there as well. Paytm is mystery, only they can solve that..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants