djstripe.settings

dj-stripe settings

DjstripeSettings

Container for Dj-stripe settings

:return: Initialised settings for Dj-stripe. :rtype: object

DEFAULT_STRIPE_API_VERSION

attribute  DEFAULT_STRIPE_API_VERSION

DJSTRIPE_WEBHOOK_URL

property  DJSTRIPE_WEBHOOK_URL

LIVE_API_KEY

property  LIVE_API_KEY

STRIPE_API_VERSION

property  STRIPE_API_VERSION: str

Get the desired API version to use for Stripe requests.

STRIPE_LIVE_MODE

property  STRIPE_LIVE_MODE

STRIPE_PUBLIC_KEY

property  STRIPE_PUBLIC_KEY

STRIPE_SECRET_KEY

property  STRIPE_SECRET_KEY

SUBSCRIBER_CUSTOMER_KEY

property  SUBSCRIBER_CUSTOMER_KEY

TEST_API_KEY

property  TEST_API_KEY

WEBHOOK_VALIDATION

property  WEBHOOK_VALIDATION

ZERO_DECIMAL_CURRENCIES

attribute  ZERO_DECIMAL_CURRENCIES

decimal_max_digits

property  decimal_max_digits

decimal_places

property  decimal_places

get_idempotency_key

property  get_idempotency_key

subscriber_request_callback

property  subscriber_request_callback

get_api_keys

get_api_keys(self) -> list[str]

Returns the distinct, non-empty secret API keys configured in settings.

This covers STRIPE_SECRET_KEY as well as the test/live secret keys. Useful for operations (such as syncing) that need to act on every key defined in the project settings rather than the database.

get_callback_function

get_callback_function(self, setting_name, default = None)

Resolve a callback function based on a setting name.

If the setting value isn't set, default is returned. If the setting value is already a callable function, that value is used - If the setting value is a string, an attempt is made to import it. Anything else will result in a failed import causing ImportError to be raised.

:param setting_name: The name of the setting to resolve a callback from. :type setting_name: string (str/unicode) :param default: The default to return if setting isn't populated. :type default: bool :returns: The resolved callback function (if any). :type: callable

get_default_api_key

get_default_api_key(self, livemode: bool | None) -> str

Returns the default API key for a value of livemode.

get_subscriber_model

get_subscriber_model(self)

Attempt to pull settings.DJSTRIPE_SUBSCRIBER_MODEL.

Users have the option of specifying a custom subscriber model via the DJSTRIPE_SUBSCRIBER_MODEL setting.

This methods falls back to AUTH_USER_MODEL if DJSTRIPE_SUBSCRIBER_MODEL is not set.

Returns the subscriber model that is active in this project.

get_subscriber_model_string

get_subscriber_model_string(self) -> str

Get the configured subscriber model as a module path string.