I need to create token with Stripe.js in React JS, but I can't find any easy way. In node.js I would do something like this:
stripeClient.tokens.create({
card: {
number: '4242424242424242',
exp_month: 12,
exp_year: 2050,
cvc: '123'
}
But the Stripe npm module doesn't work for me in React JS. I'm getting error:
Cannot resolve module 'child_process'
So since this is node pibrary obviously, I would like to use
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
But I'm not sure what should be the best practice to implement external libraries in React