tyler-johnson / stripe-meteor

A Meteor package containing Stripe.js, Node-Stripe, and Stripe Checkout.
https://atmospherejs.com/mrgalaxy/stripe
150 stars 44 forks source link

Uncaught ReferenceError: Stripe is not defined #42

Closed micahalcorn closed 8 years ago

micahalcorn commented 8 years ago

This error is getting thrown in my client code according to Kadira. I can't reproduce it from a desktop browser and it only seems to happen on Android. The culprit is my Stripe.publishableKey = function... inside of Meteor.startup. Are you aware of any issues with Meteor not properly waiting for the package to be loaded before running the startup function?

wiserweb commented 8 years ago

Same issue here. "Uncaught ReferenceError: Stripe is not defined" occurring on Android devices.

The Stripe package works fine on web browser locally and remotely deployed. The error only appears to occur on Android device deployment.

Stripe.setPublishableKey is being called in Meteor.startup on Client.

wiserweb commented 8 years ago

This issue appears to be caused by new Cordova security rulesets. The fix is to add the following line in mobile-config.js in the root of your meteor project.

App.accessRule("https://_.stripe.com/_")

tyler-johnson commented 8 years ago

Hi, I've merged that updated documentation. Thanks!