在Paytm上找不到nginx1.6.2

2024-04-27 20:01:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经按照下面的链接了解了用法: https://www.npmjs.com/package/react-native-paytm

这是我的校验和生成代码:

import Checksum
# initialize a dictionary
paytmParams = dict()

# put checksum parameters in Dictionary
paytmParams["MID"] = "*****************"
paytmParams["ORDER_ID"] = 'ORD001'
paytmParams["CUST_ID"] = 'CUST001'
paytmParams["INDUSTRY_TYPE_ID"] = 'Retail' 
paytmParams["CHANNEL_ID"] = 'WAP'
paytmParams["TXN_AMOUNT"] = '1.00'
paytmParams["WEBSITE"] = 'WEBSTAGING'
paytmParams["EMAIL"] = '**************'
paytmParams["MOBILE_NO"] = '****************'
paytmParams["CALLBACK_URL"] = 'https://securegw- 
stage.paytm.in/theia/paytmCallback?ORDER_ID=ORD001'    

# Find your Merchant Key in your Paytm Dashboard at 
https://dashboard.paytm.com/next/apikeys
checksum = Checksum.generate_checksum(paytmParams, "*************")

react native的代码:

import paytm from 'react-native-paytm';
import { Platform, DeviceEventEmitter, NativeModules,NativeEventEmitter} from 'react-native';

const paytmConfig = {
  MID: '************',
  WEBSITE: 'WEBSTAGING',
  CHANNEL_ID: 'WAP',
  INDUSTRY_TYPE_ID: 'Retail',
  CALLBACK_URL: 'https://securegw- 
  stage.paytm.in/theia/paytmCallback?ORDER_ID=ORD001'
}
onPayTmResponse(response) {
    // Process Response
    // response.response in case of iOS
    // reponse in case of Android
    console.log(response);
}

 runTransaction() {
     const callbackUrl = 'https://securegw- 
   stage.paytm.in/theia/paytmCallback?ORDER_ID=ORD001'
    const details = {
      mode: 'Staging', // 'Staging' or 'Production'
      mid: paytmConfig.MID,
      industryType: paytmConfig.INDUSTRY_TYPE_ID,
      website: paytmConfig.WEBSITE,
      channel: paytmConfig.CHANNEL_ID,
      amount: '1.00', // String
      orderId: 'ORD001', // String
      custId: 'CUST001', // String
      email: '*****************', // String
      phone: '***********', // S
      checksumhash: '***********************************************', //From your server using PayTM Checksum Utility 
      callback: callbackUrl
    };
    paytm.startPayment(details);
}

问题是,我甚至不能发现这里的错误点,因为没有控制台。我可以在这里找个方向。我现在就需要这个


Tags: inhttpsimportidstringresponseorderreact
1条回答
网友
1楼 · 发布于 2024-04-27 20:01:29

在我的现金使用这个npm@philly25/react native paytm解决了这个错误 你确定onPaytmResponse是paytm侦听器吗 像这样:

componentWillMount() {
    Paytm.addListener(Paytm.Events.PAYTM_RESPONSE, this.onPayTmResponse)
};

componentWillUnmount() {
    Paytm.removeListener(Paytm.Events.PAYTM_RESPONSE, this.onPayTmResponse);
};

相关问题 更多 >