PayTM付款网关的回调URL

时间:2019-08-01 20:40:56

标签: android node.js paytm

我正在尝试将我的Android应用中的Paytm付款网关与nodejs集成为后端。我在回调URL上遇到问题。我尝试实现自定义回调URL,但无法正常工作。 我已在服务器上使用以下代码来验证校验和

  async verifyChecksum({
    request,
    auth,
    response
  }) {

    var paytmParams = {};
    var paytmChecksum;
    for (var key in request) {
      if (key == "CHECKSUMHASH") {
        paytmChecksum = request[key];
      } else {
        paytmParams[key] = request[key];
      }
    }

    // const checksum = request.only(['checksum']);

    if (paytm_checksum.verifychecksum(paytmParams, paytm_config.MERCHANT_KEY, paytmChecksum)) {
      console.log("Checksum Verification => true");
      response.send("Checksum Verification => true");
    } else {
      console.log("Checksum Verification => false");
      response.send("Checksum Verification => false");
    }
  }

0 个答案:

没有答案