March 2019
Beginner to intermediate
324 pages
7h 17m
English
Now let's go back to the handleSubmit() method, which should trigger whenever the credit card HTML form submits. When you make use of a Stripe element component, it not only validates the credit card information, but it also returns a token object that represents the credit card entered. This token object is what you'll use in the backend to charge this card.
The handleSubmit() method code needs to take care of a number of things:
Here's how the code will look:
async handleSubmit(event){ event.preventDefault(); console.log("Handle submit ...Read now
Unlock full access