From f05b10ce4984c10be9a9664f17f093ba2ec5ee85 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 24 Jul 2018 15:38:19 +0200 Subject: [PATCH] [FIX] website_payment: display acquirer's messages in case of wire transfer Connect as portal, go to my account > invoices and click pay now select wire transfer as the acquirer and then pay now Before this commit, the messages displayed to the user was misleading and wrong After this commit, we take the relevant acquirer's message OPW 1867670 closes #17508 closes #25946 --- addons/website_payment/controllers/main.py | 8 ++++++++ .../website_payment/views/website_payment_templates.xml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/website_payment/controllers/main.py b/addons/website_payment/controllers/main.py index 93dfab8bcb6..9cc5818d826 100644 --- a/addons/website_payment/controllers/main.py +++ b/addons/website_payment/controllers/main.py @@ -80,6 +80,14 @@ class WebsitePayment(http.Controller): 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.') + if tx.acquirer_id and tx.acquirer_id.provider == 'transfer': + status = (tx.state in ('done', 'pending') and 'success') or 'danger' + if tx.state == 'done': + message = tx.acquirer_id.done_msg + elif tx.state == 'pending': + message = tx.acquirer_id.pending_msg + else: + message = tx.acquirer_id.error_msg return request.render('website_payment.confirm', {'tx': tx, 'status': status, 'message': message}) else: return request.redirect('/my/home') diff --git a/addons/website_payment/views/website_payment_templates.xml b/addons/website_payment/views/website_payment_templates.xml index bf01e712999..a7ec331cc59 100644 --- a/addons/website_payment/views/website_payment_templates.xml +++ b/addons/website_payment/views/website_payment_templates.xml @@ -136,7 +136,7 @@
-
+