From 9ef1593f333b06930370e696dc83c842ce5b1159 Mon Sep 17 00:00:00 2001 From: rizwanisready Date: Fri, 2 Aug 2024 12:37:09 +0530 Subject: [PATCH] auto recurring testing phase 18 --- goodtimes/webhook.py | 6 +----- manage_subscriptions/views.py | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/goodtimes/webhook.py b/goodtimes/webhook.py index e8bb95d..97cbbab 100644 --- a/goodtimes/webhook.py +++ b/goodtimes/webhook.py @@ -132,11 +132,7 @@ class WebhookService: raise ValueError(f"Invalid subscription ID: {subscription_id}") def get_stripe_subscription(self): - stripe_subscription_id = self.charge_data["metadata"]["subscription"] - if stripe_subscription_id: - return stripe_subscription_id - else: - return None + return self.charge_data.get("subscription") def get_order_id(self): return self.charge_data["metadata"]["order_id"] diff --git a/manage_subscriptions/views.py b/manage_subscriptions/views.py index b508ce8..163c283 100644 --- a/manage_subscriptions/views.py +++ b/manage_subscriptions/views.py @@ -723,6 +723,7 @@ def create_checkout_session(request): "principal": str(request.user.id), "order_id": order_id, "subscription_id": str(subscription.id), + "subscription": str(subscription.id), "transaction_id": "", "couponCode": coupon_code if coupon_code else None, },