[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) <nim@odoo.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user