question

devendra avatar image
devendra asked justina Deactivated answered

How can we wait for sale response in our customized class from where we are sending the Sale() request?

I am sending Sale() request from class A, and want to process the sale response which I am getting in onSaleResponse method of listener class further in same class A ( designed as per our framework).

My question is how can I wait in class A until get any response in our listener class and that is being processed? As all the methods in Clover connector and default listener is void so I can not get any return type also.

I cannot use cloverConnector.wait(60000); to wait for 60 seconds as if we get response in 30 seconds then I want to do further process from class A after 30 seconds only.
Please let me know if anything else is required from my side.



Clover MiniSaleTaxes
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.

devendra avatar image devendra commented ·

jut for FYI, I am using remote-pay-java-connector-1.4.0.jar for web socket communication.

0 Likes 0 ·

1 Answer

justina avatar image
justina Deactivated answered

Hello @Devendra,

You can compare your implementation to this example that takes you through the processing of a sale transaction:

https://github.com/clover/remote-pay-java/blob/master/clover-connector-java-examples/src/main/java/com/clover/remote/examples/SaleRequestExample.java

Please let me know if you have any more questions.

Thanks,

Justin

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