[FIX] point_of_sale: Electronic payment cancel might fail
With Worldline, the cancel command fails when the card was already inserted. closes odoo/odoo#67560 Taskid: 2415526 X-original-commit: c71f71fab63d2ccb1faeccbe54425f5b0fb488f0 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
committed by
Pierre Masereel
parent
492bd7dafa
commit
f0d26f1a87
@@ -332,10 +332,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 }) {
|
||||
|
||||
Reference in New Issue
Block a user