Skip to content

Commit b4e2400

Browse files
committed
Code Clean
1 parent 1eb3f9a commit b4e2400

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ VITE_STORAGE_BUCKET = e-commerce-cb1da.appspot.com
66
VITE_MESSAGING_SENDER_ID = 643522166005
77
VITE_APP_ID = 1:643522166005:web:b5f64a3204ba71bcc5d9bc
88

9-
VITE_STRIPE_PUBLISH_KEY = pk_test_51IhD2ISEIMxXwIhEbF3F1RJovmp613mt1x3vyZGjKqoYqe5pGc9C2cTxN3uNPGIkiTuo815fej7RzpHQE15H7NYb00siStbRNX
9+
VITE_STRIPE_PUBLIC_KEY = pk_test_51IhD2ISEIMxXwIhEbF3F1RJovmp613mt1x3vyZGjKqoYqe5pGc9C2cTxN3uNPGIkiTuo815fej7RzpHQE15H7NYb00siStbRNX
1010
STRIPE_SECRET_KEY = sk_test_51IhD2ISEIMxXwIhEPJVB4qxe8aElvOYWzUYP8rK2AJpNN8NfR9benmequXoXpY8iBQktXUcZ9qU8ZTA6T4UIeQgW00kC7DVowg
1111

1212
VITE_TEST_EMAIL= testAccount@gmail.com

src/pages/checkout/Checkout.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ import { Elements } from "@stripe/react-stripe-js";
66
import "./stripe.css";
77
// Make sure to call loadStripe outside of a component’s render to avoid
88
// recreating the Stripe object on every render.
9-
const stripePromise = loadStripe(
10-
"pk_test_51IhD2ISEIMxXwIhEbF3F1RJovmp613mt1x3vyZGjKqoYqe5pGc9C2cTxN3uNPGIkiTuo815fej7RzpHQE15H7NYb00siStbRNX"
11-
);
9+
const stripePromise = loadStripe(import.meta.env.VITE_STRIPE_PUBLIC_KEY);
1210
//Redux
1311
import { useSelector, useDispatch } from "react-redux";
1412
import { calculateSubtotal, calculateTotalQuantity } from "../../redux/slice/cartSlice";
1513
import { formatPrice } from "../../utils/formatPrice";
16-
import { toast } from "react-toastify";
1714

1815
const Checkout = () => {
1916
// Redux states
@@ -25,8 +22,8 @@ const Checkout = () => {
2522
dispatch(calculateSubtotal());
2623
dispatch(calculateTotalQuantity());
2724
}, [dispatch, cartItems]);
25+
2826
// local States
29-
const [message, setMessage] = useState("Initializing Checkout... ");
3027
const [clientSecret, setClientSecret] = useState("");
3128

3229
const description = `Payment of ${formatPrice(totalAmount)} from ${email}`;

src/redux/slice/checkoutSlice.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const checkoutSlice = createSlice({
1313
state.shippingAddress = action.payload;
1414
},
1515
saveBillingAddress: (state, action) => {
16-
console.log(action.payload);
1716
state.billingAddress = action.payload;
1817
},
1918
},

0 commit comments

Comments
 (0)