Skip to Content
Full-Stack React Projects - Second Edition
book

Full-Stack React Projects - Second Edition

by Shama Hoque
April 2020
Intermediate to advanced
716 pages
18h 55m
English
Packt Publishing
Content preview from Full-Stack React Projects - Second Edition

The CardElement component

Stripe's CardElement is self-contained, so we can just add it to the PlaceOrder component, then incorporate styles as desired, and the card detail input will be taken care of. We will add the CardElement component to PlaceOrder as follows.

mern-marketplace/client/cart/PlaceOrder.js:

<CardElement className={classes.StripeElement}      {...{style: {      base: {        color: '#424770',        letterSpacing: '0.025em',        '::placeholder': {          color: '#aab7c4',        },      },      invalid: {        color: '#9e2146',      },    }}}/>

This will render the credit card details field in the checkout form view. In the next section, we will learn how to securely validate and store the credit card details that are entered in this field when the user clicks on a button to place an ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack React Projects

Full-Stack React Projects

Shama Hoque
React Native - The Practical Guide

React Native - The Practical Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839215414Supplemental Content