From 3198705e301ab3e49d7db3adbd174fde806b0b59 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 13 Sep 2019 12:19:29 +0000 Subject: [PATCH] [FIX] payment_stripe_sca: do not redefine `_get_stripe_api_url` There is no need to redefine `_get_stripe_api_url` by adding `https` since all existing calls to the method programmatically add it already. Therefore, we use the same approach: we add `https://`, then join the URL. opw-2031745 closes odoo/odoo#36957 X-original-commit: 0412786486462423c91afc1c5a4dcb25886827e4 Signed-off-by: Nicolas Martinelli (nim) --- addons/payment_stripe_sca/models/payment.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/payment_stripe_sca/models/payment.py b/addons/payment_stripe_sca/models/payment.py index 8bc9b19def5..890fdfe87d9 100644 --- a/addons/payment_stripe_sca/models/payment.py +++ b/addons/payment_stripe_sca/models/payment.py @@ -44,7 +44,8 @@ class PaymentAcquirerStripeSCA(models.Model): def _stripe_request(self, url, data=False, method="POST"): self.ensure_one() - url = urls.url_join(self._get_stripe_api_url(), url) + stripe_url = 'https://%s/' % (self._get_stripe_api_url()) + url = urls.url_join(stripe_url, url) headers = { "AUTHORIZATION": "Bearer %s" % self.sudo().stripe_secret_key, "Stripe-Version": "2019-05-16", # SetupIntent need a specific version @@ -84,10 +85,6 @@ class PaymentAcquirerStripeSCA(models.Model): ) return res - @api.model - def _get_stripe_api_url(self): - return "https://api.stripe.com/v1/" - @api.model def stripe_s2s_form_process(self, data): last4 = data.get("card", {}).get("last4")