SDK for / Overview

UXsollaInventorySubsystem Class Reference

Inheritance diagram for UXsollaInventorySubsystem:

Public Member Functions

virtual void Initialize (FSubsystemCollectionBase &Collection) override
 
virtual void Deinitialize () override
 
void Initialize (const FString &InProjectId)
 
void GetInventory (const FString &AuthToken, const EXsollaPublishingPlatform Platform, const FOnInventoryUpdate &SuccessCallback, const FOnError &ErrorCallback, const int Limit=50, const int Offset=0)
 
void GetVirtualCurrencyBalance (const FString &AuthToken, const EXsollaPublishingPlatform Platform, const FOnCurrencyBalanceUpdate &SuccessCallback, const FOnError &ErrorCallback)
 
void GetTimeLimitedItems (const FString &AuthToken, const EXsollaPublishingPlatform Platform, const FOnTimeLimitedItemsUpdate &SuccessCallback, const FOnError &ErrorCallback)
 
void ConsumeInventoryItem (const FString &AuthToken, const FString &ItemSKU, const int32 Quantity, const FString &InstanceID, const EXsollaPublishingPlatform Platform, const FOnInventoryRequestSuccess &SuccessCallback, const FOnError &ErrorCallback)
 
void GetCouponRewards (const FString &AuthToken, const FString &CouponCode, const FOnCouponRewardsUpdate &SuccessCallback, const FOnError &ErrorCallback)
 
void RedeemCoupon (const FString &AuthToken, const FString &CouponCode, const FOnCouponRedeemUpdate &SuccessCallback, const FOnError &ErrorCallback)
 

Protected Member Functions

void GetInventory_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnInventoryUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
 
void GetVirtualCurrencyBalance_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnCurrencyBalanceUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
 
void GetTimeLimitedItems_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnTimeLimitedItemsUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
 
void ConsumeInventoryItem_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnInventoryRequestSuccess SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
 
void UpdateCouponRewards_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnCouponRewardsUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
 
void RedeemCoupon_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnCouponRedeemUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
 

Protected Attributes

FString ProjectID
 

Member Function Documentation

◆ ConsumeInventoryItem()

void UXsollaInventorySubsystem::ConsumeInventoryItem (const FString & AuthToken,
const FString & ItemSKU,
const int32 Quantity,
const FString & InstanceID,
const EXsollaPublishingPlatform Platform,
const FOnInventoryRequestSuccess & SuccessCallback,
const FOnError & ErrorCallback 
)

Consumes an inventory item. Use for only for consumable virtual items. More about the use cases.

Parameters
AuthTokenUser authorization token obtained during authorization using Xsolla Login (more about authorization options).
ItemSKUDesired item SKU.
QuantityItem quantity. If the item is uncountable, should be zero.
InstanceIDInstance item ID. If the item is countable, should be empty.
PlatformPublishing platform the user plays on.
Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.
SuccessCallbackCalled after successful inventory item consumption.
ErrorCallbackCalled after the request resulted with an error.

◆ GetCouponRewards()

void UXsollaInventorySubsystem::GetCouponRewards (const FString & AuthToken,
const FString & CouponCode,
const FOnCouponRewardsUpdate & SuccessCallback,
const FOnError & ErrorCallback 
)

Returns a list of items that can be credited to the user when the coupon is redeemed. Can be used to let users choose one of many items as a bonus. The usual case is choosing a DRM if the coupon contains a game as a bonus. More about the use cases.

Parameters
AuthTokenUser authorization token obtained during authorization using Xsolla Login (more about authorization options).
CouponCodeUnique case sensitive code. Contains letters and numbers.
SuccessCallbackCalled after receiving coupon rewards successfully.
ErrorCallbackCalled after the request resulted with an error.

◆ GetInventory()

void UXsollaInventorySubsystem::GetInventory (const FString & AuthToken,
const EXsollaPublishingPlatform Platform,
const FOnInventoryUpdate & SuccessCallback,
const FOnError & ErrorCallback,
const int Limit = 50,
const int Offset = 0 
)

Returns a list of virtual items from the user’s inventory according to pagination settings. For each virtual item, complete data is returned. More about the use cases.

Parameters
AuthTokenUser authorization token obtained during authorization using Xsolla Login (more about authorization options).
PlatformPublishing platform the user plays on.
Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.
SuccessCallbackCalled after purchased virtual items were successfully received.
ErrorCallbackCalled after the request resulted with an error.
LimitLimit for the number of elements on the page. The maximum number of elements on a page is 50.
OffsetNumber of the element from which the list is generated (the count starts from 0).

◆ GetTimeLimitedItems()

void UXsollaInventorySubsystem::GetTimeLimitedItems (const FString & AuthToken,
const EXsollaPublishingPlatform Platform,
const FOnTimeLimitedItemsUpdate & SuccessCallback,
const FOnError & ErrorCallback 
)

Returns a list of time-limited items from the user’s inventory. For each item, complete data is returned. More about the use cases.

Parameters
AuthTokenUser authorization token obtained during authorization using Xsolla Login (more about authorization options).
PlatformPublishing platform the user plays on.
Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.
SuccessCallbackCalled after list of user time limited items was successfully received.
ErrorCallbackCalled after the request resulted with an error.

◆ GetVirtualCurrencyBalance()

void UXsollaInventorySubsystem::GetVirtualCurrencyBalance (const FString & AuthToken,
const EXsollaPublishingPlatform Platform,
const FOnCurrencyBalanceUpdate & SuccessCallback,
const FOnError & ErrorCallback 
)

Returns the current user’s balance of virtual currency. For each virtual currency, complete data is returned. More about the use cases.

Parameters
AuthTokenUser authorization token obtained during authorization using Xsolla Login (more about authorization options).
PlatformPublishing platform the user plays on.
Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.
SuccessCallbackCalled after virtual currency balance was successfully received.
ErrorCallbackCalled after the request resulted with an error.

◆ Initialize()

void UXsollaInventorySubsystem::Initialize (const FString & InProjectId)

Initialize the controller with provided Project ID (use to override project settings)

Parameters
InProjectIdNew Project ID value from Publisher Account. It can be found in Publisher Account next to the name of your project.

◆ RedeemCoupon()

void UXsollaInventorySubsystem::RedeemCoupon (const FString & AuthToken,
const FString & CouponCode,
const FOnCouponRedeemUpdate & SuccessCallback,
const FOnError & ErrorCallback 
)

Redeems the coupon code and delivers a reward to the user in one of the following ways:

  • to their inventory (virtual items, virtual currency packages, or bundles)
  • via email (game keys)
  • to the entitlement system (game keys)
    More about the use cases.
Parameters
AuthTokenUser authorization token obtained during authorization using Xsolla Login (more about authorization options).
CouponCodeUnique case sensitive code. Contains letters and numbers.
SuccessCallbackCalled after successful coupon redemption.
ErrorCallbackCalled after the request resulted with an error.

Member Data Documentation

◆ ProjectID

FString UXsollaInventorySubsystem::ProjectID
protected

Cached Xsolla Store project id


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