stripe-archive / react-stripe-elements

Moved to stripe/react-stripe-js.
https://github.com/stripe/react-stripe-js
MIT License
3.03k stars 319 forks source link

PaymentRequestButtonElement Integration Error with saved browser card #558

Closed varunrau closed 3 years ago

varunrau commented 3 years ago

Feature request or idea? Consider opening an API review!

Summary

Hello, I'm integrating the PaymentRequestButtonElement and am getting an Integration error when trying to render a payment request button when the user has a saved card (not google or apple pay). I do have a canMakePayment check and will only attempt to render if I receive a truthy value. In my case, that value is { applePay: false, googlePay: false }.

The error I receive is IntegrationError: For the paymentRequestButton Element, you must first check availability using paymentRequest.canMakePayment() before mounting the Element.

I tried creating a minimal repro with JSFiddle, but I'm getting a different IntegrationError there 😅. JSFiddle: https://jsfiddle.net/mqbtL3cx/53/

Note that my code works correctly when the user has Apple Pay configured in the browser in Safari.

This only happens in Chrome. On Safari, the Apple Pay button renders correctly!

sashko-stripe commented 3 years ago

Hi @varunrau -- I'm working on closing issues on this repository, since the project has migrated to React Stripe.js as of early 2020. We've had a harder time keeping track of issues because of this older repository hanging around still. If you are still experiencing this issue, please open it there.