[FIX] pos_pax: chrome creats many requests

Appears to be bad click handling, as the 'click' is processed, but I also wrapped the ternary operators in case browsers handle that differently (.. I've seen 5+ requests...)
This commit is contained in:
Jared Kipe
2021-01-12 15:58:43 -08:00
parent 7b25333bc7
commit e2b1e64e20

View File

@@ -189,7 +189,7 @@ PaymentScreenWidget.include({
});
PAX.mDestinationIP = this.pos.config.pax_endpoint;
PAX[(tender_type == 'debit') ? 'DoDebit' : 'DoCredit'](transaction, function (response) {
PAX[((tender_type == 'debit') ? 'DoDebit' : 'DoCredit')](transaction, function (response) {
console.log(response);
var parsed_response = self.pos.decodePAXResponse(response);
if (parsed_response.fail) {
@@ -252,7 +252,7 @@ PaymentScreenWidget.include({
}
PAX.mDestinationIP = this.pos.config.pax_endpoint;
PAX[(line.pax_tender_type == 'debit') ? 'DoDebit' : 'DoCredit'](transaction, function (response) {
PAX[((line.pax_tender_type == 'debit') ? 'DoDebit' : 'DoCredit')](transaction, function (response) {
var parsed_response = self.pos.decodePAXResponse(response);
if (parsed_response.fail) {
def.resolve({message: parsed_response.fail})
@@ -330,10 +330,10 @@ PaymentScreenWidget.include({
render_paymentlines: function() {
this._super();
var self = this;
self.$('.paymentlines-container').on('click', '.pax_send_transaction', function(){
self.$('.paymentlines-container .pax_send_transaction').on('click', null, function(){
self.click_pax_send_transaction('credit');
});
self.$('.paymentlines-container').on('click', '.pax_send_transaction_debit', function(){
self.$('.paymentlines-container .pax_send_transaction_debit').on('click', null, function(){
self.click_pax_send_transaction('debit');
});
},