Skip to content

Commit 85c8464

Browse files
committed
update stripe key usage
1 parent 8bb5d30 commit 85c8464

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function App() {
5252
</div>
5353
<Cart itemsInCart={itemsInCart} totalCost={totalCost} />
5454
{itemsInCart.length > 0 && (
55-
<StripeProvider apiKey="pk_test_TYooMQauvdEDq54NiTphI7jx">
55+
<StripeProvider apiKey={process.env.REACT_APP_STRIPE_PUBLIC_KEY}>
5656
<Elements>
5757
<CheckoutForm totalCost={totalCost} />
5858
</Elements>

src/lambda/charge.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const stripe = require('stripe')('sk_test_yaKbjP7rkSGdMeQtQvTMx4cG');
1+
require('dotenv').config();
2+
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
23

34
exports.handler = (event, context, callback) => {
45
// This will allow us to freeze open connections to a database

0 commit comments

Comments
 (0)