From 25155aa47244aa6e8216598be94a4acdfe1f1c07 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 3 Jun 2019 12:56:50 +0000 Subject: [PATCH] [FIX] payment_adyen: empty field - Activate Adyen - In the eCommerce, purchase an item - Change the delivery address - Pay with Adyen A internal error is raised. It is caused by `val.replace(...)` where `val` is `False` ( due to `shopperEmail`). We make the code more robust by fallbacking on the billing email, then on an empty string. opw-2002974 [1] https://docs.adyen.com/classic-integration/hosted-payment-pages/hpp-payment-response/payment-response-merchantsig-sha-256/ closes odoo/odoo#33840 Signed-off-by: Nicolas Martinelli (nim) --- addons/payment_adyen/models/payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment_adyen/models/payment.py b/addons/payment_adyen/models/payment.py index 75faabeaba4..b5b59e6b7f6 100644 --- a/addons/payment_adyen/models/payment.py +++ b/addons/payment_adyen/models/payment.py @@ -128,7 +128,7 @@ class AcquirerAdyen(models.Model): 'sessionValidity': tmp_date.isoformat('T')[:19] + "Z", 'resURL': '%s' % urlparse.urljoin(base_url, AdyenController._return_url), 'merchantReturnData': json.dumps({'return_url': '%s' % values.pop('return_url')}) if values.get('return_url', '') else False, - 'shopperEmail': values.get('partner_email', ''), + 'shopperEmail': values.get('partner_email') or values.get('billing_partner_email') or '', }) values['merchantSig'] = self._adyen_generate_merchant_sig_sha256('in', values)