SDK for / Overview

XsollaOrderCheckObject.h

1// Copyright 2024 Xsolla Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "XsollaStoreDataModel.h"
7#include "Engine/EngineTypes.h"
8#include "Engine/World.h"
9#include "TimerManager.h"
10#include "XsollaUtilsHttpRequestHelper.h"
11#include "XsollaOrderCheckObject.generated.h"
12
13struct FOrderStatusData;
14
15DECLARE_DELEGATE_OneParam(FOnOrderCheckSuccess, int32);
16DECLARE_DELEGATE_ThreeParams(FOnOrderCheckError, int32, int32, const FString&);
17DECLARE_DELEGATE_ThreeParams(FOnOrderCheck, int32, EXsollaOrderStatus, FXsollaOrderContent);
18
19UCLASS(BlueprintType)
20class UXsollaOrderCheckObject : public UObject
21{
22GENERATED_BODY()
23
24public:
25void Init(const FString& InAccessToken, const int32 InOrderId, bool bShouldStartWithCentrifugo,
26const FOnOrderCheckSuccess& InOnSuccess, const FOnOrderCheckError& InOnError, int32 InShortPollingLifeTime = 600);
27
28UFUNCTION(BlueprintCallable, Category = "Xsolla|Store|OrderCheck")
29void Destroy();
30
31private:
32FOnOrderCheckSuccess OnSuccess;
33
34FOnOrderCheckError OnError;
35
36FString AccessToken;
37
38int32 OrderId;
39
40int32 ShortPollingLifeTime;
41
42FTimerHandle ShortPollingTimerHandle;
43
44bool bShortPollingExpired = false;
45
46void OnConnectionError();
47
48void OnOrderStatusUpdated(const FOrderStatusData Data);
49
50void OnClosed();
51
52void OnShortPollingExpired();
53
54void StartCentrifugoTracking();
55
56void StopCentrifugoTracking();
57
58void ActivateShortPolling();
59
60void ShortPollingCheckOrder();
61
62void CheckOrder_HttpRequestComplete(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse,
63const bool bSucceeded, FOnOrderCheck SuccessCallback, FOnOrderCheckError ErrorCallback);
64};
Definition: XsollaOrderCheckObject.h:21
Definition: XsollaStoreDataModel.h:41