diff options
| author | Antoine Prieels <anp@odoo.com> | 2020-12-15 13:02:25 +0000 |
|---|---|---|
| committer | Pierre Masereel <pim@odoo.com> | 2021-03-09 14:44:55 +0000 |
| commit | c71f71fab63d2ccb1faeccbe54425f5b0fb488f0 (patch) | |
| tree | e07e451d975754635317a7deb4dd9f31cb84c030 /addons/point_of_sale | |
| parent | 2e225179bf3fb6ed98fa51f9fceca6f286a70b85 (diff) | |
[FIX] point_of_sale: Electronic payment cancel might fail
With Worldline, the cancel command fails when the card was already inserted.
closes odoo/odoo#67540
Taskid: 2415526
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/point_of_sale')
| -rw-r--r-- | addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js b/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js index 78f1638cf65..03275dd9040 100644 --- a/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js +++ b/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js @@ -318,10 +318,11 @@ odoo.define('point_of_sale.PaymentScreen', function (require) { async _sendPaymentCancel({ detail: line }) { const payment_terminal = line.payment_method.payment_terminal; line.set_payment_status('waitingCancel'); - try { - payment_terminal.send_payment_cancel(this.currentOrder, line.cid); - } finally { + const isCancelSuccessful = await payment_terminal.send_payment_cancel(this.currentOrder, line.cid); + if (isCancelSuccessful) { line.set_payment_status('retry'); + } else { + line.set_payment_status('waitingCard'); } } async _sendPaymentReverse({ detail: line }) { |
