From d739d9bd91737e450e73bda8b69c7996aab7c2ac Mon Sep 17 00:00:00 2001 From: rizwanisready Date: Mon, 29 Jul 2024 11:51:03 +0530 Subject: [PATCH] debugging on stripe subscription --- manage_subscriptions/views.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/manage_subscriptions/views.py b/manage_subscriptions/views.py index 4f897fc..9ff9dd4 100644 --- a/manage_subscriptions/views.py +++ b/manage_subscriptions/views.py @@ -542,23 +542,23 @@ def create_checkout_session(request): # customer=customer.id, # Optional: Link the session to the Stripe customer created above line_items=[ { - "price": "price_1PgkAUCesU6kunsI0AwDONty", - # "price_data": { - # "currency": "gbp", - # "product_data": { - # "name": subscription.title, # Adjust with your subscription/product name - # }, - # "unit_amount": int( - # final_amount * 100 - # ), # Unit amount in cents/pence - # "tax_behavior": "inclusive", # or 'exclusive', based on your tax settings - # }, + # "price": "price_1PgkAUCesU6kunsI0AwDONty", + "price_data": { + "currency": "gbp", + "product_data": { + "name": subscription.title, # Adjust with your subscription/product name + }, + "unit_amount": int( + final_amount * 100 + ), # Unit amount in cents/pence + "tax_behavior": "inclusive", # or 'exclusive', based on your tax settings + }, "quantity": 1, } ], # allow_promotion_codes=True, - # mode="payment", - mode="subscription", + mode="payment", + # mode="subscription", # discounts=[{"coupon": "VLMAsicx"}], success_url=request.build_absolute_uri("/subscriptions/success/"), cancel_url=request.build_absolute_uri("/subscriptions/cancel/"),