GPay India - 付款请求失败:缺少意图附加内容

Adw*_*ith 5 javascript google-pay google-tez

我在网站上集成 GPay India 付款选项时遇到错误。付款失败并出现神秘错误消息。

我已经阅读了集成文档。此集成使用付款请求接口,该接口会出现错误并显示奇怪的消息。进行此调用的代码如下:

request.show()
.then(function (instrument) {
    // Process payment - code never reaches here
    window.clearTimeout(paymentTimeout);
    processResponse(instrument);
})
.catch(function (err) {
    console.log(err);  // Error here!
});
Run Code Online (Sandbox Code Playgroud)

致电后,request.show()该网站会将我们重定向到 Google Pay 应用程序,我们将在其中验证收款人详细信息和金额。继续付款时,我们在应用程序中收到以下错误:

您的钱尚未被扣除

您的付款已被拒绝

通过其他 UPI 支付应用程序向同一 UPI ID 进行支付不会出现任何问题。忽略此消息后,我们将返回到出现以下错误的网站:

DOMException:支付应用程序返回无效结果。缺少意图额外内容。

我已经在具有不同 GPay 帐户的不同设备上尝试过此操作,但结果相同。本次支付请求传递的参数如下:

const supportedInstruments = [{
    supportedMethods: ['https://tez.google.com/pay'],
    data: {
        pa: 'xxxx@xxx',  // The UPI ID
        pn: 'Merchant Name',  // The Merchant name
        tr: trId,  // A unique UUID
        url: 'https://xxxxxxx',  // The URL of the payment page
        mc: '4829',  // The merchant category
        tn: 'Purchase in Merchant',  // Optional note
    },
}];

const details = {
    total: {
        label: 'Total',
        amount: {
            currency: 'INR',
            value: donationValue,
        },
    },
    displayItems: [{
        label: 'Donation Amount',
        amount: {
            currency: 'INR',
            value: donationValue,
        },
    }],
};
Run Code Online (Sandbox Code Playgroud)

这涵盖了发出付款请求所需的所有参数。我还通过 Google Pay Business Console 检查了以下内容:

  • 付款资料已获批准
  • UPI ID 已验证
  • 商户名称与提交的名称一致

没有任何不一致的地方。安装的GPay应用程序是最新版本。任何有关错误可能出在哪里的提示都是值得赞赏的。