Skip to main content
added 575 characters in body
Source Link
Orbit Lens
  • 6.9k
  • 1
  • 14
  • 27

Not 100% sure about Java SDK, but JavaScript SDK allows to specify "now" as a cursor to be notified of payments happening starting from when this script runs.

Edit:

Looks like the method mentioned above doesn't work with Java SDK. The alternative approach requires two calls instead of one, but it was battle-tested and guaranteed to work.

Prepare request builder for transactions, set limit to 1 and execute it. Once you get the response, you have a paging_token for the first transaction in a list that can be specified as a cursor in streaming mode. If the first request returns zero rows, it means that there were no transactions on this account and you can safely omit a cursor in a streaming request call.

Not 100% sure about Java SDK, but JavaScript SDK allows to specify "now" as a cursor to be notified of payments happening starting from when this script runs.

Not 100% sure about Java SDK, but JavaScript SDK allows to specify "now" as a cursor to be notified of payments happening starting from when this script runs.

Edit:

Looks like the method mentioned above doesn't work with Java SDK. The alternative approach requires two calls instead of one, but it was battle-tested and guaranteed to work.

Prepare request builder for transactions, set limit to 1 and execute it. Once you get the response, you have a paging_token for the first transaction in a list that can be specified as a cursor in streaming mode. If the first request returns zero rows, it means that there were no transactions on this account and you can safely omit a cursor in a streaming request call.

Source Link
Orbit Lens
  • 6.9k
  • 1
  • 14
  • 27

Not 100% sure about Java SDK, but JavaScript SDK allows to specify "now" as a cursor to be notified of payments happening starting from when this script runs.