question

Omar Reyes avatar image
Omar Reyes asked sam Deactivated commented

TX_START is sent twice, causes a FAIL

We're running a semi-integration with the clover mini using the remote-pay-cloud browser SDK.

Sometimes when I start a sale transaction, I receive a FAIL error from the onSaleResponse listener. This doesn't always occur, but when it does, it's when the console logs TX_START twice.

This is what I see on my Clover Mini:

  1. Clover Mini is on welcome screen
  2. When I start a sale transaction, the screen shows the add tip screen
  3. Clover Mini then clears the transaction and goes back to the welcome screen
  4. I receive a FAIL response from the onSaleResponse listener

Console Log: https://gist.github.com/mromarreyes/7...

6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sam avatar image sam commented ·

Hi Omar, We've seen this issue before but usually it's caused by network issue or having multiple instance of the browser POS open. If available, can you check to see if it's a network issue by trying it on a different machine with another connection?

0 Likes 0 ·
Omar Reyes avatar image Omar Reyes commented ·

Hi Sam, I will test on another network and report back. Under diagnostics it's reporting that Wifi and Server is disconnected even though I'm connected through wifi. I can send transactions to the cloud pay display app just fine. Is this normal for the sandbox clover mini? http://i.imgur.com/y9ydURd.png

By another machine do you mean another computer or another sandbox clover mini? I have another sandbox clover mini but I'm receiving a "Device Error" message on it, unrelated to this thread. https://devask.clover.com/question/59...

0 Likes 0 ·
Omar Reyes avatar image Omar Reyes commented ·

I used my iPhone's tether to test on another network. This is the speed test results using my tether, http://www.speedtest.net/my-result/59... I unfortunately received the error again. This only occurs approximately once out of every 40 transactions. I'm going to try a wired ethernet connection next.

console log: https://gist.github.com/mromarreyes/d...

EDITAlso occurred using a wired connection from my router. Speed test: http://www.speedtest.net/my-result/59...

0 Likes 0 ·
sam avatar image sam commented ·

@omarreyes are you calling this.cloverConnector.sale(saleRequest) on each onReady?

0 Likes 0 ·
Omar Reyes avatar image Omar Reyes commented ·

@Sam Yes, this.cloverConnector.sale(saleRequest` is only being called in the onReady listener and no where else. Is this correct? I would also like to add that we are not creating the saleRequest in the onReady listener. We create it in a "processOrder" function that is called when our process order button is clicked and save it in a variable to use when the onReady listener is fired. In the same function, after creating the saleRequest, we initializeConnection and wait until the onReady listener is fired and start the sale. Could this possible cause the bug? I can send you my code if needed.

0 Likes 0 ·
Show more comments

1 Answer

sam avatar image
sam Deactivated answered

@omarreyes Problem may be that onReady callback can be called more than once. If you're following the example on clover-cloud-connector-unit-examples and you call this.cloverConnector.sale(saleRequest) on every call to onReady, it may create a problem since onReady can be called multiple times. It's called more than once when the connection was re-established with the device, like when simulating a connection lost during a sale. You will need to disallow the sale to be triggered more than once.

We'll be fixing this on the example code.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community