SDKs code references for Unity
Easily embed Xsolla services with this ready-to-use libraries for Unity applications and games
Xsolla.Orders.XsollaOrders Class Reference

Static Public Member Functions

static void OpenPurchaseUI (string paymentToken, bool forcePlatformBrowser=false, Action< BrowserCloseInfo > onBrowserClosed=null)
 Opens Pay Station in the browser with a retrieved Pay Station token. More...
 
static void CheckOrderStatus (int orderId, Action< OrderStatus > onSuccess, Action< Error > onError, SdkType sdkType=SdkType.Store)
 Returns status of the specified order. More...
 
static void CreatePaymentToken (float amount, string currency, string description, Action< PaymentToken > onSuccess, Action< Error > onError, string locale=null, string externalID=null, int? paymentMethod=null, object customParameters=null)
 Creates a new payment token. More...
 
static void CreatePaymentToken (float amount, string currency, PaymentTokenItem[] items, Action< PaymentToken > onSuccess, Action< Error > onError, string locale=null, string externalID=null, int? paymentMethod=null, object customParameters=null)
 Creates a new payment token. More...
 
static void GetUnprocessedEvents (Action< Events > onSuccess, Action< Error > onError)
 Get unprocessed events for user. NOTE: Enable the Xsolla Event API before using this method. For setup instructions, see the documentation. More...
 
static void MarkEventAsProcessed (int eventId, Action onSuccess, Action< Error > onError)
 Mark event as processed. NOTE: Enable the Xsolla Event API before using this method. For setup instructions, see the documentation. More...
 

Member Function Documentation

◆ CheckOrderStatus()

static void Xsolla.Orders.XsollaOrders.CheckOrderStatus ( int  orderId,
Action< OrderStatus onSuccess,
Action< Error onError,
SdkType  sdkType = SdkType.Store 
)
inlinestatic

Returns status of the specified order.

More about the use cases.

Parameters
orderIdUnique order identifier.
onSuccessCalled after server response.
onErrorCalled after the request resulted with an error.
See also
XsollaCatalog.CreateOrderByVirtualCurrency
Parameters
sdkTypeSDK type. Used for internal analytics.

◆ CreatePaymentToken() [1/2]

static void Xsolla.Orders.XsollaOrders.CreatePaymentToken ( float  amount,
string  currency,
PaymentTokenItem[]  items,
Action< PaymentToken onSuccess,
Action< Error onError,
string  locale = null,
string  externalID = null,
int?  paymentMethod = null,
object  customParameters = null 
)
inlinestatic

Creates a new payment token.

Parameters
amountThe total amount to be paid by the user.
currencyDefault purchase currency (USD by default). Three-letter currency code per ISO 4217. Check the documentation for detailed information about currencies supported by Xsolla.
itemsUsed to describe a purchase if it includes a list of specific items.
onSuccessCalled after the successful item purchase.
onErrorCalled after the request resulted with an error.
localeInterface language. Two-letter lowercase language code. Leave empty to use the default value.
externalIDTransaction's external ID.
paymentMethodPayment method ID.
customParametersYour custom parameters represented as a valid JSON set of key-value pairs.

◆ CreatePaymentToken() [2/2]

static void Xsolla.Orders.XsollaOrders.CreatePaymentToken ( float  amount,
string  currency,
string  description,
Action< PaymentToken onSuccess,
Action< Error onError,
string  locale = null,
string  externalID = null,
int?  paymentMethod = null,
object  customParameters = null 
)
inlinestatic

Creates a new payment token.

Parameters
amountThe total amount to be paid by the user.
currencyDefault purchase currency (USD by default). Three-letter currency code per ISO 4217. Check the documentation for detailed information about currencies supported by Xsolla.
descriptionPurchase description. Used to describe the purchase if there are no specific items.
onSuccessCalled after the successful item purchase.
onErrorCalled after the request resulted with an error.
localeInterface language. Two-letter lowercase language code. Leave empty to use the default value.
externalIDTransaction's external ID.
paymentMethodPayment method ID.
customParametersYour custom parameters represented as a valid JSON set of key-value pairs.

◆ GetUnprocessedEvents()

static void Xsolla.Orders.XsollaOrders.GetUnprocessedEvents ( Action< Events onSuccess,
Action< Error onError 
)
inlinestatic

Get unprocessed events for user. NOTE: Enable the Xsolla Event API before using this method. For setup instructions, see the documentation.

Parameters
onSuccessCalled after receiving data successfully.
onErrorCalled after the request resulted with an error.

◆ MarkEventAsProcessed()

static void Xsolla.Orders.XsollaOrders.MarkEventAsProcessed ( int  eventId,
Action  onSuccess,
Action< Error onError 
)
inlinestatic

Mark event as processed. NOTE: Enable the Xsolla Event API before using this method. For setup instructions, see the documentation.

Parameters
eventIdEvent ID to mark as processed.
onSuccessCalled after the event was successfully marked as processed.
onErrorCalled after the request resulted with an error.

◆ OpenPurchaseUI()

static void Xsolla.Orders.XsollaOrders.OpenPurchaseUI ( string  paymentToken,
bool  forcePlatformBrowser = false,
Action< BrowserCloseInfo onBrowserClosed = null 
)
inlinestatic

Opens Pay Station in the browser with a retrieved Pay Station token.

More about the use cases:

  • Cart purchase
  • Purchase in one click
  • Ordering free items
    Parameters
    paymentTokenPay Station token for the purchase.
    forcePlatformBrowserWhether to force platform browser usage ignoring plug-in settings.
    onBrowserClosedCalled after the browser was closed.
    See also
    XsollaWebBrowser

The documentation for this class was generated from the following file: