diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-09-20 14:16:48 +0000 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-09-20 14:33:54 +0000 |
| commit | 58a83d12228fbbd4e9dde542e133d264204ee0f3 (patch) | |
| tree | 60aaf45e3281e88fddc58fea8fe75de0ad4e2f46 /addons/payment | |
| parent | f6da4d57bcc8e19ae0bd6d571926706bee46e08f (diff) | |
| parent | 4a1321bc99dd7d8d153aceb2d0076161ce28bcd7 (diff) | |
[MERGE] forward port branch saas-12.4 up to 4a1321bc99d
closes odoo/odoo#37127
Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'addons/payment')
| -rw-r--r-- | addons/payment/controllers/portal.py | 6 | ||||
| -rw-r--r-- | addons/payment/models/payment_acquirer.py | 4 | ||||
| -rw-r--r-- | addons/payment/static/src/js/payment_processing.js | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 2d29278cd7d..be081a4e34f 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -83,7 +83,7 @@ class PaymentProcessing(http.Controller): # populate the returned dictionnary with the transactions data for tx in payment_transaction_ids: message_to_display = tx.acquirer_id[tx.state + '_msg'] if tx.state in ['done', 'pending', 'cancel'] else None - result['transactions'].append({ + tx_info = { 'reference': tx.reference, 'state': tx.state, 'return_url': tx.return_url, @@ -93,7 +93,9 @@ class PaymentProcessing(http.Controller): 'amount': tx.amount, 'currency': tx.currency_id.name, 'acquirer_provider': tx.acquirer_id.provider, - }) + } + tx_info.update(tx._get_processing_info()) + result['transactions'].append(tx_info) tx_to_process = payment_transaction_ids.filtered(lambda x: x.state == 'done' and x.is_processed is False) try: diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index f9d703972d8..d23658ffa5d 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -644,6 +644,10 @@ class PaymentTransaction(models.Model): transactions = self.filtered(lambda t: t.state != 'draft') return transactions and transactions[0] or transactions + def _get_processing_info(self): + """ Extensible method for providers if they need specific fields/info regarding a tx in the payment processing page. """ + return dict() + def _get_payment_transaction_sent_message(self): self.ensure_one() if self.payment_token_id: diff --git a/addons/payment/static/src/js/payment_processing.js b/addons/payment/static/src/js/payment_processing.js index 53b688be06a..f52d34f6a8c 100644 --- a/addons/payment/static/src/js/payment_processing.js +++ b/addons/payment/static/src/js/payment_processing.js @@ -94,7 +94,7 @@ odoo.define('payment.processing', function (require) { return nbTx; } // if there's only one tx to manage - if(countTxInState(['tx_done', 'tx_error']) === 1) { + if(countTxInState(['tx_done', 'tx_error', 'tx_pending']) === 1) { var tx = render_values['tx_done'][0] || render_values['tx_error'][0]; if (tx) { window.location = tx.return_url; |
