question

ondrej avatar image
ondrej asked Jeffrey Blattman commented

Order does not sync - a way to detect that ?

Hi,

during the custom tender processing called from the Register app we are creating a regular payment but also a payment using web API. Sometimes, when the processing returns to the payments screen the local order state do not get synchronized with the server status (the web payment does not show). The order was paid in full, but the button 'Add another payment' is visible. There should not be any problem with internet connection. Sometimes the sync is only late by 2-3 seconds - this is OK. But sometimes even after waiting for as long as 30s does not resolve the problem.

Is there any way to detect that there is a problem with the sync? That way we could maybe display a notification that the payment was successful and that a sync is in process.

Thank you, Ondrej

10 |2000

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

Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman commented

It's a problem if your app relies on sync for proper operation. It's best effort only. Depending on network conditions, it could be delayed indefinitely. Without knowing more about why your app requires this it's hard to suggest an alternative.

If a change is made on the web, the client knows nothing until it receives a push message that a sync is required. There's no way to know that until you know it, so to speak.

1 comment
10 |2000

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

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

You could use OrderConnector to add a listener and wait for an order update, then look for your 2nd payment on the order. I want to stress that this is not the right thing to do. Again, there's no guarantee when or even if the push message will arrive. You will end up delaying merchants from completing the payment flow which will make them not use your tender. It's not clear why you need to add a second payment. Without knowing the details this idea sounds suspect in general. I believe merchants will find it confusing to see a second payment on the order.

0 Likes 0 ·
ondrej avatar image
ondrej answered

Hi @jeff ,

we are making 2 payments in the custom tender processing. Since this is not supported to do locally (in one tender call), we need to create the 2nd payment using the web API. When our custom processing finishes, normally the web payment appears between payments almost immediately.

Is there a way that we 'listen' to the push message while the custom tender activity is still active?

Thanks, Ondrej

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