Skip to content

Commit

Permalink
Stripe CLI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofix committed Nov 17, 2024
1 parent 34ab1ba commit 133c9e9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/webhooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ webhooks. Follow these steps to configure webhooks in your Stripe Dashboard:
ensure your endpoint is correctly configured and can receive and process
events from Stripe.


Testing with Stripe CLI
----------------------

The `Stripe CLI <https://stripe.com/docs/stripe-cli#install>`_ provides a simple way to test webhooks during local development by forwarding Stripe events to your local server. After installing and running ``stripe login``, you can start forwarding events to your local Django server with ``stripe listen --forward-to localhost:8000/payments/process/stripe/``. Use the webhook signing secret provided by the CLI in your development settings.

.. code-block:: bash
# Start webhook forwarding
stripe listen --forward-to localhost:8000/payments/process/stripe/
# In another terminal, trigger test events
stripe trigger checkout.session.completed
.. note::

It's essential to secure your webhook endpoint and verify the authenticity of
Expand Down

0 comments on commit 133c9e9

Please sign in to comment.