Kits SDK para Unity / Hacer un seguimiento del estado del pedido
  Volver a Documentos

Kits SDK para Unity

Hacer un seguimiento del estado del pedido

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, you need to track the order status using the OrderTracking.Instance.AddOrderForTracking SDK method. Pass the following parameters to the method:

This method encapsulates several methods for tracking the order status. The mechanism differs depending on the platform for which the application is built:

  • For WebGL builds, tracking is based on the postMessage events of the payment interface widget. If the Pay Station widget sends a message that the order status changed to done or cancel, tracking stops.
  • For builds for other platforms, tracking uses simple HTTP requests (short-polling) and WebSocket requests. Tracking is performed according to the following algorithm:
    1. A web socket connection is established.
    2. If the order status does not change to done or cancel within 5 minutes, the web socket connection is closed. If the order status changes to done or cancel, tracking stops.
    3. Order status tracking continues with short-polling. A simple HTTP order status request is sent once every 3 seconds. Tracking stops if:
      • order status changes to done or cancel
      • the order status does not done or cancel within 10 minutes
Nota
If a web socket connection fails, the order status is tracked using short-polling.

You can also implement:

  • requesting the order status and order contents using the CheckOrderStatus SDK method
  • webhook handling on the server side of your application for Xsolla transaction events

¿Te ha resultado útil este artículo?
¡Gracias!
¿Hay algo en lo que podamos mejorar? Mensaje
Lo sentimos
Por favor, cuéntanos por qué no te ha resultado útil este artículo. Mensaje
¡Gracias por tu mensaje!
Nos ayudará a mejorar tu experiencia.
Valore esta página
Valore esta página
¿Hay algo en lo que podamos mejorar?

Prefiero no responder

¡Gracias por tu mensaje!

Enlaces útiles

Última actualización: 10 de Octubre de 2023

¿Has encontrado una errata u otro error de texto? Selecciona el texto y pulsa Ctrl+Intro.

Informar de un problema
Nos esforzamos por ofrecer contenido de calidad. Tus comentarios nos ayudan a mejorar.
Déjanos tu correo electrónico para que te podamos responder
¡Gracias por tu mensaje!