diff options
| author | Magnus Hagander | 2023-06-15 11:35:45 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2023-06-15 11:35:45 +0000 |
| commit | 7f204cf595c5fb5a0daae20fe1f9eb809b173acb (patch) | |
| tree | b34acff236e3846aaac86a028a35e651e5db87d1 /postgresqleu/stripepayment | |
| parent | 233a68700b73659f7f17886330751ed20096f940 (diff) | |
Lock stripe API version
Newer versions have changed a number of things. We need to update to
work with those at some point, but to start with let's make sure we get
the current deployment working.
Diffstat (limited to 'postgresqleu/stripepayment')
| -rw-r--r-- | postgresqleu/stripepayment/api.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/postgresqleu/stripepayment/api.py b/postgresqleu/stripepayment/api.py index 10a4f1b8..30ca3f52 100644 --- a/postgresqleu/stripepayment/api.py +++ b/postgresqleu/stripepayment/api.py @@ -15,6 +15,7 @@ class StripeException(Exception): class StripeApi(object): APIBASE = "https://api.stripe.com/v1/" + APIVERSION = '2020-08-27' def __init__(self, pm): self.published_key = pm.config('published_key') @@ -48,10 +49,16 @@ class StripeApi(object): r = requests.post(self.APIBASE + suburl, list(self._api_encode(params)), auth=HTTPBasicAuth(self.secret_key, ''), + headers={ + 'Stripe-Version': self.APIVERSION, + }, ) else: r = requests.get(self.APIBASE + suburl, auth=HTTPBasicAuth(self.secret_key, ''), + headers={ + 'Stripe-Version': self.APIVERSION, + }, ) if raise_for_status: r.raise_for_status() |
