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
31const FString& GetAccessToken() const;
32
33private:
34FOnOrderCheckSuccess OnSuccess;
35
36FOnOrderCheckError OnError;
37
38FString AccessToken;
39
40int32 OrderId;
41
42int32 ShortPollingLifeTime;
43
44FTimerHandle ShortPollingTimerHandle;
45
46bool bShortPollingExpired = false;
47
48void OnConnectionError();
49
50void OnOrderStatusUpdated(const FOrderStatusData Data);
51
52void OnClosed();
53
54void OnShortPollingExpired();
55
56void StartCentrifugoTracking();
57
58void StopCentrifugoTracking();
59
60void ActivateShortPolling();
61
62void ShortPollingCheckOrder();
63
64void CheckOrder_HttpRequestComplete(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse,
65const bool bSucceeded, FOnOrderCheck SuccessCallback, FOnOrderCheckError ErrorCallback);
66};
Definition: XsollaOrderCheckObject.h:21
Definition: XsollaStoreDataModel.h:41