1import {loadStripe} from '@stripe/stripe-js'; const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
1style: {
2 padding: '2rem'
3 // ....
4}
5
6// create card number input in div#card-number
7let cardNumber = elements.create('cardNumber', {
8 'placeholder': '1234 1234 1234 1234',
9 'style': style
10 });
11 cardNumber.mount('#card-number');
12
13// create cvc input in div#card-cvc
14 let cardCvc = elements.create('cardCvc', {
15 'placeholder': 'CVC',
16 'style': style
17 });
18 cardCvc.mount('#card-cvc');
19
20 // create card expiry input in div#card-expiry
21 let cardExpiry = elements.create('cardExpiry', {
22 'placeholder': 'MM / AA',
23 'style': style
24 });
25 cardExpiry.mount('#card-expiry')