doc: add CardElement, useElements, useStripe from react-stripe-js and handleChange and handleSubmit method
This commit is contained in:
1 parent
f2ebe6e580
commit
7b96e90ea8
1 file changed
+12
-1
@@ -3,9 +3,16 @@ import { useStateValue } from "../../redux/StateProvider";
|
||||
import { Link } from "react-router-dom";
|
||||
import CheckoutProduct from "../CheckoutProduct";
|
||||
import "./Payment.css";
|
||||
import { CardElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
||||
|
||||
function Payment() {
|
||||
const [{ basket, user }, dispatch] = useStateValue();
|
||||
const stripe = useStripe();
|
||||
const elements = useElements();
|
||||
|
||||
const handleSubmit = (e) => {};
|
||||
const handleChange = (e) => {};
|
||||
|
||||
return (
|
||||
<section className="payment">
|
||||
<article className="payment__container">
|
||||
@@ -42,7 +49,11 @@ function Payment() {
|
||||
<article className="payment__title">
|
||||
<h3>Payment Method</h3>
|
||||
</article>
|
||||
<article className="payment__details"></article>
|
||||
<article className="payment__details">
|
||||
<form onClick={handleSubmit}>
|
||||
<CardElement onChange={handleChange} />
|
||||
</form>
|
||||
</article>
|
||||
</article>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
Reference in new issue
Block a user