We already implemented the credit card logic at the frontend in Chapter 5, Building a Frontend for GoMusic. It's now time to implement the backend part of our credit card handling.
For credit card processing at the frontend, we made use of the Stripe API (https://stripe.com/docs/api). In a product environment, you would need to create an account with Stripe and obtain an API key to use for your application. For testing purposes, however, we can make use of testing API keys and test credit card numbers, which Stripe happily provides for developers to build productive apps that are capable of processing credit cards. To learn more about testing credit card numbers and testing tokens that are provided by Stripe, take a look at https://stripe.com/docs/testing.
In our frontend code, we made use of the following Stripe API code to create a token:
let { token...