微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决使用 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 举报,一经查实,本站将立刻删除。