Created
May 28, 2020 14:34
-
-
Save fedeagripa/f2f64556a820abf9b377fa16f256d0d2 to your computer and use it in GitHub Desktop.
react_stripe_init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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