From a8dfc7fb731dd6c34f55401d099ca1f72d796e9e Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Mon, 8 Jul 2019 11:15:44 +0000 Subject: [PATCH] [FIX] website_payment: consider authorized transactions as done Before this commit, when a transaction has as status 'authorized', the transactions' confirm page gives an error : 'Oops! There was a problem with your payment.' Now, the page gives the same message as when the transaction has the status 'done' : 'Your payment was successful! It may take some time to be validated on our end.' opw-1984325 closes odoo/odoo#34652 Signed-off-by: Damien Bouvy (dbo) --- addons/website_payment/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_payment/controllers/main.py b/addons/website_payment/controllers/main.py index 9cc5818d826..80ed49cf8bd 100644 --- a/addons/website_payment/controllers/main.py +++ b/addons/website_payment/controllers/main.py @@ -78,8 +78,8 @@ class WebsitePayment(http.Controller): tx_id = request.session.pop('website_payment_tx_id', False) if tx_id: tx = request.env['payment.transaction'].browse(tx_id) - status = (tx.state == 'done' and 'success') or 'danger' - message = (tx.state == 'done' and _('Your payment was successful! It may take some time to be validated on our end.')) or _('Oops! There was a problem with your payment.') + status = (tx.state in ['done', 'authorized'] and 'success') or 'danger' + message = (tx.state in ['done', 'authorized'] and _('Your payment was successful! It may take some time to be validated on our end.')) or _('Oops! There was a problem with your payment.') if tx.acquirer_id and tx.acquirer_id.provider == 'transfer': status = (tx.state in ('done', 'pending') and 'success') or 'danger' if tx.state == 'done':