GPay India - Payment Request failure: Missing intent extras

403 Views Asked by At

I'm facing an error when integrating the GPay India payment option on a website. The payment fails with a cryptic error message.

I've gone through the integration documentation. This integration uses the Payment Request interface which errors out with a weird message. The code making this call is below:

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

On calling request.show() the website redirects us to the Google Pay app where we verify the payee details and amount. On proceeding to pay, we get the following error in the app:

Your money has not been debited

Your payment has been declined

Payment to the same UPI ID via other UPI payment applications go through without issue. On dismissing this message, we are taken back to the website where we get the following error:

DOMException: Payment app returned an invalid result. Missing intent extras.

I've tried this on different devices that have different GPay accounts with the same result. The parameters passed to this payment request are as follows:

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,
        },
    }],
};

This covers all the required parameters for making the payment request. I've also checked the following via Google Pay Business Console:

  • The payment profile has been approved
  • The UPI ID is verified
  • The merchant name matches the name submitted

No inconsistencies anywhere. The GPay app installed is the latest version. Any hints at all as to where the error might be is appreciated.

0

There are 0 best solutions below