April 2020
Intermediate to advanced
716 pages
18h 55m
English
During checkout, to collect credit card details from the user, we will use Stripe's Card Elements to add the credit card field to the checkout form. To integrate Card Elements with our React interface, we will utilize the react-stripe-elements node module, which can be installed by running the following command from the command line:
yarn add react-stripe-elements
We will also need to inject the Stripe.js code into template.js to access Stripe in the frontend code, as shown here.
mern-marketplace/template.js:
<script id="stripe-js" src="https://js.stripe.com/v3/"></script>
For the MERN Marketplace, Stripe will be required in the Cart view, where the Checkout component needs it to render Card Elements and ...
Read now
Unlock full access