diff --git a/addons/payment/__manifest__.py b/addons/payment/__manifest__.py index 241c9c32c0c..4b7e5b17484 100644 --- a/addons/payment/__manifest__.py +++ b/addons/payment/__manifest__.py @@ -36,6 +36,7 @@ 'assets': { 'web.assets_frontend': [ 'payment/static/src/scss/portal_payment.scss', + 'payment/static/src/scss/payment_templates.scss', 'payment/static/src/scss/payment_form.scss', 'payment/static/lib/jquery.payment/jquery.payment.js', 'payment/static/src/js/checkout_form.js', diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 8a87eabd0e2..08d0207f5bc 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -371,7 +371,7 @@ class PaymentPortal(portal.CustomerPortal): @http.route('/payment/confirmation', type='http', methods=['GET'], auth='public', website=True) def payment_confirm(self, tx_id, access_token, **kwargs): - """ Display the payment confirmation page with the appropriate status message to the user. + """ Display the payment confirmation page to the user. :param str tx_id: The transaction to confirm, as a `payment.transaction` id :param str access_token: The access token used to verify the user @@ -388,36 +388,11 @@ class PaymentPortal(portal.CustomerPortal): ): raise werkzeug.exceptions.NotFound # Don't leak info about existence of an id - # Fetch the appropriate status message configured on the acquirer - if tx_sudo.state == 'draft': - status = 'info' - message = tx_sudo.state_message \ - or _("This payment has not been processed yet.") - elif tx_sudo.state == 'pending': - status = 'warning' - message = tx_sudo.acquirer_id.pending_msg - elif tx_sudo.state == 'authorized': - status = 'success' - message = tx_sudo.acquirer_id.auth_msg - elif tx_sudo.state == 'done': - status = 'success' - message = tx_sudo.acquirer_id.done_msg - elif tx_sudo.state == 'cancel': - status = 'danger' - message = tx_sudo.acquirer_id.cancel_msg - else: - status = 'danger' - message = tx_sudo.state_message \ - or _("An error occurred during the processing of this payment.") + # Stop monitoring the transaction now that it reached a final state. + PaymentPostProcessing.remove_transactions(tx_sudo) # Display the payment confirmation page to the user - PaymentPostProcessing.remove_transactions(tx_sudo) - render_values = { - 'tx': tx_sudo, - 'status': status, - 'message': message - } - return request.render('payment.confirm', render_values) + return request.render('payment.confirm', qcontext={'tx': tx_sudo}) else: # Display the portal homepage to the user return request.redirect('/my/home') diff --git a/addons/payment/static/src/scss/payment_templates.scss b/addons/payment/static/src/scss/payment_templates.scss new file mode 100644 index 00000000000..ed602ff2d66 --- /dev/null +++ b/addons/payment/static/src/scss/payment_templates.scss @@ -0,0 +1,3 @@ +div#o_payment_status_alert > p { + margin-bottom: 0; +} diff --git a/addons/payment/views/payment_portal_templates.xml b/addons/payment/views/payment_portal_templates.xml index 5e9ef2eeb80..04df08baaf6 100644 --- a/addons/payment/views/payment_portal_templates.xml +++ b/addons/payment/views/payment_portal_templates.xml @@ -113,8 +113,6 @@ diff --git a/addons/payment_transfer/views/payment_transfer_templates.xml b/addons/payment_transfer/views/payment_transfer_templates.xml index c0e3ef37d97..713d1de908a 100644 --- a/addons/payment_transfer/views/payment_transfer_templates.xml +++ b/addons/payment_transfer/views/payment_transfer_templates.xml @@ -8,7 +8,7 @@