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

Cordova and iOS makes elements invisible. #525

Closed sboudouk closed 4 years ago

sboudouk commented 4 years ago

Hello, thanks for this usefull package.

Summary

I'm using your package with cordova and ReactJS. It works fine on Android but on iOS the fields are not displayed. And I don't know why, no specific error on the console apart from this one:

Unable to post message to https://js.stripe.com. Recipient has origin file://.

I don't know if this error can make element unusable, and I didn't see any GitHub issue opened.

Other information

Happens only on Cordova on iOS.

hofman-stripe commented 4 years ago

For PCI compliance, Stripe.js uses iframes that have to be loaded from https://js.stripe.com. It seems that for some reason, Cordova is caching or proxying requests and loading our iframe from the local filesystem instead of loading them directly from our servers. Some Googling for Cordova, file and CORS return some results which mention switching to a native HTTP connection backend.

Regardless, this library is a wrapper around the Stripe.js library so I will close this issue. Please reach out to our support team for further help with your Stripe.js integration.