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

not compatible with react-stripe-elements #55

Open capi1O opened 6 years ago

capi1O commented 6 years ago

Just creating an issue so maybe it may help people not wasting time like I did.

This package is not compatible with react-stripe-elements despite correct configuration, the stripe.js served is different from the one retrieved via <script src="https://js.stripe.com/v3/"></script>.

Error thrown is : Cannot read property 'elements' of undefined

Configuration is correctly made in Meteor.startup for client side:

Meteor.startup(() =>
{
    Stripe.setPublishableKey(Meteor.settings.public.stripe);
    render(<App />, document.getElementById('app'));
});

Stripe object is available and functions are working, but cannot add Element*s from react-stripe-elements.

I checked Redux related issue but even with redux-less app same error is thrown so Troubleshooting described here is not relevant. Plus it is working fine inside Redux connect()ed component when loading Stripe via script tag.

Note : same problem encountered with npm install stripe but npm's stripe is clearly indicated for server side use whereas this package claims to be compatible with cliend side use.