File tree Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ VITE_STORAGE_BUCKET = e-commerce-cb1da.appspot.com
6
6
VITE_MESSAGING_SENDER_ID = 643522166005
7
7
VITE_APP_ID = 1:643522166005:web:b5f64a3204ba71bcc5d9bc
8
8
9
- VITE_STRIPE_PUBLISH_KEY = pk_test_51IhD2ISEIMxXwIhEbF3F1RJovmp613mt1x3vyZGjKqoYqe5pGc9C2cTxN3uNPGIkiTuo815fej7RzpHQE15H7NYb00siStbRNX
9
+ VITE_STRIPE_PUBLIC_KEY = pk_test_51IhD2ISEIMxXwIhEbF3F1RJovmp613mt1x3vyZGjKqoYqe5pGc9C2cTxN3uNPGIkiTuo815fej7RzpHQE15H7NYb00siStbRNX
10
10
STRIPE_SECRET_KEY = sk_test_51IhD2ISEIMxXwIhEPJVB4qxe8aElvOYWzUYP8rK2AJpNN8NfR9benmequXoXpY8iBQktXUcZ9qU8ZTA6T4UIeQgW00kC7DVowg
11
11
12
12
VITE_TEST_EMAIL = testAccount@gmail.com
Original file line number Diff line number Diff line change @@ -6,14 +6,11 @@ import { Elements } from "@stripe/react-stripe-js";
6
6
import "./stripe.css" ;
7
7
// Make sure to call loadStripe outside of a component’s render to avoid
8
8
// 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 ) ;
12
10
//Redux
13
11
import { useSelector , useDispatch } from "react-redux" ;
14
12
import { calculateSubtotal , calculateTotalQuantity } from "../../redux/slice/cartSlice" ;
15
13
import { formatPrice } from "../../utils/formatPrice" ;
16
- import { toast } from "react-toastify" ;
17
14
18
15
const Checkout = ( ) => {
19
16
// Redux states
@@ -25,8 +22,8 @@ const Checkout = () => {
25
22
dispatch ( calculateSubtotal ( ) ) ;
26
23
dispatch ( calculateTotalQuantity ( ) ) ;
27
24
} , [ dispatch , cartItems ] ) ;
25
+
28
26
// local States
29
- const [ message , setMessage ] = useState ( "Initializing Checkout... " ) ;
30
27
const [ clientSecret , setClientSecret ] = useState ( "" ) ;
31
28
32
29
const description = `Payment of ${ formatPrice ( totalAmount ) } from ${ email } ` ;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ const checkoutSlice = createSlice({
13
13
state . shippingAddress = action . payload ;
14
14
} ,
15
15
saveBillingAddress : ( state , action ) => {
16
- console . log ( action . payload ) ;
17
16
state . billingAddress = action . payload ;
18
17
} ,
19
18
} ,
You can’t perform that action at this time.
0 commit comments