Utilities
Utility functions related to the djstripe app.
Attributes
djstripe.utils.CURRENCY_SIGILS = {'CAD': '$', 'EUR': '€', 'GBP': '£', 'USD': '$'}
module-attribute
Classes
djstripe.utils.QuerySetMock
Bases: QuerySet
A mocked QuerySet class that does not handle updates. Used by UpcomingInvoice.invoiceitems (deprecated) and UpcomingInvoice.lineitems.
Source code in djstripe/utils.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
Functions
djstripe.utils.QuerySetMock.delete()
Source code in djstripe/utils.py
82 83 |
|
djstripe.utils.QuerySetMock.from_iterable(model, iterable)
classmethod
Source code in djstripe/utils.py
69 70 71 72 73 74 |
|
djstripe.utils.QuerySetMock.update()
Source code in djstripe/utils.py
79 80 |
|
Functions
djstripe.utils.clear_expired_idempotency_keys()
Source code in djstripe/utils.py
31 32 33 34 35 |
|
djstripe.utils.convert_tstamp(response)
Convert a Stripe API timestamp response (unix epoch) to a native datetime.
Source code in djstripe/utils.py
38 39 40 41 42 43 44 45 46 47 48 49 |
|
djstripe.utils.get_friendly_currency_amount(amount, currency)
Source code in djstripe/utils.py
56 57 58 59 60 |
|
djstripe.utils.get_id_from_stripe_data(data)
Extract stripe id from stripe field data
Source code in djstripe/utils.py
86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
djstripe.utils.get_model(model_name)
Source code in djstripe/utils.py
101 102 103 104 105 |
|
djstripe.utils.get_queryset(pks, model_name)
Source code in djstripe/utils.py
108 109 110 |
|
djstripe.utils.get_supported_currency_choices(api_key)
Pull a stripe account's supported currencies and returns a choices tuple of those supported currencies.
:param api_key: The api key associated with the account from which to pull data. :type api_key: str
Source code in djstripe/utils.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
djstripe.utils.get_timezone_utc()
Returns UTC attribute in a backwards compatible way.
UTC attribute has been moved from django.utils.timezone module to datetime.timezone class
Source code in djstripe/utils.py
113 114 115 116 117 118 119 120 121 122 123 124 |
|