mrdishant / Paytm-All-in-one-flutter-sdk

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

After completion of transaction the success or failure callback is not received in the app #3

Closed EffyCoder closed 4 years ago

EffyCoder commented 4 years ago

Even after completion of transaction the success or failure callback is not received in the app. The user will wait and click back which pops a alert dialog to cancel the transaction and transaction cancelled callback is received.

MaheshPeri19 commented 4 years ago

For me transcation success and callback received, but I faced issue with json response after successful transaction.

Actual response is coming like this with main dictionary. Below "response" key value is json object.

{response: {"BANKNAME":"WALLET","BANKTXNID":"","CHECKSUMHASH":"","CURRENCY":"INR","GATEWAYNAME":"WALLET","MID":"","ORDERID":"","PAYMENTMODE":"","RESPCODE":"01","RESPMSG":"Txn Success","STATUS":"TXN_SUCCESS","TXNAMOUNT":"1.30","TXNDATE":"2020-08-20 17:48:38.0","TXNID":""}, nativeSdkForMerchantMessage: }

So i have parsed from json to Map.

Map respDict = json.decode(resultDict['response'].toString()); // resultDict is main dictionary from paytm. if (respDict['STATUS'] == "TXN_SUCCESS") { // transaction success. } else { // transaction failure. }

EffyCoder commented 4 years ago

Thanks for reply @MaheshPeri19 I was doing it wrong as the flow is confusing we had callback URL of backend server. After changing it to the callback URLs provided by Paytm at both the app and server/ backend side, we started to receive callbacks in the app itself.

Following are callback URLs provided by them,

For staging:- ["CALLBACK_URL"] = 'https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID='
For production:- ["CALLBACK_URL"] = 'https://securegw.paytm.in/theia/paytmCallback?ORDER_ID='