eagle0504 commited on
Commit
0bc2060
·
verified ·
1 Parent(s): f7b02d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -8,13 +8,16 @@ import time
8
  # Set your secret key. Remember to switch to your live secret key in production!
9
  stripe.api_key = os.environ["STRIPE_API_KEY"]
10
 
 
 
 
11
  # Function to create a Stripe Checkout Session
12
  def create_checkout_session():
13
  try:
14
  session = stripe.checkout.Session.create(
15
  payment_method_types=['card'],
16
  line_items=[{
17
- 'price': 'your-stripe-price-id', # Replace with your actual Stripe price ID
18
  'quantity': 1,
19
  }],
20
  mode='payment',
 
8
  # Set your secret key. Remember to switch to your live secret key in production!
9
  stripe.api_key = os.environ["STRIPE_API_KEY"]
10
 
11
+ # Set the product id.
12
+ stripe_product_id = os.environ["STRIPE_PRODUCT_ID"]
13
+
14
  # Function to create a Stripe Checkout Session
15
  def create_checkout_session():
16
  try:
17
  session = stripe.checkout.Session.create(
18
  payment_method_types=['card'],
19
  line_items=[{
20
+ 'price': stripe_product_id, # Replace with your actual Stripe price ID
21
  'quantity': 1,
22
  }],
23
  mode='payment',