API/Autodoc/Classes/URuStoreBillingClient.en.md


URuStoreBillingClient

Class implements API for integrating payments into a mobile application.

#include <URuStoreBillingClient.h>

Inherits from UObject, RuStoreSDK::RuStoreListenerContainer

Public Functions

Name
bool GetIsInitialized()
Check initialization of the billing client.
bool Init(FURuStoreBillingClientConfig config)
Initializes the singleton URuStoreBillingClient. Initialization parameters are set by an object of type FURuStoreBillingClientConfig.
void Dispose()
Deinitializes the singleton if further work with the object is no longer planned.
void ConditionalBeginDestroy()
URuStorePaymentResultClass * ConvertPaymentResult(TSharedPtr< FURuStorePaymentResult, ESPMode::ThreadSafe > value)
long CheckPurchasesAvailability(TFunction< void(long, TSharedPtr< FURuStorePurchaseAvailabilityResult, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Check payment availability. If all conditions are met, FURuStorePurchaseAvailabilityResult::isAvailable == true is returned. Otherwise, FURuStorePurchaseAvailabilityResult::isAvailable == false is returned.
long GetAuthorizationStatus(TFunction< void(long, TSharedPtr< FURuStoreUserAuthorizationStatus, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Check the user’s authorization status.
long GetProducts(TArray< FString > & productIds, TFunction< void(long, TSharedPtr< FURuStoreProductsResponse, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieve a list of products added to your application via the RuStore console.
long GetPurchases(TFunction< void(long, TSharedPtr< FURuStorePurchasesResponse, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieve a list of user purchases.
long PurchaseProduct(FString productId, FString orderId, int quantity, FString developerPayload, TFunction< void(long, TSharedPtr< FURuStorePaymentResult, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Purchase a product.
long ConfirmPurchase(FString purchaseId, TFunction< void(long)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Consumption (confirmation) of purchase. The request for consumption (confirmation) of purchase must be accompanied by delivery of the item.
long DeletePurchase(FString purchaseId, TFunction< void(long)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Cancel purchase.
long GetPurchaseInfo(FString purchaseId, TFunction< void(long, TSharedPtr< FURuStorePurchase, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieve purchase information.
void SetTheme(EURuStoreTheme theme)
SDK supports dynamic theme switching. Set the interface theme.
EURuStoreTheme GetTheme()
SDK supports dynamic theme switching. Get the current interface theme.
bool IsRuStoreInstalled()
Check if RuStore is installed on the user’s device.
void CheckPurchasesAvailability(int64 & requestId)
void GetProducts(TArray< FString > productIds, int64 & requestId)
void GetPurchases(int64 & requestId)
void PurchaseProduct(FString productId, FString orderId, int quantity, FString developerPayload, int64 & requestId)
void ConfirmPurchase(FString purchaseId, int64 & requestId)
void DeletePurchase(FString purchaseId, int64 & requestId)
void GetPurchaseInfo(FString purchaseId, int64 & requestId)
URuStoreBillingClient * Instance()
Get the instance of URuStoreBillingClient.

Public Attributes

Name
const FString PluginVersion — Plugin version.
FRuStoreCheckPurchasesAvailabilityErrorDelegate OnCheckPurchasesAvailabilityError
FRuStoreCheckPurchasesAvailabilityResponseDelegate OnCheckPurchasesAvailabilityResponse
FRuStoreGetProductsErrorDelegate OnGetProductsError
FRuStoreGetProductsResponseDelegate OnGetProductsResponse
FRuStoreGetPurchasesErrorDelegate OnGetPurchasesError
FRuStoreGetPurchasesResponseDelegate OnGetPurchasesResponse
FRuStorePurchaseProductErrorDelegate OnPurchaseProductError
FRuStoreUPurchaseProductResponseDelegate OnPurchaseProductResponse
FRuStoreConfirmPurchaseErrorDelegate OnConfirmPurchaseError
FRuStoreConfirmPurchaseResponseDelegate OnConfirmPurchaseResponse
FRuStoreDeletePurchaseErrorDelegate OnDeletePurchaseError
FRuStoreDeletePurchaseResponseDelegate OnDeletePurchaseResponse
FRuStoreGetPurchaseInfoErrorDelegate OnPurchaseInfoError
FRuStoreGetPurchaseInfoResponseDelegate OnPurchaseInfoResponse

Additional inherited members

Public Functions inherited from RuStoreSDK::RuStoreListenerContainer

Name
TSharedPtr< RuStoreListener, ESPMode::ThreadSafe > ListenerBind(RuStoreListener * item)
void ListenerUnbind(long id)
void ListenerUnbind(RuStoreListener * item)
void ListenerUnbind(TSharedPtr< RuStoreListener, ESPMode::ThreadSafe > item)
void ListenerRemoveAll()

function GetIsInitialized

bool GetIsInitialized()

Check initialization of the billing client.

Return: Returns true if the singleton is initialized, otherwise false.

function Init

bool Init(
    FURuStoreBillingClientConfig config
)

Initializes the singleton URuStoreBillingClient. Initialization parameters are set by an object of type FURuStoreBillingClientConfig.

Parameters:

Return: Returns true if initialization was successful, otherwise false.

function Dispose

void Dispose()

Deinitializes the singleton if further work with the object is no longer planned.

function ConditionalBeginDestroy

void ConditionalBeginDestroy()

function ConvertPaymentResult

URuStorePaymentResultClass * ConvertPaymentResult(
    TSharedPtr< FURuStorePaymentResult, ESPMode::ThreadSafe > value
)

function CheckPurchasesAvailability

long CheckPurchasesAvailability(
    TFunction< void(long, TSharedPtr< FURuStorePurchaseAvailabilityResult, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Check payment availability. If all conditions are met, FURuStorePurchaseAvailabilityResult::isAvailable == true is returned. Otherwise, FURuStorePurchaseAvailabilityResult::isAvailable == false is returned.

Parameters:

  • onSuccess Action performed upon successful operation completion. Returns requestId of type long and an object FURuStorePurchaseAvailabilityResult with information about payment availability.
  • onFailure Action performed in case of an error. Returns requestId of type long and an object of type FURuStoreError with error information.

Return: Returns a requestId that is unique within a single application launch.

function GetAuthorizationStatus

long GetAuthorizationStatus(
    TFunction< void(long, TSharedPtr< FURuStoreUserAuthorizationStatus, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Check the user’s authorization status.

Parameters:

  • onSuccess Action performed upon successful operation completion. Returns requestId of type long and an object FURuStoreUserAuthorizationStatus with information about the authorization status.
  • onFailure Action performed in case of an error. Returns requestId of type long and an object of type FURuStoreError with error information.

Return: Returns a requestId that is unique within a single application launch.

function GetProducts

long GetProducts(
    TArray< FString > & productIds,
    TFunction< void(long, TSharedPtr< FURuStoreProductsResponse, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieve a list of products added to your application via the RuStore console.

Parameters:

  • productIds List of product identifiers (set when creating the product in the developer console). The product list has a limit of 1000 elements.
  • onSuccess Action performed upon successful operation completion. Returns requestId of type long and an object FURuStoreProductsResponse with information about the products.
  • onFailure Action performed in case of an error. Returns requestId of type long and an object of type FURuStoreError with error information.

Return: Returns a requestId that is unique within a single application launch.

function GetPurchases

long GetPurchases(
    TFunction< void(long, TSharedPtr< FURuStorePurchasesResponse, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieve a list of user purchases.

Parameters:

  • onSuccess Action performed upon successful operation completion. Returns requestId of type long and an object of type FURuStorePurchasesResponse with information about the purchases.
  • onFailure Action performed in case of an error. Returns requestId of type long and an object FURuStoreError with error information.

Return: Returns a requestId that is unique within a single application launch.

function PurchaseProduct

long PurchaseProduct(
    FString productId,
    FString orderId,
    int quantity,
    FString developerPayload,
    TFunction< void(long, TSharedPtr< FURuStorePaymentResult, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

function ConfirmPurchase

long ConfirmPurchase(
    FString purchaseId,
    TFunction< void(long)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Consumption (confirmation) of purchase. The request for consumption (confirmation) of purchase must be accompanied by delivery of the item.

Parameters:

  • purchaseId Purchase identifier.
  • onSuccess Delegate called after successful consumption (confirmation) of the purchase.
  • onFailure Delegate called in case of an error.

Return: requestId.

function DeletePurchase

long DeletePurchase(
    FString purchaseId,
    TFunction< void(long)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Cancel purchase.

Parameters:

  • purchaseId Purchase identifier.
  • onSuccess Delegate called after successful cancellation of the purchase.
  • onFailure Delegate called in case of an error.

Return: requestId.

function GetPurchaseInfo

long GetPurchaseInfo(
    FString purchaseId,
    TFunction< void(long, TSharedPtr< FURuStorePurchase, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieve purchase information.

Parameters:

  • purchaseId Purchase identifier.
  • onSuccess Delegate called upon successful retrieval of information.
  • onFailure Delegate called in case of an error.

Return: requestId.

function SetTheme

void SetTheme(
    EURuStoreTheme theme
)

SDK supports dynamic theme switching. Set the interface theme.

function GetTheme

EURuStoreTheme GetTheme()

SDK supports dynamic theme switching. Get the current interface theme.

function IsRuStoreInstalled

bool IsRuStoreInstalled()

Check if RuStore is installed on the user’s device.

function CheckPurchasesAvailability

void CheckPurchasesAvailability(
    int64 & requestId
)

function GetProducts

void GetProducts(
    TArray< FString > productIds,
    int64 & requestId
)

function GetPurchases

void GetPurchases(
    int64 & requestId
)

function PurchaseProduct

void PurchaseProduct(
    FString productId,
    FString orderId,
    int quantity,
    FString developerPayload,
    int64 & requestId
)

function ConfirmPurchase

void ConfirmPurchase(
    FString purchaseId,
    int64 & requestId
)

function DeletePurchase

void DeletePurchase(
    FString purchaseId,
    int64 & requestId
)

function GetPurchaseInfo

void GetPurchaseInfo(
    FString purchaseId,
    int64 & requestId
)

function Instance

URuStoreBillingClient * Instance()

Get the instance of URuStoreBillingClient. Product Purchase.

Parameters:

  • productId The product identifier assigned to the product in the RuStore Console (required parameter).
  • orderId A unique payment identifier generated by the application (optional parameter). If you specify this parameter in your system, you will receive it in the response when working with the API. If you do not specify it, it will be automatically generated (uuid). Maximum length is 150 characters.
  • quantity Product quantity (1 or more).
  • developerPayload A string with additional order information that you can set when initializing the purchase process.
  • onSuccess An action performed upon successful completion of the operation. Returns a requestId of type long and an FURuStorePaymentResult object with information about the purchase result.
  • onFailure An action performed in case of an error. Returns a requestId of type long and an FURuStoreError object with information about the error.

Return: Returns a requestId unique within a single application launch.

function ConfirmPurchase

long ConfirmPurchase(
    FString purchaseId,
    TFunction< void(long)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Purchase consumption (confirmation). The request for purchase consumption (confirmation) must be accompanied by the issuance of the item.

Parameters:

  • purchaseId Purchase identifier.
  • onSuccess An action performed upon successful completion of the operation. Returns a requestId of type long.
  • onFailure An action performed in case of an error. Returns a requestId of type long and an FURuStoreError object with information about the error.

Return: Returns a requestId unique within a single application launch.

function DeletePurchase

long DeletePurchase(
    FString purchaseId,
    TFunction< void(long)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Cancellation of a purchase.

Parameters:

  • purchaseId Purchase identifier.
  • onSuccess An action performed upon successful completion of the operation. Returns a requestId of type long.
  • onFailure An action performed in case of an error. Returns an FURuStoreError object with information about the error.

Return: Returns a requestId unique within a single application launch.

function GetPurchaseInfo

long GetPurchaseInfo(
    FString purchaseId,
    TFunction< void(long, TSharedPtr< FURuStorePurchase, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieving purchase information.

Parameters:

  • purchaseId Purchase identifier.
  • onSuccess An action performed upon successful completion of the operation. Returns a requestId of type long and an FURuStorePurchase object with purchase information.
  • onFailure An action performed in case of an error. Returns an FURuStoreError object with information about the error.

Return: Returns a requestId unique within a single application launch.

function SetTheme

void SetTheme(
    EURuStoreTheme theme
)

The SDK supports dynamic theme switching. Sets the UI theme.

Parameters:

  • theme The new theme specified by a value from the EURuStoreTheme enumeration.

function GetTheme

EURuStoreTheme GetTheme()

The SDK supports dynamic theme switching. Gets the current UI theme.

Return: The current theme specified by a value from the EURuStoreTheme enumeration.

function IsRuStoreInstalled

bool IsRuStoreInstalled()

Checks if RuStore is installed on the user’s device.

Return: Returns true if RuStore is installed, otherwise false.

function CheckPurchasesAvailability

void CheckPurchasesAvailability(
    int64 & requestId
)

function GetProducts

void GetProducts(
    TArray< FString > productIds,
    int64 & requestId
)

function GetPurchases

void GetPurchases(
    int64 & requestId
)

function PurchaseProduct

void PurchaseProduct(
    FString productId,
    FString orderId,
    int quantity,
    FString developerPayload,
    int64 & requestId
)

function ConfirmPurchase

void ConfirmPurchase(
    FString purchaseId,
    int64 & requestId
)

function DeletePurchase

void DeletePurchase(
    FString purchaseId,
    int64 & requestId
)

function GetPurchaseInfo

void GetPurchaseInfo(
    FString purchaseId,
    int64 & requestId
)

function Instance

static URuStoreBillingClient * Instance()

Gets the instance of URuStoreBillingClient.

Return: Returns a pointer to the single instance of URuStoreBillingClient (implementation of the Singleton pattern). If the instance has not been created yet, it creates it.

variable PluginVersion

static const FString PluginVersion = "10.5.0";

Plugin version.

variable OnCheckPurchasesAvailabilityError

FRuStoreCheckPurchasesAvailabilityErrorDelegate OnCheckPurchasesAvailabilityError;

variable OnCheckPurchasesAvailabilityResponse

FRuStoreCheckPurchasesAvailabilityResponseDelegate OnCheckPurchasesAvailabilityResponse;

variable OnGetProductsError

FRuStoreGetProductsErrorDelegate OnGetProductsError;

variable OnGetProductsResponse

FRuStoreGetProductsResponseDelegate OnGetProductsResponse;

variable OnGetPurchasesError

FRuStoreGetPurchasesErrorDelegate OnGetPurchasesError;

variable OnGetPurchasesResponse

FRuStoreGetPurchasesResponseDelegate OnGetPurchasesResponse;

variable OnPurchaseProductError

FRuStorePurchaseProductErrorDelegate OnPurchaseProductError;

variable OnPurchaseProductResponse

FRuStoreUPurchaseProductResponseDelegate OnPurchaseProductResponse;

variable OnConfirmPurchaseError

FRuStoreConfirmPurchaseErrorDelegate OnConfirmPurchaseError;

variable OnConfirmPurchaseResponse

FRuStoreConfirmPurchaseResponseDelegate OnConfirmPurchaseResponse;

variable OnDeletePurchaseError

FRuStoreDeletePurchaseErrorDelegate OnDeletePurchaseError;

variable OnDeletePurchaseResponse

FRuStoreDeletePurchaseResponseDelegate OnDeletePurchaseResponse;

variable OnPurchaseInfoError

FRuStoreGetPurchaseInfoErrorDelegate OnPurchaseInfoError;

variable OnPurchaseInfoResponse

FRuStoreGetPurchaseInfoResponseDelegate OnPurchaseInfoResponse;

Назад