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