LootLocker Unreal SDK 10.7.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerPurchasesRequestHandler.h
Go to the documentation of this file.
1// Copyright (c) 2021 LootLocker
2
3#pragma once
4
5
6#include "CoreMinimal.h"
9#include "TimerManager.h"
10#include "Kismet/BlueprintAsyncActionBase.h"
11#include "LootLockerSDK/Private/Utils/LootLockerUtilities.h"
12#include "LootLockerPurchasesRequestHandler.generated.h"
13
14USTRUCT(BlueprintType)
16{
17 GENERATED_BODY()
18 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
19 int time_left = 0;
20};
21
25USTRUCT(BlueprintType, Category = "LootLocker")
27{
28 GENERATED_BODY()
32 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
33 FString Catalog_listing_id = "";
37 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
38 int Quantity = 0;
39};
40
44USTRUCT(BlueprintType, Category = "LootLocker")
46{
47 GENERATED_BODY()
51 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
52 FString Wallet_id = "";
56 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
58};
59
63USTRUCT(BlueprintType, Category = "LootLocker")
65{
66 GENERATED_BODY()
70 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
71 bool Sandboxed = false;
75 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
76 FString Transaction_id = "";
77};
78
82USTRUCT(BlueprintType, Category = "LootLocker")
84{
85 GENERATED_BODY()
89 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
90 int Class_id = 0;
91};
92
96USTRUCT(BlueprintType, Category = "LootLocker")
98{
99 GENERATED_BODY()
103 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
104 FString Product_id = "";
108 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
109 FString Purchase_token = "";
110};
111
115USTRUCT(BlueprintType, Category = "LootLocker")
117{
118 GENERATED_BODY()
122 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
123 int Class_id = 0;
124};
125
129USTRUCT(BlueprintType, Category = "LootLocker")
131{
132 GENERATED_BODY()
136 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
137 FString Account_id = "";
141 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
142 FString Bearer_token = "";
146 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
147 TArray<FString> Entitlement_ids;
151 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
152 FString Sandbox_id = "";
153};
154
158USTRUCT(BlueprintType, Category = "LootLocker")
160{
161 GENERATED_BODY()
165 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
166 FString Character_id = "";
167};
168
172USTRUCT(BlueprintType, Category = "LootLocker")
174{
175 GENERATED_BODY()
179 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
180 FString Service_ticket = "";
184 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
185 int Expires_in = 0;
189 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
190 FString Expires_at = "";
191};
192
196USTRUCT(BlueprintType, Category = "LootLocker")
198{
199 GENERATED_BODY()
203 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
208 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
209 FString Product_id = "";
210};
211
215USTRUCT(BlueprintType, Category = "LootLocker")
217{
218 GENERATED_BODY()
222 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
223 int Class_id = 0;
224};
225
228UENUM(BlueprintType, Category = "LootLocker")
244
245
249USTRUCT(BlueprintType, Category = "LootLocker")
251{
252 GENERATED_BODY()
256 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
257 FString Steam_id = "";
261 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
262 FString Currency = "";
266 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
267 FString Language = "";
271 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
272 FString Catalog_item_id = "";
273};
274
278USTRUCT(BlueprintType, Category = "LootLocker")
280{
281 GENERATED_BODY()
285 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
286 int Class_id = 0;
287};
288
292USTRUCT(BlueprintType, Category = "LootLocker")
294{
295 GENERATED_BODY()
299 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
300 bool isSuccess = false;
304 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
305 FString Entitlement_id = "";
306};
307
311USTRUCT(BlueprintType, Category = "LootLocker")
313{
314 GENERATED_BODY()
318 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
319 FString Entitlement_id = "";
320};
321
325USTRUCT(BlueprintType, Category = "LootLocker")
327{
328 GENERATED_BODY()
332 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
334};
335
339USTRUCT(BlueprintType, Category = "LootLocker")
341{
342 GENERATED_BODY()
346 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
347 FString Entitlement_id = "";
348};
349
352UENUM(BlueprintType, Category = "LootLocker")
357{
360};
361
362
365UENUM(BlueprintType, Category = "LootLocker")
374
375
378UENUM(BlueprintType, Category = "LootLocker")
389
390
391USTRUCT(BlueprintType)
393{
394 GENERATED_BODY()
396 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
397 TArray<FString> entitlement_ids;
398};
399
400USTRUCT(BlueprintType)
402{
403 GENERATED_BODY()
405 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
406 int64 asset_id = 0;
408 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
409 FString name;
411 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
413};
414
415USTRUCT(BlueprintType)
417{
418 GENERATED_BODY()
420 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
421 FString currency_id;
423 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
426 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
427 FString amount;
428};
429
430USTRUCT(BlueprintType)
432{
433 GENERATED_BODY()
435 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
438 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
439 FString id;
441 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
442 FString name;
444 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
445 FString amount;
446};
447
448USTRUCT(BlueprintType)
450{
451 GENERATED_BODY()
459 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
462 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
463 FString message;
465 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
467};
468
469USTRUCT(BlueprintType)
471{
472 GENERATED_BODY()
474 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
477 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
479};
480
481USTRUCT(BlueprintType)
483{
484 GENERATED_BODY()
486 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
489 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
492 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
498 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
500};
501
502//==================================================
503// Async Purchase Types
504//==================================================
505
508UENUM(BlueprintType, Category = "LootLocker")
513{
519};
520
521
525USTRUCT(BlueprintType, Category = "LootLocker")
527{
528 GENERATED_BODY()
532 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
533 FString Entitlement_id = "";
534};
535
539USTRUCT(BlueprintType, Category = "LootLocker")
541{
542 GENERATED_BODY()
546 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
547 FString Entitlement_id = "";
551 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
556 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
557 FString Error = "";
558};
559
562
566
568{
569 static constexpr int RetryLimit = 5;
570 FString EntitlementId = "";
571 FString WalletId = "";
572 TArray<FLootLockerCatalogItemAndQuantityPair> Items;
574 FDateTime TimeoutTime;
576 int Retries = 0;
577 bool ShouldCancel = false;
579
581 FLootLockerAsyncPurchaseProcess(float _PollingIntervalSeconds, float TimeoutAfterMinutes);
582};
583
592
596USTRUCT(BlueprintType, Category = "LootLocker")
598{
599 GENERATED_BODY()
603 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
604 FString Catalog_item_id = "";
605};
606
610USTRUCT(BlueprintType, Category = "LootLocker")
612{
613 GENERATED_BODY()
617 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
618 FString checkout_link = "";
622 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
623 FString entitlement_id = "";
624};
625
630
632UCLASS()
633class LOOTLOCKERSDK_API ULootLockerPurchasesRequestHandler : public UObject
634{
635 GENERATED_BODY()
636public:
638
639
640 static FString ActivateRentalAsset(const FLootLockerPlayerData& PlayerData, int AssetInstanceId, const FActivateRentalAssetResponseDelegate& OnCompletedRequest);
641
642 static FString PurchaseCatalogItems(const FLootLockerPlayerData& PlayerData, const FString& WalletID, const TArray<FLootLockerCatalogItemAndQuantityPair>& ItemsToPurchase, const FLootLockerDefaultDelegate& OnCompleted);
643
644 static FString RedeemAppleAppStorePurchaseForPlayer(const FLootLockerPlayerData& PlayerData, const FString& TransactionId, const bool Sandboxed = false, const FLootLockerDefaultDelegate& OnCompleted = FLootLockerDefaultDelegate());
645
646 static FString RedeemAppleAppStorePurchaseForClass(const FLootLockerPlayerData& PlayerData, const int ClassId, const FString& TransactionId, const bool Sandboxed = false, const FLootLockerDefaultDelegate& OnCompleted = FLootLockerDefaultDelegate());
647
648 static FString RedeemGooglePlayStorePurchaseForPlayer(const FLootLockerPlayerData& PlayerData, const FString& ProductId, const FString& PurchaseToken, const FLootLockerDefaultDelegate& OnCompleted);
649
650 static FString RedeemGooglePlayStorePurchaseForClass(const FLootLockerPlayerData& PlayerData, const int ClassId, const FString& ProductId, const FString& PurchaseToken, const FLootLockerDefaultDelegate& OnCompleted);
651
652 static FString RedeemEpicStorePurchase(const FLootLockerPlayerData& PlayerData, const FString& AccountId, const FString& BearerToken, const TArray<FString>& EntitlementIds, const FString& SandboxId, const FLootLockerDefaultDelegate& OnCompleted);
653
654 static FString RedeemEpicStorePurchaseForCharacter(const FLootLockerPlayerData& PlayerData, const FString& CharacterId, const FString& AccountId, const FString& BearerToken, const TArray<FString>& EntitlementIds, const FString& SandboxId, const FLootLockerDefaultDelegate& OnCompleted);
655
656 static FString GetXboxServiceTicket(const FLootLockerPlayerData& PlayerData, const FLootLockerXboxServiceTicketDelegate& OnCompleted);
657
658 static FString RedeemXboxStorePurchaseForPlayer(const FLootLockerPlayerData& PlayerData, const FString& UserCollectionsId, const FString& ProductId, const FLootLockerDefaultDelegate& OnCompleted);
659
660 static FString RedeemXboxStorePurchaseForClass(const FLootLockerPlayerData& PlayerData, const int ClassId, const FString& UserCollectionsId, const FString& ProductId, const FLootLockerDefaultDelegate& OnCompleted);
661
662 static FString RedeemPlayStationStorePurchaseForPlayer(const FLootLockerPlayerData& PlayerData, const FString& TransactionId, const FString& AuthCode, const FString& EntitlementLabel, const FString& ServiceLabel = "", const FString& ServiceName = "", const int Environment = -1, const int UseCount = -1, const FLootLockerDefaultDelegate& OnCompleted = FLootLockerDefaultDelegate());
663
664 static FString RedeemPlayStationStorePurchaseForCharacter(const FLootLockerPlayerData& PlayerData, const FString& CharacterId, const FString& TransactionId, const FString& AuthCode, const FString& EntitlementLabel, const FString& ServiceLabel = "", const FString& ServiceName = "", const int Environment = -1, const int UseCount = -1, const FLootLockerDefaultDelegate& OnCompleted = FLootLockerDefaultDelegate());
665
666 static FString BeginSteamPurchaseRedemption(const FLootLockerPlayerData& PlayerData, const FString& SteamId, const FString& Currency, const FString& Language, const FString& CatalogItemId, const FLootLockerBeginSteamPurchaseRedemptionDelegate& OnCompleted);
667
668 static FString BeginSteamPurchaseRedemptionForClass(const FLootLockerPlayerData& PlayerData, const int ClassId, const FString& SteamId, const FString& Currency, const FString& Language, const FString& CatalogItemId, const FLootLockerBeginSteamPurchaseRedemptionDelegate& OnCompleted);
669
670 static FString QuerySteamPurchaseRedemptionStatus(const FLootLockerPlayerData& PlayerData, const FString& EntitlementId, const FLootLockerQuerySteamPurchaseRedemptionStatusDelegate& OnCompleted);
671
672 static FString FinalizeSteamPurchaseRedemption(const FLootLockerPlayerData& PlayerData, const FString& EntitlementId, const FLootLockerDefaultDelegate& OnCompleted);
673
674 static FString RefundByEntitlementIds(const FLootLockerPlayerData& PlayerData, const TArray<FString>& EntitlementIds, const FLootLockerRefundByEntitlementIdsDelegate& OnCompleted);
675
676 static FString CreateStripeCheckoutSession(const FLootLockerPlayerData& PlayerData, const FString& CatalogItemId, const FLootLockerCreateStripeCheckoutSessionDelegate& OnCompleted);
677
678 static FString InitiateAsyncPurchase(const FLootLockerPlayerData& PlayerData, const FString& WalletId, const TArray<FLootLockerCatalogItemAndQuantityPair>& Items, const FLootLockerAsyncPurchaseInitiatedDelegate& OnCompleted);
679
680 static FString GetAsyncPurchaseStatus(const FLootLockerPlayerData& PlayerData, const FString& EntitlementId, const FLootLockerAsyncPurchaseStatusDelegate& OnCompleted);
681
682 static FString RetryAsyncPurchase(const FLootLockerPlayerData& PlayerData, const FString& EntitlementId, const FString& WalletId, const TArray<FLootLockerCatalogItemAndQuantityPair>& Items, const FLootLockerAsyncPurchaseInitiatedDelegate& OnCompleted);
683
684 static FString StartAsyncPurchasePolling(const FLootLockerPlayerData& PlayerData, const FString& WalletId, const TArray<FLootLockerCatalogItemAndQuantityPair>& Items, const FLootLockerAsyncPurchaseStatusDelegate& OnStatusUpdate, const FLootLockerAsyncPurchaseStatusDelegate& OnComplete, float PollingIntervalSeconds = 1.0f, float TimeoutAfterMinutes = 5.0f);
685
686 static void CancelAsyncPurchasePolling(const FString& ProcessID);
687
688 static FString ContinualAsyncPurchasePollAction(const FString& ProcessID, const FLootLockerAsyncPurchaseStatusDelegate& OnStatusUpdate, const FLootLockerAsyncPurchaseStatusDelegate& OnComplete);
689
690 static void KillAsyncPurchaseProcess(const FString& ProcessID);
691
692protected:
693 static FString GetAsyncPurchaseStatus(const FLootLockerPlayerData& PlayerData, const FString& EntitlementId, const LLAPI<FLootLockerAsyncPurchaseStatusResponse>::FResponseInspectorCallback& OnCompleted);
694 static void SetAsyncPurchaseTimer(FTimerHandle& TimerHandle, const FTimerDelegate& Delegate, float Time);
695 static void ClearAsyncPurchaseTimer(FTimerHandle& TimerHandle);
696
697private:
698 static TMap<FString, FLootLockerAsyncPurchaseProcess> AsyncPurchaseProcesses;
699};
700
701//==================================================
702// Async Blueprint Delegate Definitions
703//==================================================
704
708DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FLootLockerAsyncPurchasePollingMulticastDelegate, FString, ProcessID, FLootLockerAsyncPurchaseStatusResponse, Response);
709
710//==================================================
711// Async Blueprint Node Definitions
712//==================================================
713
714UCLASS()
715class ULootLockerAsyncPollAsyncPurchase : public UBlueprintAsyncActionBase
716{
717 GENERATED_BODY()
718public:
730 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", Category = "LootLocker Methods | Purchases", WorldContext = "WorldContextObject", AdvancedDisplay = "PollingIntervalSeconds,TimeoutAfterMinutes,ForPlayerWithUlid", PollingIntervalSeconds = 1.0f, TimeoutAfterMinutes = 5.0f, ForPlayerWithUlid = ""))
731 static LOOTLOCKERSDK_API ULootLockerAsyncPollAsyncPurchase* AsyncPollAsyncPurchase(UObject* WorldContextObject, FString ForPlayerWithUlid, FString WalletId, TArray<FLootLockerCatalogItemAndQuantityPair> Items, float PollingIntervalSeconds, float TimeoutAfterMinutes);
732
734 UPROPERTY(BlueprintAssignable)
735 FLootLockerAsyncPurchasePollingMulticastDelegate OnPending;
737 UPROPERTY(BlueprintAssignable)
738 FLootLockerAsyncPurchasePollingMulticastDelegate OnActive;
740 UPROPERTY(BlueprintAssignable)
741 FLootLockerAsyncPurchasePollingMulticastDelegate OnFailed;
743 UPROPERTY(BlueprintAssignable)
744 FLootLockerAsyncPurchasePollingMulticastDelegate OnTimedOut;
746 UPROPERTY(BlueprintAssignable)
747 FLootLockerAsyncPurchasePollingMulticastDelegate OnCancelled;
748
749 LOOTLOCKERSDK_API virtual void Activate() override;
750
751protected:
752 FString ForPlayerWithUlid = "";
753 FString ProcessID = "";
754 FString WalletId = "";
758};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FLootLockerAsyncPurchasePollingMulticastDelegate, FString, ProcessID, FLootLockerAsyncPurchaseStatusResponse, Response)
Multicast delegate for events triggered from the async purchase polling node.
void(* FLootLockerDefaultDelegate)(FLootLockerResponse)
Definition LootLockerResponse.h:38
Definition LootLockerPurchasesRequestHandler.h:716
TArray< FLootLockerCatalogItemAndQuantityPair > Items
Definition LootLockerPurchasesRequestHandler.h:755
FLootLockerAsyncPurchasePollingMulticastDelegate OnFailed
Triggered when the purchase has failed (status = Failed).
Definition LootLockerPurchasesRequestHandler.h:741
float PollingIntervalInSeconds
Definition LootLockerPurchasesRequestHandler.h:756
float TimeoutAfterMinutes
Definition LootLockerPurchasesRequestHandler.h:757
FLootLockerAsyncPurchasePollingMulticastDelegate OnTimedOut
Triggered if the process times out.
Definition LootLockerPurchasesRequestHandler.h:744
static ULootLockerAsyncPollAsyncPurchase * AsyncPollAsyncPurchase(UObject *WorldContextObject, FString ForPlayerWithUlid, FString WalletId, TArray< FLootLockerCatalogItemAndQuantityPair > Items, float PollingIntervalSeconds, float TimeoutAfterMinutes)
Initiate an async purchase and automatically poll until it reaches a terminal state.
FString WalletId
Definition LootLockerPurchasesRequestHandler.h:754
FLootLockerAsyncPurchasePollingMulticastDelegate OnCancelled
Triggered if the process was cancelled using CancelAsyncPurchasePolling.
Definition LootLockerPurchasesRequestHandler.h:747
FString ForPlayerWithUlid
Definition LootLockerPurchasesRequestHandler.h:752
FLootLockerAsyncPurchasePollingMulticastDelegate OnActive
Triggered when the purchase has completed successfully (status = Active).
Definition LootLockerPurchasesRequestHandler.h:738
FLootLockerAsyncPurchasePollingMulticastDelegate OnPending
Triggered on each poll while the purchase is still pending.
Definition LootLockerPurchasesRequestHandler.h:735
FString ProcessID
Definition LootLockerPurchasesRequestHandler.h:753
virtual void Activate() override
static void KillAsyncPurchaseProcess(const FString &ProcessID)
static FString RetryAsyncPurchase(const FLootLockerPlayerData &PlayerData, const FString &EntitlementId, const FString &WalletId, const TArray< FLootLockerCatalogItemAndQuantityPair > &Items, const FLootLockerAsyncPurchaseInitiatedDelegate &OnCompleted)
static FString RedeemPlayStationStorePurchaseForPlayer(const FLootLockerPlayerData &PlayerData, const FString &TransactionId, const FString &AuthCode, const FString &EntitlementLabel, const FString &ServiceLabel="", const FString &ServiceName="", const int Environment=-1, const int UseCount=-1, const FLootLockerDefaultDelegate &OnCompleted=FLootLockerDefaultDelegate())
static FString BeginSteamPurchaseRedemption(const FLootLockerPlayerData &PlayerData, const FString &SteamId, const FString &Currency, const FString &Language, const FString &CatalogItemId, const FLootLockerBeginSteamPurchaseRedemptionDelegate &OnCompleted)
static FString CreateStripeCheckoutSession(const FLootLockerPlayerData &PlayerData, const FString &CatalogItemId, const FLootLockerCreateStripeCheckoutSessionDelegate &OnCompleted)
static FString ActivateRentalAsset(const FLootLockerPlayerData &PlayerData, int AssetInstanceId, const FActivateRentalAssetResponseDelegate &OnCompletedRequest)
static FString RedeemPlayStationStorePurchaseForCharacter(const FLootLockerPlayerData &PlayerData, const FString &CharacterId, const FString &TransactionId, const FString &AuthCode, const FString &EntitlementLabel, const FString &ServiceLabel="", const FString &ServiceName="", const int Environment=-1, const int UseCount=-1, const FLootLockerDefaultDelegate &OnCompleted=FLootLockerDefaultDelegate())
static FString GetAsyncPurchaseStatus(const FLootLockerPlayerData &PlayerData, const FString &EntitlementId, const LLAPI< FLootLockerAsyncPurchaseStatusResponse >::FResponseInspectorCallback &OnCompleted)
static void SetAsyncPurchaseTimer(FTimerHandle &TimerHandle, const FTimerDelegate &Delegate, float Time)
static FString RedeemEpicStorePurchase(const FLootLockerPlayerData &PlayerData, const FString &AccountId, const FString &BearerToken, const TArray< FString > &EntitlementIds, const FString &SandboxId, const FLootLockerDefaultDelegate &OnCompleted)
static FString RedeemEpicStorePurchaseForCharacter(const FLootLockerPlayerData &PlayerData, const FString &CharacterId, const FString &AccountId, const FString &BearerToken, const TArray< FString > &EntitlementIds, const FString &SandboxId, const FLootLockerDefaultDelegate &OnCompleted)
static FString RedeemAppleAppStorePurchaseForClass(const FLootLockerPlayerData &PlayerData, const int ClassId, const FString &TransactionId, const bool Sandboxed=false, const FLootLockerDefaultDelegate &OnCompleted=FLootLockerDefaultDelegate())
static FString RedeemGooglePlayStorePurchaseForClass(const FLootLockerPlayerData &PlayerData, const int ClassId, const FString &ProductId, const FString &PurchaseToken, const FLootLockerDefaultDelegate &OnCompleted)
static FString RedeemGooglePlayStorePurchaseForPlayer(const FLootLockerPlayerData &PlayerData, const FString &ProductId, const FString &PurchaseToken, const FLootLockerDefaultDelegate &OnCompleted)
static FString RedeemXboxStorePurchaseForClass(const FLootLockerPlayerData &PlayerData, const int ClassId, const FString &UserCollectionsId, const FString &ProductId, const FLootLockerDefaultDelegate &OnCompleted)
ULootLockerPurchasesRequestHandler()
Definition LootLockerPurchasesRequestHandler.h:637
static void CancelAsyncPurchasePolling(const FString &ProcessID)
static void ClearAsyncPurchaseTimer(FTimerHandle &TimerHandle)
static FString StartAsyncPurchasePolling(const FLootLockerPlayerData &PlayerData, const FString &WalletId, const TArray< FLootLockerCatalogItemAndQuantityPair > &Items, const FLootLockerAsyncPurchaseStatusDelegate &OnStatusUpdate, const FLootLockerAsyncPurchaseStatusDelegate &OnComplete, float PollingIntervalSeconds=1.0f, float TimeoutAfterMinutes=5.0f)
static FString GetXboxServiceTicket(const FLootLockerPlayerData &PlayerData, const FLootLockerXboxServiceTicketDelegate &OnCompleted)
static FString InitiateAsyncPurchase(const FLootLockerPlayerData &PlayerData, const FString &WalletId, const TArray< FLootLockerCatalogItemAndQuantityPair > &Items, const FLootLockerAsyncPurchaseInitiatedDelegate &OnCompleted)
static FString RefundByEntitlementIds(const FLootLockerPlayerData &PlayerData, const TArray< FString > &EntitlementIds, const FLootLockerRefundByEntitlementIdsDelegate &OnCompleted)
static FString BeginSteamPurchaseRedemptionForClass(const FLootLockerPlayerData &PlayerData, const int ClassId, const FString &SteamId, const FString &Currency, const FString &Language, const FString &CatalogItemId, const FLootLockerBeginSteamPurchaseRedemptionDelegate &OnCompleted)
static FString QuerySteamPurchaseRedemptionStatus(const FLootLockerPlayerData &PlayerData, const FString &EntitlementId, const FLootLockerQuerySteamPurchaseRedemptionStatusDelegate &OnCompleted)
static FString RedeemXboxStorePurchaseForPlayer(const FLootLockerPlayerData &PlayerData, const FString &UserCollectionsId, const FString &ProductId, const FLootLockerDefaultDelegate &OnCompleted)
static FString GetAsyncPurchaseStatus(const FLootLockerPlayerData &PlayerData, const FString &EntitlementId, const FLootLockerAsyncPurchaseStatusDelegate &OnCompleted)
static FString ContinualAsyncPurchasePollAction(const FString &ProcessID, const FLootLockerAsyncPurchaseStatusDelegate &OnStatusUpdate, const FLootLockerAsyncPurchaseStatusDelegate &OnComplete)
static FString FinalizeSteamPurchaseRedemption(const FLootLockerPlayerData &PlayerData, const FString &EntitlementId, const FLootLockerDefaultDelegate &OnCompleted)
static FString RedeemAppleAppStorePurchaseForPlayer(const FLootLockerPlayerData &PlayerData, const FString &TransactionId, const bool Sandboxed=false, const FLootLockerDefaultDelegate &OnCompleted=FLootLockerDefaultDelegate())
static FString PurchaseCatalogItems(const FLootLockerPlayerData &PlayerData, const FString &WalletID, const TArray< FLootLockerCatalogItemAndQuantityPair > &ItemsToPurchase, const FLootLockerDefaultDelegate &OnCompleted)
@ Currency
Definition LootLockerCatalogRequestHandler.h:24
ELootLockerRefundInventoryEventAction
Possible actions for a player inventory event during a refund.
Definition LootLockerPurchasesRequestHandler.h:357
void(* FLootLockerRefundByEntitlementIdsDelegate)(FLootLockerRefundByEntitlementIdsResponse)
C++ response callback delegate; receives an FLootLockerRefundByEntitlementIdsResponse result.
Definition LootLockerPurchasesRequestHandler.h:591
ELootLockerRefundNonReversibleRewardKind
Possible kinds of non-reversible rewards in a refund warning.
Definition LootLockerPurchasesRequestHandler.h:370
void(* FLootLockerCreateStripeCheckoutSessionDelegate)(FLootLockerCreateStripeCheckoutSessionResponse)
C++ response callback delegate; receives an FLootLockerCreateStripeCheckoutSessionResponse result.
Definition LootLockerPurchasesRequestHandler.h:627
void(* FLootLockerXboxServiceTicketDelegate)(FLootLockerXboxServiceTicketResponse)
C++ response callback delegate; receives an FLootLockerXboxServiceTicketResponse result.
Definition LootLockerPurchasesRequestHandler.h:629
void(* FLootLockerQuerySteamPurchaseRedemptionStatusDelegate)(FLootLockerQuerySteamPurchaseRedemptionStatusResponse)
C++ response callback delegate; receives an FLootLockerQuerySteamPurchaseRedemptionStatusResponse res...
Definition LootLockerPurchasesRequestHandler.h:589
ELootLockerSteamPurchaseRedemptionStatus
Possible statuses a Steam Purchase can have.
Definition LootLockerPurchasesRequestHandler.h:233
void(* FLootLockerAsyncPurchaseStatusDelegate)(FLootLockerAsyncPurchaseStatusResponse)
C++ response callback delegate; receives an FLootLockerAsyncPurchaseStatusResponse result.
Definition LootLockerPurchasesRequestHandler.h:565
void(* FLootLockerAsyncPurchaseInitiatedDelegate)(FLootLockerAsyncPurchaseInitiatedResponse)
C++ response callback delegate; receives an FLootLockerAsyncPurchaseInitiatedResponse result.
Definition LootLockerPurchasesRequestHandler.h:563
ELootLockerRefundWarningDetailType
Possible warning types in a refund response.
Definition LootLockerPurchasesRequestHandler.h:383
ELootLockerAsyncPurchaseStatus
Possible statuses for an async purchase.
Definition LootLockerPurchasesRequestHandler.h:513
void(* FLootLockerBeginSteamPurchaseRedemptionDelegate)(FLootLockerBeginSteamPurchaseRedemptionResponse)
C++ response callback delegate; receives an FLootLockerBeginSteamPurchaseRedemptionResponse result.
Definition LootLockerPurchasesRequestHandler.h:587
void(* FActivateRentalAssetResponseDelegate)(FLootLockerActivateRentalAssetResponse)
C++ response callback delegate; receives an FLootLockerActivateRentalAssetResponse result.
Definition LootLockerPurchasesRequestHandler.h:585
@ removed
Definition LootLockerPurchasesRequestHandler.h:358
@ skipped
Definition LootLockerPurchasesRequestHandler.h:359
@ progression_reset
Definition LootLockerPurchasesRequestHandler.h:372
@ progression_points
Definition LootLockerPurchasesRequestHandler.h:371
@ RefundedSuspectedFraud
Definition LootLockerPurchasesRequestHandler.h:241
@ ChargedBack
Definition LootLockerPurchasesRequestHandler.h:240
@ Succeeded
Definition LootLockerPurchasesRequestHandler.h:236
@ Approved
Definition LootLockerPurchasesRequestHandler.h:235
@ Init
Definition LootLockerPurchasesRequestHandler.h:234
@ PartialRefund
Definition LootLockerPurchasesRequestHandler.h:239
@ RefundedFriendlyFraud
Definition LootLockerPurchasesRequestHandler.h:242
@ Refunded
Definition LootLockerPurchasesRequestHandler.h:238
@ Failed
Definition LootLockerPurchasesRequestHandler.h:237
@ refund_failed
Definition LootLockerPurchasesRequestHandler.h:387
@ insufficient_funds
Definition LootLockerPurchasesRequestHandler.h:385
@ non_reversible_rewards
Definition LootLockerPurchasesRequestHandler.h:384
@ already_refunded
Definition LootLockerPurchasesRequestHandler.h:386
@ Pending
Definition LootLockerPurchasesRequestHandler.h:514
@ Active
Definition LootLockerPurchasesRequestHandler.h:515
@ TimedOut
Definition LootLockerPurchasesRequestHandler.h:517
@ Cancelled
Definition LootLockerPurchasesRequestHandler.h:518
Definition LootLockerPurchasesRequestHandler.h:16
int time_left
Definition LootLockerPurchasesRequestHandler.h:19
Response from initiating an async purchase.
Definition LootLockerPurchasesRequestHandler.h:527
FString Entitlement_id
The id of the entitlement created for this purchase.
Definition LootLockerPurchasesRequestHandler.h:533
FString EntitlementId
Definition LootLockerPurchasesRequestHandler.h:570
FTimerHandle AsyncPurchaseProcessTimerHandle
Definition LootLockerPurchasesRequestHandler.h:578
TArray< FLootLockerCatalogItemAndQuantityPair > Items
Definition LootLockerPurchasesRequestHandler.h:572
FLootLockerAsyncPurchaseProcess(float _PollingIntervalSeconds, float TimeoutAfterMinutes)
bool ShouldCancel
Definition LootLockerPurchasesRequestHandler.h:577
static constexpr int RetryLimit
Definition LootLockerPurchasesRequestHandler.h:569
float PollingIntervalSeconds
Definition LootLockerPurchasesRequestHandler.h:575
FString WalletId
Definition LootLockerPurchasesRequestHandler.h:571
FLootLockerPlayerData PlayerData
Definition LootLockerPurchasesRequestHandler.h:573
int Retries
Definition LootLockerPurchasesRequestHandler.h:576
FDateTime TimeoutTime
Definition LootLockerPurchasesRequestHandler.h:574
Response from polling the status of an async purchase.
Definition LootLockerPurchasesRequestHandler.h:541
ELootLockerAsyncPurchaseStatus Status
The current status of the purchase.
Definition LootLockerPurchasesRequestHandler.h:552
FString Error
The failure reason.
Definition LootLockerPurchasesRequestHandler.h:557
FString Entitlement_id
The id of the entitlement this status refers to.
Definition LootLockerPurchasesRequestHandler.h:547
Request to begin the Steam purchase redemption process for a catalog item for a specific class,...
Definition LootLockerPurchasesRequestHandler.h:280
int Class_id
Id of the class to make the purchase for.
Definition LootLockerPurchasesRequestHandler.h:286
Request to begin the Steam purchase redemption process for a catalog item, specifying the Steam user ...
Definition LootLockerPurchasesRequestHandler.h:251
FString Currency
The currency to use for the purchase.
Definition LootLockerPurchasesRequestHandler.h:262
FString Language
The language to use for the purchase.
Definition LootLockerPurchasesRequestHandler.h:267
FString Catalog_item_id
The LootLocker Catalog Item Id for the item you wish to purchase.
Definition LootLockerPurchasesRequestHandler.h:272
FString Steam_id
Id of the Steam User that is making the purchase.
Definition LootLockerPurchasesRequestHandler.h:257
Response indicating whether the Steam purchase redemption process started successfully,...
Definition LootLockerPurchasesRequestHandler.h:294
bool isSuccess
Was the purchase redemption process started successfully.
Definition LootLockerPurchasesRequestHandler.h:300
FString Entitlement_id
The id of the entitlement this purchase relates to.
Definition LootLockerPurchasesRequestHandler.h:305
Pairs a catalog listing identifier with the quantity to purchase.
Definition LootLockerPurchasesRequestHandler.h:27
FString Catalog_listing_id
The unique listing id of the catalog item to purchase.
Definition LootLockerPurchasesRequestHandler.h:33
int Quantity
The quantity of the specified item to purchase.
Definition LootLockerPurchasesRequestHandler.h:38
Request to create a Stripe Checkout session for a catalog item.
Definition LootLockerPurchasesRequestHandler.h:598
FString Catalog_item_id
The ULID of the catalog item to purchase.
Definition LootLockerPurchasesRequestHandler.h:604
Response from creating a Stripe Checkout session.
Definition LootLockerPurchasesRequestHandler.h:612
FString checkout_link
The URL of the Stripe-hosted checkout page.
Definition LootLockerPurchasesRequestHandler.h:618
FString entitlement_id
The LootLocker entitlement id tied to this purchase.
Definition LootLockerPurchasesRequestHandler.h:623
Request to finalize a completed Steam purchase redemption by entitlement identifier.
Definition LootLockerPurchasesRequestHandler.h:341
FString Entitlement_id
The id of the entitlement to finalize the purchase for.
Definition LootLockerPurchasesRequestHandler.h:347
Definition LootLockerPlayerData.h:12
Request to purchase one or more catalog items from a specific wallet.
Definition LootLockerPurchasesRequestHandler.h:46
FString Wallet_id
The id of the wallet to be used for the purchase.
Definition LootLockerPurchasesRequestHandler.h:52
TArray< FLootLockerCatalogItemAndQuantityPair > Items
A list of items to purchase.
Definition LootLockerPurchasesRequestHandler.h:57
Request to query the current status of a Steam purchase redemption by entitlement identifier.
Definition LootLockerPurchasesRequestHandler.h:313
FString Entitlement_id
The id of the entitlement to check the status for.
Definition LootLockerPurchasesRequestHandler.h:319
Response containing the current redemption status of a Steam purchase.
Definition LootLockerPurchasesRequestHandler.h:327
ELootLockerSteamPurchaseRedemptionStatus Status
The status of the steam purchase.
Definition LootLockerPurchasesRequestHandler.h:333
Request to redeem an Apple App Store purchase for a specific class, extending the player request with...
Definition LootLockerPurchasesRequestHandler.h:84
int Class_id
The id of the class to redeem this transaction for.
Definition LootLockerPurchasesRequestHandler.h:90
Request to redeem an Apple App Store purchase for the current player using a transaction identifier,...
Definition LootLockerPurchasesRequestHandler.h:65
bool Sandboxed
Whether or not to use the app store sandbox for this redemption.
Definition LootLockerPurchasesRequestHandler.h:71
FString Transaction_id
The id of the transaction successfully made towards the Apple App Store.
Definition LootLockerPurchasesRequestHandler.h:76
Request to redeem one or more Epic Games Store entitlements for a specific character,...
Definition LootLockerPurchasesRequestHandler.h:160
FString Character_id
The ulid of the character to redeem this purchase for.
Definition LootLockerPurchasesRequestHandler.h:166
Request to redeem one or more Epic Games Store entitlements for the current player using an Epic acco...
Definition LootLockerPurchasesRequestHandler.h:131
FString Account_id
The epic account id of the account that this purchase was made for.
Definition LootLockerPurchasesRequestHandler.h:137
FString Bearer_token
This is the token from epic used to allow the LootLocker backend to verify ownership of the specified...
Definition LootLockerPurchasesRequestHandler.h:142
TArray< FString > Entitlement_ids
The ids of the purchased entitlements that you wish to redeem.
Definition LootLockerPurchasesRequestHandler.h:147
FString Sandbox_id
The Sandbox Id configured for the game making the purchase (this is the sandbox id from your epic onl...
Definition LootLockerPurchasesRequestHandler.h:152
Request to redeem a Google Play Store purchase for a specific class using a product identifier,...
Definition LootLockerPurchasesRequestHandler.h:117
int Class_id
The id of the class to redeem this purchase for.
Definition LootLockerPurchasesRequestHandler.h:123
Request to redeem a Google Play Store purchase for the current player using a product identifier and ...
Definition LootLockerPurchasesRequestHandler.h:98
FString Product_id
The id of the product that this redemption refers to.
Definition LootLockerPurchasesRequestHandler.h:104
FString Purchase_token
The token from the purchase successfully made towards the Google Play Store.
Definition LootLockerPurchasesRequestHandler.h:109
Request to redeem an Xbox Store purchase for a class.
Definition LootLockerPurchasesRequestHandler.h:217
int Class_id
The id of the class to redeem this purchase for.
Definition LootLockerPurchasesRequestHandler.h:223
Request to redeem an Xbox Store purchase for the current player.
Definition LootLockerPurchasesRequestHandler.h:198
FString User_collections_id
The Xbox user collections ID (JWT) that identifies the user making the purchase.
Definition LootLockerPurchasesRequestHandler.h:204
FString Product_id
The id of the Xbox Store product to redeem.
Definition LootLockerPurchasesRequestHandler.h:209
Definition LootLockerPurchasesRequestHandler.h:393
TArray< FString > entitlement_ids
The IDs of the entitlements to refund.
Definition LootLockerPurchasesRequestHandler.h:397
Definition LootLockerPurchasesRequestHandler.h:483
TArray< FLootLockerRefundCurrencyEntry > currency_refunded
Currency amounts credited back to the player's wallet (the purchase price being returned).
Definition LootLockerPurchasesRequestHandler.h:490
TArray< FLootLockerRefundWarning > warnings
Warnings encountered during refund processing, grouped by entitlement.
Definition LootLockerPurchasesRequestHandler.h:499
TArray< FLootLockerRefundCurrencyEntry > currency_clawback
Currency amounts debited from the player's wallet (currency rewards from the entitlement being reclai...
Definition LootLockerPurchasesRequestHandler.h:493
TArray< FLootLockerRefundPlayerInventoryEvent > player_inventory_events
Assets that were added or removed from the player's inventory as part of the refund.
Definition LootLockerPurchasesRequestHandler.h:487
Definition LootLockerPurchasesRequestHandler.h:417
FString currency_code
Short code identifying the currency (e.g.
Definition LootLockerPurchasesRequestHandler.h:424
FString currency_id
The ULID of the currency.
Definition LootLockerPurchasesRequestHandler.h:421
FString amount
The amount credited or debited, represented as a string to support arbitrary precision.
Definition LootLockerPurchasesRequestHandler.h:427
Definition LootLockerPurchasesRequestHandler.h:432
ELootLockerRefundNonReversibleRewardKind kind
"progression_points": points were added to a progression.
Definition LootLockerPurchasesRequestHandler.h:436
FString amount
The number of points granted that cannot be reversed.
Definition LootLockerPurchasesRequestHandler.h:445
FString name
Display name of the progression.
Definition LootLockerPurchasesRequestHandler.h:442
Definition LootLockerPurchasesRequestHandler.h:402
int64 asset_id
The legacy numeric asset ID.
Definition LootLockerPurchasesRequestHandler.h:406
FString name
Display name of the asset.
Definition LootLockerPurchasesRequestHandler.h:409
ELootLockerRefundInventoryEventAction action
"removed" if the asset was taken back from inventory, "skipped" if it could not be removed
Definition LootLockerPurchasesRequestHandler.h:412
Definition LootLockerPurchasesRequestHandler.h:450
TArray< FLootLockerRefundNonReversibleReward > rewards
The specific rewards that could not be reversed.
Definition LootLockerPurchasesRequestHandler.h:466
ELootLockerRefundWarningDetailType type
The warning category: non_reversible_rewards: rewards granted that cannot be automatically clawed bac...
Definition LootLockerPurchasesRequestHandler.h:460
FString message
Human-readable explanation of the warning.
Definition LootLockerPurchasesRequestHandler.h:463
Definition LootLockerPurchasesRequestHandler.h:471
FString entitlement_id
The entitlement this warning applies to.
Definition LootLockerPurchasesRequestHandler.h:475
TArray< FLootLockerRefundWarningDetail > details
One or more warning conditions for this entitlement.
Definition LootLockerPurchasesRequestHandler.h:478
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19
Response from a request to get an Xbox service ticket.
Definition LootLockerPurchasesRequestHandler.h:174
int Expires_in
How many seconds until the ticket expires.
Definition LootLockerPurchasesRequestHandler.h:185
FString Service_ticket
The service ticket to use for Xbox store purchase redemption.
Definition LootLockerPurchasesRequestHandler.h:180
FString Expires_at
The date and time when the ticket expires.
Definition LootLockerPurchasesRequestHandler.h:190