From 540442fa287df8c270f372ea6ae04110d6d1b842 Mon Sep 17 00:00:00 2001 From: bobbyvish Date: Wed, 30 Oct 2024 12:33:53 +0530 Subject: [PATCH] fix: stipe key issue --- goodtimes/settings/base.py | 9 +++++---- manage_subscriptions/api/views.py | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/goodtimes/settings/base.py b/goodtimes/settings/base.py index c4a02c3..d0dde01 100644 --- a/goodtimes/settings/base.py +++ b/goodtimes/settings/base.py @@ -303,11 +303,12 @@ SIMPLE_JWT = { "JTI_CLAIM": "jti", } -STRIPE_SECRET_KEY = "sk_test_51OexsKCesU6kunsIsbSKSZc1BF4gjklniaue8lmpkGKqDzenQtMkR8tKAryxErJXqp0jPiu1Gg7papa4tqZfKL9G00qUM4toB2" -STRIPE_PUBLISH_KEY = "pk_test_51OexsKCesU6kunsINDvKUhbelxeUmDAVZGSOisZ6XXHCp3pKtl4vs0pR42w0OcjZhngmECsXQNbAKNPOhiFMTJ8o00sRZQG0lh" -# STRIPE_SECRET_KEY = env.str("STRIPE_SECRET_KEY") -# STRIPE_PUBLISH_KEY = env.str("STRIPE_PUBLISH_KEY") +STRIPE_SECRET_KEY = env.str("STRIPE_SECRET_KEY") +STRIPE_PUBLISH_KEY = env.str("STRIPE_PUBLISH_KEY") +# https://dashboard.stripe.com/webhooks/create?endpoint_location=local +# This is your Stripe CLI webhook secret for testing your endpoint locally. +ENDPOINT_SECRET = "whsec_ccf1f87295603cdd1733995ee2d3c0d6f74c7ceaf28916ea45114a54b7ce1d0f" ONE_SIGNAL_APP_ID = env.str("ONE_SIGNAL_APP_ID") diff --git a/manage_subscriptions/api/views.py b/manage_subscriptions/api/views.py index a912406..56deb6e 100644 --- a/manage_subscriptions/api/views.py +++ b/manage_subscriptions/api/views.py @@ -133,7 +133,8 @@ class StripeWebhookTest(APIView): stripe.api_key = settings.STRIPE_SECRET_KEY payload = request.body sig_header = request.META["HTTP_STRIPE_SIGNATURE"] - endpoint_secret = "whsec_ccf1f87295603cdd1733995ee2d3c0d6f74c7ceaf28916ea45114a54b7ce1d0f" # Make sure to retrieve this from your settings + # This is your Stripe CLI webhook secret for testing your endpoint locally. + endpoint_secret = settings.ENDPOINT_SECRET event = None webhook_event = None