'Stripe - Apple and Google Pay button functionality does not work

It worked for a few months but a day ago, I was told that apple/google pay does not work. I have HTTPS, and I connected my cards to safari.

I think I read all the available articles about this issue.

Maybe, someone had a similar issue and knows how to solve it?

  useEffect(() => {
    if (stripe) {
      const pr = stripe.paymentRequest({
        country: "US",
        currency,
        total: {
          label,
          amount,
        },
        requestPayerName: true,
        requestPayerEmail: true,
      });

      pr.canMakePayment().then((result) => { <=== it returns null
        if (result) {
          setPaymentRequest(pr);
        }
      });
...


Solution 1:[1]

I went to stripe dashboard and deleted my website domain.

Then, I downloaded the file for verification again and moved it to /.well-known folder as shown there.

Also, my previous domain was

example.com/.well-known/....

but i changed it to

www.example.com/.well-known/...

I just added www.

That's what I did for apple pay to work.

Google pay - I just connected my card to the browser, IDK why but my card was already connected but I just added it once again, and the google pay button worked.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rostyk