API/Autodoc/Classes/URuStorePayClient.en.md


URuStorePayClient

The class implements the API for integrating payments into a mobile application.

#include <URuStorePayClient.h>

Inherits from UObject, RuStoreSDK::RuStoreListenerContainer

Public Functions

Name
bool GetIsInitialized()
Checks whether the manager is initialized.
bool Init()
Initializes the URuStorePayClient singleton.
void Dispose()
Deinitializes the singleton if no further work with the object is planned.
void ConditionalBeginDestroy()
long GetUserAuthorizationStatus(TFunction< void(long, EURuStorePayUserAuthorizationStatus)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Checks the user authorization status.
long GetPurchaseAvailability(TFunction< void(long, TSharedPtr< FURuStorePayPurchaseAvailabilityResult, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Checks payment availability. If all conditions are met, FURuStorePayPurchaseAvailabilityResult::isAvailable returns == true. Otherwise, FURuStorePayPurchaseAvailabilityResult::isAvailable returns == false.
long GetProducts(TArray< URuStorePayProductId * > & productIds, TFunction< void(long, TSharedPtr< TArray< FURuStorePayProduct >, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieves the list of products added to your application through the RuStore console.
long GetPurchases(TFunction< void(long, TSharedPtr< TArray< FURuStorePayPurchase >, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieves the list of user purchases.
long GetPurchases(bool bUseProductType, bool bUsePurchaseStatusFilter, bool bUseAcknowledgementState, EURuStorePayProductType productType, EURuStorePayPurchaseStatusFilter purchaseStatusFilter, EURuStorePayAcknowledgementState acknowledgementState, TFunction< void(long, TSharedPtr< TArray< FURuStorePayPurchase >, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieves the list of user purchases.
long GetBillingSubscriptions(TFunction< void(long, TSharedPtr< TArray< FURuStorePayPurchase >, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieves the list of subscriptions purchased in the SDK Billing Client.
long GetPurchase(URuStorePayPurchaseId * purchaseId, TFunction< void(long, TSharedPtr< FURuStorePayPurchase, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Retrieves information about a purchase.
long Purchase(FURuStorePayProductPurchaseParams & productPurchaseParams, EURuStorePayPreferredPurchaseType preferredPurchaseType, EURuStorePaySdkTheme sdkTheme, TFunction< void(long, TSharedPtr< FURuStorePayProductPurchaseResult, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure, TSharedPtr< RuStoreSDK::Pay::PurchaseEventListenerImpl, ESPMode::ThreadSafe > purchaseEventListener =nullptr)
Purchases a product.
long PurchaseTwoStep(FURuStorePayProductPurchaseParams & productPurchaseParams, EURuStorePaySdkTheme sdkTheme, TFunction< void(long, TSharedPtr< FURuStorePayProductPurchaseResult, ESPMode::ThreadSafe >)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure, TSharedPtr< RuStoreSDK::Pay::PurchaseEventListenerImpl, ESPMode::ThreadSafe > purchaseEventListener =nullptr)
Purchases a product with two-step payment.
long ConfirmTwoStepPurchase(URuStorePayPurchaseId * purchaseId, URuStorePayDeveloperPayload * developerPayload, TFunction< void(long)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Consumes (confirms) a purchase. After the confirmation call, the purchase transitions to the CONFIRMED status. A consume (confirm) purchase request must be accompanied by the delivery of the item.
long CancelTwoStepPurchase(URuStorePayPurchaseId * purchaseId, TFunction< void(long)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Cancels a purchase. A consume (confirm) purchase request must be accompanied by the delivery of the item.
long UpdateAcknowledgementState(URuStorePayPurchaseId * purchaseId, EURuStorePayAcknowledgementState state, URuStorePayDeveloperPayload * developerPayload, TFunction< void(long, EURuStorePayAcknowledgementState)> onSuccess, TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure)
Updates the purchase confirmation state.
bool IsRuStoreInstalled()
Checks whether RuStore is installed on the user’s device.
URuStorePayClient * Instance()
Gets the URuStorePayClient instance.
URuStorePayProductId * MakeProductId(FString productId)
Creates a product identifier object.
TArray< URuStorePayProductId * > MakeProductIdArray(TArray< FString > productIds)
Creates an array of product identifier objects.
URuStorePayQuantity * MakeQuantity(int value =1)
Creates an object representing the quantity of a product.
URuStorePayOrderId * MakeOrderId(FString value)
Creates an object with a unique payment identifier.
URuStorePayDeveloperPayload * MakeDeveloperPayload(FString value)
Creates a developer payload object.
URuStorePayAppUserId * MakeAppUserId(FString value)
Creates an object for the user’s internal ID in the application.
URuStorePayAppUserEmail * MakeAppUserEmail(FString value)
Creates an object for the user’s email address.
FURuStorePayProductPurchaseParams MakeProductPurchaseParams(URuStorePayProductId * productId, URuStorePayAppUserEmail * appUserEmail =nullptr, URuStorePayAppUserId * appUserId =nullptr, URuStorePayDeveloperPayload * developerPayload =nullptr, URuStorePayOrderId * orderId =nullptr, URuStorePayQuantity * quantity =nullptr)
Creates a product purchase parameters structure.

Public Attributes

Name
const FString PluginVersion — Plugin version.

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()

Checks whether the manager is initialized.

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

function Init

bool Init()

Initializes the URuStorePayClient singleton.

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

function Dispose

void Dispose()

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

function ConditionalBeginDestroy

void ConditionalBeginDestroy()

function GetUserAuthorizationStatus

long GetUserAuthorizationStatus(
    TFunction< void(long, EURuStorePayUserAuthorizationStatus)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Checks the user authorization status.

Parameters:

  • onSuccess Action performed on successful completion of the operation. Returns a requestId of type long and a EURuStorePayUserAuthorizationStatus value with information about the user authorization status.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.

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

function GetPurchaseAvailability

long GetPurchaseAvailability(
    TFunction< void(long, TSharedPtr< FURuStorePayPurchaseAvailabilityResult, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Checks payment availability. If all conditions are met, FURuStorePayPurchaseAvailabilityResult::isAvailable returns == true. Otherwise, FURuStorePayPurchaseAvailabilityResult::isAvailable returns == false.

Parameters:

  • onSuccess Action performed on successful completion of the operation. Returns a requestId of type long and a FURuStorePayPurchaseAvailabilityResult object with payment availability information.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.

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

function GetProducts

long GetProducts(
    TArray< URuStorePayProductId * > & productIds,
    TFunction< void(long, TSharedPtr< TArray< FURuStorePayProduct >, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieves the list of products added to your application through the RuStore console.

Parameters:

  • productIds List of product identifiers (set when creating the product in the developer console). The list of products is limited to 1000 items.
  • onSuccess Action performed on successful completion of the operation. Returns a requestId of type long and a list of FURuStorePayProduct objects with product information.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information. Return: Returns a requestId unique within a single application launch.

function GetPurchases

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

Retrieves the list of user purchases.

Parameters:

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

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

function GetPurchases

long GetPurchases(
    bool bUseProductType,
    bool bUsePurchaseStatusFilter,
    bool bUseAcknowledgementState,
    EURuStorePayProductType productType,
    EURuStorePayPurchaseStatusFilter purchaseStatusFilter,
    EURuStorePayAcknowledgementState acknowledgementState,
    TFunction< void(long, TSharedPtr< TArray< FURuStorePayPurchase >, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieves the list of user purchases.

Parameters:

  • bUseProductType Use filtering by product type.
  • bUsePurchaseStatusFilter Use filtering by purchase status.
  • bUseAcknowledgementState Use filtering by purchase acknowledgment state.
  • productType Optional filtering by product type (consumable or non-consumable products).
  • purchaseStatusFilter Optional filtering by purchase status. The PAID and CONFIRMED statuses are supported for purchases, and ACTIVE and PAUSED for subscriptions.
  • acknowledgementState Optional filtering by purchase acknowledgment state. The PENDING, ACKNOWLEDGED, and UNKNOWN states are supported.
  • onSuccess Action performed upon successful completion of the operation. Returns a requestId of type long and a list of FURuStorePayPurchase objects with information about purchases.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.

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

function GetBillingSubscriptions

long GetBillingSubscriptions(
    TFunction< void(long, TSharedPtr< TArray< FURuStorePayPurchase >, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieves the list of subscriptions created in the Billing Client SDK.

Parameters:

  • onSuccess Action performed upon successful completion of the operation. Returns a requestId of type long and a list of FURuStorePayPurchase objects with information about subscriptions.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.

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

function GetPurchase

long GetPurchase(
    URuStorePayPurchaseId * purchaseId,
    TFunction< void(long, TSharedPtr< FURuStorePayPurchase, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Retrieves purchase information.

Parameters:

  • purchaseId The product identifier assigned to the product in the RuStore Console.
  • onSuccess Action performed upon successful completion of the operation. Returns a requestId of type long and an object of type FURuStorePayPurchase with information about the purchase.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.

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

function Purchase

long Purchase(
    FURuStorePayProductPurchaseParams & productPurchaseParams,
    EURuStorePayPreferredPurchaseType preferredPurchaseType,
    EURuStorePaySdkTheme sdkTheme,
    TFunction< void(long, TSharedPtr< FURuStorePayProductPurchaseResult, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure,
    TSharedPtr< RuStoreSDK::Pay::PurchaseEventListenerImpl, ESPMode::ThreadSafe > purchaseEventListener =nullptr
)

Purchases a product.

Parameters:

  • productPurchaseParams Product purchase parameters.
  • preferredPurchaseType Preferred purchase type.
  • sdkTheme Color theme of the payment sheet.
  • onSuccess Action performed upon successful completion of the operation. Returns a requestId of type long and an object implementing the FURuStorePayProductPurchaseResult interface with information about the purchase result.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.
  • purchaseEventListener A set of callback functions that allow receiving data about invoiceId and purchaseId at different purchase stages — optional.

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

function PurchaseTwoStep

long PurchaseTwoStep(
    FURuStorePayProductPurchaseParams & productPurchaseParams,
    EURuStorePaySdkTheme sdkTheme,
    TFunction< void(long, TSharedPtr< FURuStorePayProductPurchaseResult, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure,
    TSharedPtr< RuStoreSDK::Pay::PurchaseEventListenerImpl, ESPMode::ThreadSafe > purchaseEventListener =nullptr
)

Purchases a product with two-stage payment.

Parameters:

  • productPurchaseParams Product purchase parameters.
  • sdkTheme Color theme of the payment sheet.
  • onSuccess Action performed upon successful completion of the operation. Returns a requestId of type long and an object implementing the FURuStorePayProductPurchaseResult interface with information about the purchase result.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.
  • purchaseEventListener A set of callback functions that allow receiving data about invoiceId and purchaseId at different purchase stages — optional.

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

function ConfirmTwoStepPurchase

long ConfirmTwoStepPurchase(
    URuStorePayPurchaseId * purchaseId,
    URuStorePayDeveloperPayload * developerPayload,
    TFunction< void(long)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Consumes (confirms) a purchase. After the confirmation call, the purchase will transition to the CONFIRMED status. The consumption (confirmation) request must be accompanied by the delivery of the product.

Parameters:

  • purchaseId Purchase identifier.
  • developerPayload A string containing additional order information (optional parameter).
  • onSuccess Action performed upon successful completion of the operation.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.

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

function CancelTwoStepPurchase

long CancelTwoStepPurchase(
    URuStorePayPurchaseId * purchaseId,
    TFunction< void(long)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Cancels a purchase. The consumption (confirmation) request must be accompanied by the delivery of the product.

Parameters:

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

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

function UpdateAcknowledgementState

long UpdateAcknowledgementState(
    URuStorePayPurchaseId * purchaseId,
    EURuStorePayAcknowledgementState state,
    URuStorePayDeveloperPayload * developerPayload,
    TFunction< void(long, EURuStorePayAcknowledgementState)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Updates the purchase acknowledgment state.

Parameters:

  • purchaseId Purchase identifier.
  • state New purchase acknowledgment state.
  • developerPayload A string containing additional order information (optional parameter).
  • onSuccess Action performed upon successful completion of the operation. Returns a requestId of type long and an EURuStorePayAcknowledgementState value with the new purchase acknowledgment state.
  • onFailure Action performed in case of an error. Returns a requestId of type long and an object of type FURuStoreError with error information.

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

function IsRuStoreInstalled

bool IsRuStoreInstalled()

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

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

function Instance

static URuStorePayClient * Instance()

Gets an instance of URuStorePayClient.

Return: Returns a pointer to the single instance of URuStorePayClient (Singleton pattern implementation). If the instance does not exist yet, it creates it.

function MakeProductId

static URuStorePayProductId * MakeProductId(
    FString productId
)

Creates a product identifier object.

Parameters:

  • productId A string containing the identifier.

Return: An object of type URuStorePayProductId.

function MakeProductIdArray

static TArray< URuStorePayProductId * > MakeProductIdArray(
    TArray< FString > productIds
)

Creates an array of product identifier objects.

Parameters:

  • productIds An array of strings representing product identifiers.

Return: An array of pointers to objects of type URuStorePayProductId.

function MakeQuantity

static URuStorePayQuantity * MakeQuantity(
    int value =1
)

Creates an object representing the quantity of a product.

Parameters:

  • value Integer value representing the product quantity. Defaults to 1.

Return: An object of type URuStorePayQuantity.

function MakeOrderId

static URuStorePayOrderId * MakeOrderId(
    FString value
)

Creates a unique payment identifier object.

Parameters:

  • value A string containing the identifier.

Return: An object of type URuStorePayOrderId.

function MakeDeveloperPayload

static URuStorePayDeveloperPayload * MakeDeveloperPayload(
    FString value
)

Creates a developer payload object.

Parameters:

  • value A string containing additional order information.

Return: An object of type URuStorePayDeveloperPayload.

function MakeAppUserId

static URuStorePayAppUserId * MakeAppUserId(
    FString value
)

Creates an object for the user’s internal ID in the application.

Parameters:

  • value A string representing the identifier.

Return: An object of type URuStorePayAppUserId.

function MakeAppUserEmail

static URuStorePayAppUserEmail * MakeAppUserEmail(
    FString value
)

Creates an object for the user’s email address.

Parameters:

  • value A string representing an email address.

Return: An object of type URuStorePayAppUserEmail.

function MakeProductPurchaseParams

static FURuStorePayProductPurchaseParams MakeProductPurchaseParams(
    URuStorePayProductId * productId,
    URuStorePayAppUserEmail * appUserEmail =nullptr,
    URuStorePayAppUserId * appUserId =nullptr,
    URuStorePayDeveloperPayload * developerPayload =nullptr,
    URuStorePayOrderId * orderId =nullptr,
    URuStorePayQuantity * quantity =nullptr
)

Creates a structure of product purchase parameters.

Parameters:

  • productId The product identifier specified when creating the product in the developer console.
  • appUserEmail User’s email address — optional.
  • appUserId User’s internal ID in the application — optional.
  • developerPayload A developer-specified string containing additional order information — optional.
  • orderId Unique payment identifier specified by the developer or generated automatically (uuid) — optional.
  • quantity Product quantity — optional.

Return: An object of type FURuStorePayProductPurchaseParams with purchase parameter information.

variable PluginVersion

static const FString PluginVersion = "11.1.0";

Plugin version.


Назад