From cb5a7f9ad18b2080be05d5dfbf52d68ad9ac6a6a Mon Sep 17 00:00:00 2001 From: "Denis Robinet (ACSONE)" Date: Fri, 22 Apr 2022 07:32:50 +0200 Subject: [PATCH] Fix payement for bancontact --- mozaik_membership_payment/controllers/portal.py | 2 +- mozaik_membership_payment_stripe/models/payment_acquirer.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mozaik_membership_payment/controllers/portal.py b/mozaik_membership_payment/controllers/portal.py index dbca0e921..3e2cbe446 100644 --- a/mozaik_membership_payment/controllers/portal.py +++ b/mozaik_membership_payment/controllers/portal.py @@ -119,7 +119,7 @@ def transaction( } if not partner_id: # ACS # required field, not set if there is no partner - render_values["billing_partner_country"] = self.env.company.country_id + render_values["billing_partner_country"] = request.env.company.country_id return acquirer.sudo().render( tx.reference, float(amount), int(currency_id), values=render_values ) diff --git a/mozaik_membership_payment_stripe/models/payment_acquirer.py b/mozaik_membership_payment_stripe/models/payment_acquirer.py index 33cb0b33a..a339a09a0 100644 --- a/mozaik_membership_payment_stripe/models/payment_acquirer.py +++ b/mozaik_membership_payment_stripe/models/payment_acquirer.py @@ -12,3 +12,8 @@ def _stripe_request(self, url, data=False, method="POST"): if data and "customer_email" in data and not data["customer_email"]: data.pop("customer_email") return super(PaymentAcquirer, self)._stripe_request(url, data, method) + + def stripe_form_generate_values(self, tx_values): + if not tx_values.get("billing_partner_country"): + tx_values["billing_partner_country"] = self.env.user.company_id.country_id + return super(PaymentAcquirer, self).stripe_form_generate_values(tx_values)