使用 google-pay/react-button 将 Google Pay 与 Moneris Gateway 集成

问题描述

我需要将付款明细发送到 moneris 以处理付款。我正在使用 google-pay/react-button。在 Moneris 文档中,我需要在 index.html 中加载一个函数并在 googlePay.js 文件中使用它,但从 googlePay.js 文件中收到错误“MonerisGooglePay 未定义”。这是我正在关注的链接 https://developer.moneris.com/en/Documentation/NA/E-Commerce%20Solutions/Google%20Pay/On%20The%20Web

Index.html:

<script async src="https://esqa.moneris.com/googlepay/googlepay-api.js"
onload="MonerisGooglePay.onReady()"></script>

googlePay.js:

paymentData["orderId"] = "Unique Order ID";
paymentData["amount"] = "Same as GoogleTransactionInfo()[`Total Price´]";
MonerisGooglePay.purchase(paymentData,function(response)
{
if ( response && response.receipt && response.receipt.ResponseCode &&
!isNaN(response.receipt.ResponseCode) )
{
if ( parseInt(response.receipt.ResponseCode) < 50 )
{
alert("Looks like the transaction is approved.");
}
else
{
alert("Looks like the transaction is declined.");
}
}
else
{
throw ("Error processing receipt.");
}
});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)