mrdishant / Paytm-Flutter-Plugin

A Flutter plugin to use the Paytm as a gateway for accepting online paymnets in Flutter app.
Other
10 stars 6 forks source link

Invalid Checksum #15

Closed mohit67890 closed 4 years ago

mohit67890 commented 4 years ago

Hey, I'm getting invalid checksum as the error. Can you please help me in that.

tiholic commented 4 years ago

@mohit67890

https://github.com/mrdishant/Paytm-Flutter-Plugin/blob/master/android/src/main/java/in/appyflow/paytm/PaytmPlugin.java#L105

Only use these fields to generate the checksum to avoid this error.

mrdishant commented 4 years ago

@mohit67890

Pass testing = 0 to the URL while generating checksum for Testing Credentials and

Pass testing = 1 to the URL while generating checksum for Production Credentials

mohit67890 commented 4 years ago

Hey, Sorry but I'm not able to get your solution.

I'm writing the falling code but I'm getting invalid checksum as the error.

            String url_paytm = "https://us-central1-mrdishant-4819c.cloudfunctions.net/generateCheckSum";

            final response = await http.post(url_paytm, headers: {
              "Content-Type": "application/x-www-form-urlencoded"
            }, body: {
              "MID": "<MY_MID>",
              "CHANNEL_ID": "WAP",
              'INDUSTRY_TYPE_ID': 'Retail',
              'WEBSITE': 'WEBSTAGING',
              'PAYTM_MERCHANT_KEY': '<KEY_BY_PAYTM>',
              "MOBILE_NO" : "<MOBILE_NUMBER>",
              "EMAIL" : "abc@gmail.com",
              'TXN_AMOUNT': '10.00',
              'ORDER_ID': "122",
              'CUST_ID': '122',
            });

            var stag_url = "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=122";

            var paytmResponse = Paytm.startPaytmPayment(
                true,
                "<MID>",
                "122",
                "122",
                "WAP",
                "10.00",
                'WEBSTAGING',
                stag_url,
                'Retail',
                response.body);

            paytmResponse.then((value) {
              setState(() {
                var payment_response = value.toString();

                print(payment_response);

              });
            });

Please help me how to fix this issue.. Also, if you could share the nodejs code for the generate checksum hash which you have deployed on your cloud function, it would be really great.

Thanks, Mohit