admin管理员组

文章数量:1304972

When I load my website I get this error: Unable to download payment manifest "/".

This errors shows up indefinitely and eventually crashes the website. It happened when I developed my own code using the Docs. It happened also when I took the code straight from the NPM Docs. I cant figure it out.

This is the code that I am using.

import React from 'react';
import GooglePayButton from '@google-pay/button-react';

function GooglePay(props) {


    return (
        <GooglePayButton
            environment='TEST'
            paymentRequest={{
                apiVersion: 2,
                apiVersionMinor: 0,
                allowedPaymentMethods: [
                    {
                        type: 'CARD',
                        parameters: { 
                            allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
                            allowedCardNetworks: ['AMEX', 'DISCOVER', 'MASTERCARD', 'VISA']
                        },
                        tokenizationSpecification: {
                            type: 'PAYMENT_GATEWAY',
                            parameters: {
                                gateway: 'example',
                                gatewyMerchantId: 'examleMerchantId',
                            },
                        },
                    },
                ],
                merchantInfo: {
                    merchantId: '12345678901234567890',
                    merchantName: 'Demo',
                },
                transactionInfo: {
                    totalPriceStatus: 'FINAL',
                    totalPriceLabel: 'Total',
                    totalPrice: props.totalAmount.toString(),
                    currencyCode: 'USD',
                    countryCode: 'US',
                },
                shippingAddressRequired: true,
                callbackIntents: ['PAYMENT_AUTHORIZATION'],
            }}
            onLoadPaymentData={paymentRequest => {
                console.log('Success', paymentRequest)
            }}
            onPaymentAuthorized={paymentData => {
                console.log('Payment Authorized Success', paymentData)
                return { transactionState: 'SUCCESS' }
            }}
            existingPaymentMethodRequired='false'
            buttonColor='black'
            buttonType='Buy'
        />
    )

};

export default GooglePay;

I am expecting Google Pay to work every time I click on it. Instead it may work the first time (may not) and then bees un-clickable on the next re-load.

When I load my website I get this error: Unable to download payment manifest "https://pay.google./about/".

This errors shows up indefinitely and eventually crashes the website. It happened when I developed my own code using the Docs. It happened also when I took the code straight from the NPM Docs. I cant figure it out.

This is the code that I am using.

import React from 'react';
import GooglePayButton from '@google-pay/button-react';

function GooglePay(props) {


    return (
        <GooglePayButton
            environment='TEST'
            paymentRequest={{
                apiVersion: 2,
                apiVersionMinor: 0,
                allowedPaymentMethods: [
                    {
                        type: 'CARD',
                        parameters: { 
                            allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
                            allowedCardNetworks: ['AMEX', 'DISCOVER', 'MASTERCARD', 'VISA']
                        },
                        tokenizationSpecification: {
                            type: 'PAYMENT_GATEWAY',
                            parameters: {
                                gateway: 'example',
                                gatewyMerchantId: 'examleMerchantId',
                            },
                        },
                    },
                ],
                merchantInfo: {
                    merchantId: '12345678901234567890',
                    merchantName: 'Demo',
                },
                transactionInfo: {
                    totalPriceStatus: 'FINAL',
                    totalPriceLabel: 'Total',
                    totalPrice: props.totalAmount.toString(),
                    currencyCode: 'USD',
                    countryCode: 'US',
                },
                shippingAddressRequired: true,
                callbackIntents: ['PAYMENT_AUTHORIZATION'],
            }}
            onLoadPaymentData={paymentRequest => {
                console.log('Success', paymentRequest)
            }}
            onPaymentAuthorized={paymentData => {
                console.log('Payment Authorized Success', paymentData)
                return { transactionState: 'SUCCESS' }
            }}
            existingPaymentMethodRequired='false'
            buttonColor='black'
            buttonType='Buy'
        />
    )

};

export default GooglePay;

I am expecting Google Pay to work every time I click on it. Instead it may work the first time (may not) and then bees un-clickable on the next re-load.

Share Improve this question asked Jan 3, 2023 at 15:59 FlyingFinn91FlyingFinn91 811 gold badge1 silver badge2 bronze badges 1
  • Does the button work for you here: google-pay-react.stackblitz.io Also, the "Unable to download payment manifest" console error is a chrome bug and should not affect your Google Pay integration. See here: bugs.chromium/p/chromium/issues/detail?id=1405229 – Domi Commented Jul 24, 2023 at 13:58
Add a ment  | 

2 Answers 2

Reset to default 4

Be sure that:

  1. Your stripe dashboard the google pay is enabled
  2. Check if you have a real card added to your google wallet
  3. Check if have added a real card in Chrome Browser Payment methods
  4. Check if have added the real card in http://pay.google.

Some updates from Stripe Team Support

Thanks! Upon checking our resources, for using Google Pay on Stripe checkout you just need to have it enabled on your Dashboard payment methods:

https://dashboard.stripe./test/settings/payment_methods

But, to test your integration for Google Pay, you’ll need to fulfill specific browser requirements for Chrome. When testing Google Pay you should have a real card saved in your Chrome browser or Google Wallet, and have your test API keys/test Google Pay environment active. The real card does not get charged, and Google passes a test card during the checkout flow instead of a real card. Our normal test cards do not work with Google Pay when the user tries to save them in Chrome.

Chrome

  1. Chrome 61 or newer
  2. A saved payment card

Chrome Mobile for Android

  1. Chrome 61 or newer
  2. An activated Google Pay card or a saved card

When using Google Pay, including Android Pay, with a test mode key, you might see an “Unrecognized app” warning. This is expected and doesn’t show up in live mode.

Future readers may find it helpful to know that I was able to eliminate this error once I switched out of Incognito mode in Chrome.

本文标签: javascriptGoogle Pay Error API Unable to download payment manifestStack Overflow