【问题标题】:Cashfree Payment gateway Integration in react native and laravel (orderAmount is required error)Cashfree 支付网关集成在 react native 和 laravel 中(orderAmount 是必需的错误)
【发布时间】:2021-08-23 12:24:31
【问题描述】:

我正在将 CashFree 支付网关集成到 react 本机应用程序 (Android) 中。我正在关注此文档https://docs.cashfree.com/docs/react-native-2-0-sdk#web-checkout。在实施时,我得到了回应

{"type":"CashFreeResponse","txMsg":"orderAmount not provided","txStatus":"FAILED"}

但我正在传递所有进行付款所需的参数。

  const handlePayment = response => {
    console.log('amount', total);
    var mode = 'TEST';
    var map = {
      "appId": response.credentials.app_id,
      "orderId": response.credentials.order_id,
      "orderCurrency": 'INR',
      "orderAmount": 150, //parseInt(response.data.price)
      "customerPhone": response.user.mobile,
      "customerEmail": response.user.email,
      "tokenData": response.payment_info.cftoken,
      "orderNote": 'Subscription Payment',
      "notifyUrl": '',
      "customerName": response.user.name,
    };
    console.log('data', map);
    RNPgReactNativeSDK.startPaymentWEB(map, mode, result => {
      console.log(result);
      var obj = JSON.parse(result, function (key, value) {
        console.log(key + '::' + value);
        // Do something with the result
      });
    });
  };

【问题讨论】:

    标签: reactjs laravel react-native


    【解决方案1】:

    根据他们网站上提到的文档,您需要输入订单金额作为字符串。

      const handlePayment = response => {
        console.log('amount', total);
        var mode = 'TEST';
        var map = {
          "appId": response.credentials.app_id,
          "orderId": response.credentials.order_id,
          "orderCurrency": 'INR',
          "orderAmount": '150',
          "customerPhone": response.user.mobile,
          "customerEmail": response.user.email,
          "tokenData": response.payment_info.cftoken,
          "orderNote": 'Subscription Payment',
          "notifyUrl": '',
          "customerName": response.user.name,
        };
        console.log('data', map);
        RNPgReactNativeSDK.startPaymentWEB(map, mode, result => {
          console.log(result);
          var obj = JSON.parse(result, function (key, value) {
            console.log(key + '::' + value);
            // Do something with the result
          });
        });
      };
    

    【讨论】:

      猜你喜欢
      • 2021-06-04
      • 2020-11-16
      • 2019-06-27
      • 2015-06-24
      • 1970-01-01
      • 2019-03-30
      • 2017-04-09
      • 2020-12-29
      • 1970-01-01
      相关资源
      最近更新 更多