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"
18 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
25USTRUCT(BlueprintType, Category = "LootLocker")
32 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
33 FString Catalog_listing_id = "";
37 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
44USTRUCT(BlueprintType, Category = "LootLocker")
51 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
52 FString Wallet_id = "";
56 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
63USTRUCT(BlueprintType, Category = "LootLocker")
70 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
71 bool Sandboxed = false;
75 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
76 FString Transaction_id = "";
82USTRUCT(BlueprintType, Category = "LootLocker")
89 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
96USTRUCT(BlueprintType, Category = "LootLocker")
103 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
104 FString Product_id = "";
108 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
109 FString Purchase_token = "";
115USTRUCT(BlueprintType, Category = "LootLocker")
122 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
129USTRUCT(BlueprintType, Category = "LootLocker")
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 = "";
158USTRUCT(BlueprintType, Category = "LootLocker")
165 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
166 FString Character_id = "";
172USTRUCT(BlueprintType, Category = "LootLocker")
179 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
180 FString Service_ticket = "";
184 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
189 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
190 FString Expires_at = "";
196USTRUCT(BlueprintType, Category = "LootLocker")
203 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
204 FString User_collections_id = "";
208 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
209 FString Product_id = "";
215USTRUCT(BlueprintType, Category = "LootLocker")
222 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
228UENUM(BlueprintType, Category = "LootLocker")
249USTRUCT(BlueprintType, Category =
"LootLocker")
256 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
261 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
266 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
267 FString Language = "";
271 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
272 FString Catalog_item_id = "";
278USTRUCT(BlueprintType, Category = "LootLocker")
285 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
292USTRUCT(BlueprintType, Category = "LootLocker")
299 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
300 bool isSuccess = false;
304 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
305 FString Entitlement_id = "";
311USTRUCT(BlueprintType, Category = "LootLocker")
318 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
319 FString Entitlement_id = "";
325USTRUCT(BlueprintType, Category = "LootLocker")
332 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
339USTRUCT(BlueprintType, Category = "LootLocker")
346 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
347 FString Entitlement_id = "";
352UENUM(BlueprintType, Category = "LootLocker")
365UENUM(BlueprintType, Category =
"LootLocker")
378UENUM(BlueprintType, Category =
"LootLocker")
391USTRUCT(BlueprintType)
396 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
397 TArray<FString> entitlement_ids;
400USTRUCT(BlueprintType)
405 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
408 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
411 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
415USTRUCT(BlueprintType)
420 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
423 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
424 FString currency_code;
426 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
430USTRUCT(BlueprintType)
435 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
438 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
441 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
444 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
448USTRUCT(BlueprintType)
459 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
462 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
465 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
469USTRUCT(BlueprintType)
474 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
475 FString entitlement_id;
477 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
481USTRUCT(BlueprintType)
486 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
489 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
492 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
498 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
508UENUM(BlueprintType, Category = "LootLocker")
525USTRUCT(BlueprintType, Category =
"LootLocker")
532 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
533 FString Entitlement_id = "";
539USTRUCT(BlueprintType, Category = "LootLocker")
546 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
547 FString Entitlement_id = "";
551 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
556 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
569 static constexpr int RetryLimit = 5;
570 FString EntitlementId =
"";
571 FString WalletId =
"";
572 TArray<FLootLockerCatalogItemAndQuantityPair>
Items;
575 float PollingIntervalSeconds = 1.0f;
577 bool ShouldCancel =
false;
596USTRUCT(BlueprintType, Category =
"LootLocker")
603 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
604 FString Catalog_item_id = "";
610USTRUCT(BlueprintType, Category = "LootLocker")
617 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
618 FString checkout_link = "";
622 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
623 FString entitlement_id = "";
698 static TMap<FString, FLootLockerAsyncPurchaseProcess> AsyncPurchaseProcesses;
730 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly =
"true", Category =
"LootLocker Methods | Purchases", WorldContext =
"WorldContextObject", AdvancedDisplay =
"PollingIntervalSeconds,TimeoutAfterMinutes,ForPlayerWithUlid", PollingIntervalSeconds = 1.0f, TimeoutAfterMinutes = 5.0f, ForPlayerWithUlid =
""))
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;
749 LOOTLOCKERSDK_API virtual
void Activate() override;
752 FString ForPlayerWithUlid = "";
753 FString ProcessID = "";
754 FString WalletId = "";
756 float PollingIntervalInSeconds = 1.0f;
757 float TimeoutAfterMinutes = 5.0f;
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
Definition LootLockerPurchasesRequestHandler.h:634
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)
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
Definition LootLockerPurchasesRequestHandler.h:16
Response from initiating an async purchase.
Definition LootLockerPurchasesRequestHandler.h:527
Definition LootLockerPurchasesRequestHandler.h:568
FTimerHandle AsyncPurchaseProcessTimerHandle
Definition LootLockerPurchasesRequestHandler.h:578
TArray< FLootLockerCatalogItemAndQuantityPair > Items
Definition LootLockerPurchasesRequestHandler.h:572
FLootLockerAsyncPurchaseProcess(float _PollingIntervalSeconds, float TimeoutAfterMinutes)
FLootLockerPlayerData PlayerData
Definition LootLockerPurchasesRequestHandler.h:573
FLootLockerAsyncPurchaseProcess()=default
FDateTime TimeoutTime
Definition LootLockerPurchasesRequestHandler.h:574
Response from polling the status of an async purchase.
Definition LootLockerPurchasesRequestHandler.h:541
Request to begin the Steam purchase redemption process for a catalog item for a specific class,...
Definition LootLockerPurchasesRequestHandler.h:280
Request to begin the Steam purchase redemption process for a catalog item, specifying the Steam user ...
Definition LootLockerPurchasesRequestHandler.h:251
Response indicating whether the Steam purchase redemption process started successfully,...
Definition LootLockerPurchasesRequestHandler.h:294
Pairs a catalog listing identifier with the quantity to purchase.
Definition LootLockerPurchasesRequestHandler.h:27
Request to create a Stripe Checkout session for a catalog item.
Definition LootLockerPurchasesRequestHandler.h:598
Response from creating a Stripe Checkout session.
Definition LootLockerPurchasesRequestHandler.h:612
Request to finalize a completed Steam purchase redemption by entitlement identifier.
Definition LootLockerPurchasesRequestHandler.h:341
Definition LootLockerPlayerData.h:12
Request to purchase one or more catalog items from a specific wallet.
Definition LootLockerPurchasesRequestHandler.h:46
Request to query the current status of a Steam purchase redemption by entitlement identifier.
Definition LootLockerPurchasesRequestHandler.h:313
Response containing the current redemption status of a Steam purchase.
Definition LootLockerPurchasesRequestHandler.h:327
Request to redeem an Apple App Store purchase for a specific class, extending the player request with...
Definition LootLockerPurchasesRequestHandler.h:84
Request to redeem an Apple App Store purchase for the current player using a transaction identifier,...
Definition LootLockerPurchasesRequestHandler.h:65
Request to redeem one or more Epic Games Store entitlements for a specific character,...
Definition LootLockerPurchasesRequestHandler.h:160
Request to redeem one or more Epic Games Store entitlements for the current player using an Epic acco...
Definition LootLockerPurchasesRequestHandler.h:131
Request to redeem a Google Play Store purchase for a specific class using a product identifier,...
Definition LootLockerPurchasesRequestHandler.h:117
Request to redeem a Google Play Store purchase for the current player using a product identifier and ...
Definition LootLockerPurchasesRequestHandler.h:98
Request to redeem an Xbox Store purchase for a class.
Definition LootLockerPurchasesRequestHandler.h:217
Request to redeem an Xbox Store purchase for the current player.
Definition LootLockerPurchasesRequestHandler.h:198
Definition LootLockerPurchasesRequestHandler.h:393
Definition LootLockerPurchasesRequestHandler.h:483
Definition LootLockerPurchasesRequestHandler.h:417
Definition LootLockerPurchasesRequestHandler.h:432
Definition LootLockerPurchasesRequestHandler.h:402
Definition LootLockerPurchasesRequestHandler.h:450
Definition LootLockerPurchasesRequestHandler.h:471
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