Skip to content

Commit

Permalink
Development: update steps for testing subscriptions (#10992)
Browse files Browse the repository at this point in the history
- Mention the use of environment variables for testing
- Add a default for the stripe key (otherwise the instance won't start)
  • Loading branch information
stsewd authored Jan 4, 2024
1 parent e778db5 commit cd54571
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions docs/dev/subscriptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ Local testing
-------------

To test subscriptions locally, you need to have access to the Stripe account,
and define the following settings with the keys from Stripe test mode:
and define the following environment variables with the keys from Stripe test mode:

- ``STRIPE_SECRET``: https://dashboard.stripe.com/test/apikeys
- ``STRIPE_TEST_SECRET_KEY``: https://dashboard.stripe.com/test/apikeys
- ``DJSTRIPE_WEBHOOK_SECRET``: https://dashboard.stripe.com/test/webhooks
- ``RTD_STRIPE_SECRET``: https://dashboard.stripe.com/test/apikeys
- ``RTD_DJSTRIPE_WEBHOOK_SECRET``: https://dashboard.stripe.com/test/webhooks

To test the webhook locally, you need to run your local instance with ngrok, for example:

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/settings/docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def DATABASES(self): # noqa
AWS_S3_ENDPOINT_URL = "http://storage:9000/"
AWS_QUERYSTRING_AUTH = False

STRIPE_SECRET = os.environ.get("RTD_STRIPE_SECRET")
STRIPE_SECRET = os.environ.get("RTD_STRIPE_SECRET", "sk_test_x")
STRIPE_PUBLISHABLE = os.environ.get("RTD_STRIPE_PUBLISHABLE")
STRIPE_TEST_SECRET_KEY = STRIPE_SECRET
DJSTRIPE_WEBHOOK_SECRET = os.environ.get("RTD_DJSTRIPE_WEBHOOK_SECRET")
Expand Down

0 comments on commit cd54571

Please sign in to comment.