Skip to content

Instantly share code, notes, and snippets.

@fedeagripa
Created May 28, 2020 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedeagripa/f2f64556a820abf9b377fa16f256d0d2 to your computer and use it in GitHub Desktop.
Save fedeagripa/f2f64556a820abf9b377fa16f256d0d2 to your computer and use it in GitHub Desktop.
react_stripe_init
import React from 'react';
import { Elements, StripeProvider } from 'react-stripe-elements';
const withStripe = (WrappedComponent) => {
const Stripe = props => (
<StripeProvider apiKey={process.env.stripe_key}>
<Elements
fonts={[{
cssSrc: 'https://fonts.googleapis.com/css?family=Roboto:300,300i,400,500,600'
}]}
>
<WrappedComponent {...props} />
</Elements>
</StripeProvider>
);
return Stripe;
};
export default withStripe;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment