From c71f71fab63d2ccb1faeccbe54425f5b0fb488f0 Mon Sep 17 00:00:00 2001 From: Antoine Prieels Date: Tue, 15 Dec 2020 13:02:25 +0000 Subject: [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 --- .../static/src/js/Screens/PaymentScreen/PaymentScreen.js | 7 ++++--- 1 file 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 }) { -- cgit v1.2.3