【问题标题】:redirecting back to the app in paytm integration in react native在 react native 的 paytm 集成中重定向回应用程序
【发布时间】:2021-07-17 11:01:19
【问题描述】:

我正在尝试将 paytm 集成到 react native 中。但问题是当我点击支付按钮(调用 call_api)但随后处理屏幕来了,突然应用程序导航到我定义支付按钮的当前屏幕。请帮助这是我的代码

call_api = () => {
    fetch("https://XXXXXXXXXXXXXXX", {
      method: "POST",
      headers: {
        Accept: "application/json, text/plain, */*",
        "Content-Type": "application/json",
      },

      body: JSON.stringify([
        {
          mobile_no: "XXXXXx",
          user_id: "XX",
          patient_name: "XXXx",
        },
      ]),
    })
      .then((returnValue) => returnValue.json())

      .then((response) => {
        console.log("this checksum api esponse" + JSON.stringify(response));

        this.setState({ order_id: response[0].data.order_id });
        this.setState({ checksum: response[0].data.checksumhash });

        this.pay();
      });
  };



  pay = () => {
    const details = {
      //mode: "Production", // 'Staging' or 'Production'
      mode: "Production",
      MID: "XXXXXXXXXXXXXXX",
      INDUSTRY_TYPE_ID: "Retail",
      WEBSITE: "APPSTAGING",
      CHANNEL_ID: "WAP",
      TXN_AMOUNT: "1", // String
      ORDER_ID: this.state.order_id, // String
      // EMAIL: email, // String
      // MOBILE_NO: mobile, // String
      CUST_ID: "CUSTOMER_1", // String
      CHECKSUMHASH: `${this.state.checksum}`, //From your server using PayTM Checksum Utility
       CALLBACK_URL:
         "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=" +
         `${this.state.order_id}`,
     // CALLBACK_URL: `https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=<${this.state.order_id}>`,
    };
    Paytm.startPayment(details);
    console.log(details);
  };

【问题讨论】:

    标签: javascript react-native callback paytm callbackurl


    【解决方案1】:

    请确保您的设备上安装了 Paytm Staging 应用程序。您可以从 Paytm Developer Portal 上提到的链接获得相同的信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-07
      • 1970-01-01
      • 2021-09-26
      • 1970-01-01
      • 2019-02-10
      • 1970-01-01
      • 2016-09-28
      • 2016-03-27
      相关资源
      最近更新 更多