[FIX] account_payment: validate s2s payment transaction
- If a customer pays an invoice using a credit card, the payment is taken in account but the invoice validation isn't processed until the Payment Processing cron do it. We want the invoice to be validated as soon as possible. To do so, we need to redirect the customer on the payment processing page that take cares of validating the payments. OPW-1913876 closes odoo/odoo#30217
This commit is contained in:
@@ -77,11 +77,11 @@ class PaymentPortal(http.Controller):
|
||||
vals = {
|
||||
'payment_token_id': token.id,
|
||||
'type': 'server2server',
|
||||
'return_url': success_url,
|
||||
'return_url': _build_url_w_params(success_url, params),
|
||||
}
|
||||
|
||||
tx = invoice_sudo._create_payment_transaction(vals)
|
||||
PaymentProcessing.add_payment_transaction(tx)
|
||||
|
||||
params['success'] = 'pay_invoice'
|
||||
return request.redirect(_build_url_w_params(success_url, params))
|
||||
return request.redirect('/payment/process')
|
||||
|
||||
Reference in New Issue
Block a user