Skip to content

Commit 64d9bd8

Browse files
author
Tom Blauwendraat
committed
fixup! [FIX] make module more robust
1 parent 55ae955 commit 64d9bd8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pos_payment_terminal/static/src/js/payment_terminal.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ odoo.define("pos_payment_terminal.payment", function(require) {
7373
pay_line,
7474
response
7575
);
76+
// show the new 'waiting_card' status on screen
7677
if (self.pos.chrome.gui.current_screen && self.pos.chrome.gui.current_screen.render_paymentlines) {
7778
self.pos.chrome.gui.current_screen.render_paymentlines();
7879
}
@@ -107,6 +108,7 @@ odoo.define("pos_payment_terminal.payment", function(require) {
107108
clearInterval(timerId);
108109
pay_line.set_payment_status("force_done");
109110
reject();
111+
return;
110112
}
111113
// Query the driver status more frequently than the regular POS
112114
// proxy, to get faster feedback when the transaction is
@@ -115,9 +117,11 @@ odoo.define("pos_payment_terminal.payment", function(require) {
115117
if (this.payment_method.oca_payment_terminal_id) {
116118
status_params.terminal_id = this.payment_method.oca_payment_terminal_id;
117119
}
118-
// if a user action already update the transaction status, dont bother
120+
// if a user action already updated the transaction status, stop checking status
119121
if ((pay_line.payment_status == 'done') || (pay_line.payment_status == 'retry')) {
120122
clearInterval(timerId);
123+
reject();
124+
return;
121125
}
122126
// otherwise check status
123127
this.pos.proxy.connection

0 commit comments

Comments
 (0)