forked from dj-stripe/dj-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document idempotency keys and DJSTRIPE_IDEMPOTENCY_KEY_CALLBACK
- Loading branch information
1 parent
6a65b5e
commit f50be1f
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,30 @@ Payment plans default. | |
|
||
Possibly deprecated in favor of model based plans. | ||
|
||
|
||
DJSTRIPE_IDEMPOTENCY_KEY_CALLBACK (=djstripe.settings._get_idempotency_key) | ||
=========================================================================== | ||
|
||
A function which will return an idempotency key for a particular object_type | ||
and action pair. By default, this is set to a function which will create a | ||
``djstripe.IdempotencyKey`` object and return its ``uuid``. | ||
You may want to customize this if you want to give your idempotency keys a | ||
different lifecycle than they normally would get. | ||
|
||
The function takes the following signature: | ||
|
||
.. code-block:: python | ||
def get_idempotency_key(object_type: str, action: str, livemode: bool): | ||
return "<idempotency key>" | ||
The function MUST return a string suitably random for the object_type/action | ||
pair, and usable in the Stripe ``Idempotency-Key`` HTTP header. | ||
For more information, see the `stripe documentation`_. | ||
|
||
.. _stripe documentation: https://stripe.com/docs/api/curl#idempotent_requests | ||
|
||
|
||
DJSTRIPE_INVOICE_FROM_EMAIL (="[email protected]") | ||
==================================================== | ||
|
||
|