Track order status
After a user makes a purchase, your application can perform the following actions:
- show the order status in the application UI
- credit a user’s balance after a successful payment
- grant the purchased items after a successful payment
To implement the logic of these actions, track the order status using the
OrderTracker.checkPendingOrder SDK method. Pass the following parameters to the method:
accessToken— user authorization token
orderId— order ID received from the purchase via the shopping cart, one-click purchase, or purchase for virtual currency
onSuccess— callback in case the order transitions to the
onError— callback in case Xsolla server returns an error
This method encapsulates several methods for tracking the order status. Tracking is performed according to the following algorithm:
- A web socket connection is established.
- If the order status hasn’t changed to
cancelwithin 5 minutes, the web socket connection is re-established. If the order status is changed to
cancel, tracking stops.
- order status changed to
- the order status does not change to
cancelwithin 10 minutes
You can also implement:
- requesting the order status and order contents using the
- webhook handling on the server side of your application for Xsolla transaction events
Was this article helpful?
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.