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

Webhook question #8

Closed woshizhangxiaohao closed 4 years ago

woshizhangxiaohao commented 4 years ago

When I click payment on Android phone, Webhook will be created automatically. The H5 address returned by all payment successful callback is in this Webhook, not in my own WebView, which can't control to return to the previous page. I need to automatically close the current page, how to deal with it

mrdishant commented 4 years ago

Can you share your initiate transaction code snippet?

Specifically, what is the CallBack Url you are using?

woshizhangxiaohao commented 4 years ago

Can you share your initiate transaction code snippet?

Specifically, what is the CallBack Url you are using?

    try {
      Map<dynamic, dynamic> response = await Paytm.payWithPaytm(
          payInfoModel.merchantId,
          payInfoModel.payId.toString(),
          payInfoModel.paymentToken,
          payInfoModel.payAmount.toString(),
          payInfoModel.callbackUrl,
          payInfoModel.isStaging);
      print(response.toString());
    } catch (err) {
      print(err.message);
    }

The callback address is my own H5, which shows the payment status, success or failure. When displaying H5 content, I can't go back to the previous page or close the current page, because the current page is a webhook
mrdishant commented 4 years ago

You can use the following as a callback URL.

String callBackUrl = (testing ? 'https://securegw-stage.paytm.in' : 'https://securegw.paytm.in') + '/theia/paytmCallback?ORDER_ID=' + orderId;

It will get the response within the app from there you can update and verify the transaction in your backend code.

woshizhangxiaohao commented 4 years ago

You can use the following as a callback URL.

String callBackUrl = (testing ? 'https://securegw-stage.paytm.in' : 'https://securegw.paytm.in') + '/theia/paytmCallback?ORDER_ID=' + orderId;

It will get the response within the app from there you can update and verify the transaction in your backend code.

thks,it's ok!