API/Autodoc/Files/URuStorePayClient.h.en.md


Classes

Name
class URuStorePayClient — Class that implements the API for integrating payments into a mobile application.

Source code

// Copyright Epic Games, Inc. All Rights Reserved.

#include "URuStorePayClient.generated.h"

UCLASS(Blueprintable)
class RUSTOREPAY_API URuStorePayClient : public UObject, public RuStoreSDK::RuStoreListenerContainer
{
    GENERATED_BODY()

private:
    static URuStorePayClient* _instance;
    static bool _bIsInstanceInitialized;

    bool bIsInitialized = false;
    bool _bAllowNativeErrorHandling = false;
    RuStoreSDK::AndroidJavaObject* _clientWrapper = nullptr;

public:
    static const FString PluginVersion;

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    bool GetIsInitialized();

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static URuStorePayClient* Instance();

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    bool Init();

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    void Dispose();

    void ConditionalBeginDestroy();

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

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

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

    long GetPurchase(URuStorePayPurchaseId* purchaseId, TFunction<void(long, TSharedPtr<FURuStorePayPurchase, ESPMode::ThreadSafe>)> onSuccess, TFunction<void(long, TSharedPtr<FURuStoreError, ESPMode::ThreadSafe>)> onFailure);
    
    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);
    
    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);
    
    long ConfirmTwoStepPurchase(URuStorePayPurchaseId* purchaseId, URuStorePayDeveloperPayload* developerPayload, TFunction<void(long)> onSuccess, TFunction<void(long, TSharedPtr<FURuStoreError, ESPMode::ThreadSafe>)> onFailure);
    
    long CancelTwoStepPurchase(URuStorePayPurchaseId* purchaseId, TFunction<void(long)> onSuccess, TFunction<void(long, TSharedPtr<FURuStoreError, ESPMode::ThreadSafe>)> onFailure);

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

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    bool IsRuStoreInstalled();

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static URuStorePayProductId* MakeProductId(FString productId);

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static TArray<URuStorePayProductId*> MakeProductIdArray(TArray<FString> productIds);

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static URuStorePayQuantity* MakeQuantity(int value = 1);

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static URuStorePayOrderId* MakeOrderId(FString value);

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static URuStorePayDeveloperPayload* MakeDeveloperPayload(FString value);

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static URuStorePayAppUserId* MakeAppUserId(FString value);

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client")
    static URuStorePayAppUserEmail* MakeAppUserEmail(FString value);

    UFUNCTION(BlueprintCallable, Category = "RuStore Pay Client", meta = (AdvancedDisplay=1))
    static FURuStorePayProductPurchaseParams MakeProductPurchaseParams(
        URuStorePayProductId* productId,
        URuStorePayAppUserEmail* appUserEmail = nullptr,
        URuStorePayAppUserId* appUserId = nullptr,
        URuStorePayDeveloperPayload* developerPayload = nullptr,
        URuStorePayOrderId* orderId = nullptr,
        URuStorePayQuantity* quantity = nullptr
    );
};
Назад