# Stripe

ShipWithDjango integrates seamlessly with Stripe, allowing you to manage payments and subscriptions efficiently. The configuration for Stripe is managed through environment variables, ensuring that sensitive information like API keys and webhook secrets remain secure.

All the necessary configuration settings for Stripe are retrieved from your environment variables, which you can set up as described in the Setting up your environment variables section.

### Configuration Details

Here's an overview of the Stripe configuration settings:

* **Stripe Mode**:
  * `STRIPE_LIVE_MODE` controls whether your application is running in live mode (`True`) or test mode (`False`). This setting determines which API keys and webhook secrets will be used.
* **API Keys**:
  * `STRIPE_LIVE_PUBLIC_KEY` and `STRIPE_LIVE_SECRET_KEY` are used for live transactions.
  * `STRIPE_TEST_PUBLIC_KEY` and `STRIPE_TEST_SECRET_KEY` are used for test transactions in Stripe's sandbox environment.
* **Webhook Secrets**:
  * `STRIPE_LIVE_WEBHOOK_SECRET` is used to verify the authenticity of live webhook events.
  * `STRIPE_TEST_WEBHOOK_SECRET` is used to verify test webhook events.

By correctly configuring these settings, you can confidently handle payments and subscriptions in your application, whether you are in development or live production mode.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shipwithdjango.com/payments-and-billing/stripe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
