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 = "";
171UENUM(BlueprintType, Category = "LootLocker")
192USTRUCT(BlueprintType, Category =
"LootLocker")
199 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
204 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
209 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
210 FString Language = "";
214 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
215 FString Catalog_item_id = "";
221USTRUCT(BlueprintType, Category = "LootLocker")
228 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
235USTRUCT(BlueprintType, Category = "LootLocker")
242 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
243 bool isSuccess = false;
247 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
248 FString Entitlement_id = "";
254USTRUCT(BlueprintType, Category = "LootLocker")
261 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
262 FString Entitlement_id = "";
268USTRUCT(BlueprintType, Category = "LootLocker")
275 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
282USTRUCT(BlueprintType, Category = "LootLocker")
289 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
290 FString Entitlement_id = "";
295UENUM(BlueprintType, Category = "LootLocker")
308UENUM(BlueprintType, Category =
"LootLocker")
321UENUM(BlueprintType, Category =
"LootLocker")
334USTRUCT(BlueprintType)
339 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
340 TArray<FString> entitlement_ids;
343USTRUCT(BlueprintType)
348 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
351 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
354 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
358USTRUCT(BlueprintType)
363 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
366 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
367 FString currency_code;
369 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
373USTRUCT(BlueprintType)
378 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
381 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
384 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
387 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
391USTRUCT(BlueprintType)
402 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
405 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
408 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
412USTRUCT(BlueprintType)
417 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
418 FString entitlement_id;
420 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
424USTRUCT(BlueprintType)
429 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
432 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
435 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
441 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
451UENUM(BlueprintType, Category = "LootLocker")
468USTRUCT(BlueprintType, Category =
"LootLocker")
475 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
476 FString Entitlement_id = "";
482USTRUCT(BlueprintType, Category = "LootLocker")
489 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
490 FString Entitlement_id = "";
494 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
499 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
512 static constexpr int RetryLimit = 5;
513 FString EntitlementId =
"";
514 FString WalletId =
"";
515 TArray<FLootLockerCatalogItemAndQuantityPair>
Items;
518 float PollingIntervalSeconds = 1.0f;
520 bool ShouldCancel =
false;
539USTRUCT(BlueprintType, Category =
"LootLocker")
546 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
547 FString Catalog_item_id = "";
553USTRUCT(BlueprintType, Category = "LootLocker")
560 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
561 FString checkout_link = "";
565 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
566 FString entitlement_id = "";
633 static TMap<FString, FLootLockerAsyncPurchaseProcess> AsyncPurchaseProcesses;
665 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly =
"true", Category =
"LootLocker Methods | Purchases", WorldContext =
"WorldContextObject", AdvancedDisplay =
"PollingIntervalSeconds,TimeoutAfterMinutes,ForPlayerWithUlid", PollingIntervalSeconds = 1.0f, TimeoutAfterMinutes = 5.0f, ForPlayerWithUlid =
""))
669 UPROPERTY(BlueprintAssignable)
670 FLootLockerAsyncPurchasePollingMulticastDelegate OnPending;
672 UPROPERTY(BlueprintAssignable)
673 FLootLockerAsyncPurchasePollingMulticastDelegate OnActive;
675 UPROPERTY(BlueprintAssignable)
676 FLootLockerAsyncPurchasePollingMulticastDelegate OnFailed;
678 UPROPERTY(BlueprintAssignable)
679 FLootLockerAsyncPurchasePollingMulticastDelegate OnTimedOut;
681 UPROPERTY(BlueprintAssignable)
682 FLootLockerAsyncPurchasePollingMulticastDelegate OnCancelled;
684 LOOTLOCKERSDK_API virtual
void Activate() override;
687 FString ForPlayerWithUlid = "";
688 FString ProcessID = "";
689 FString WalletId = "";
691 float PollingIntervalInSeconds = 1.0f;
692 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:651
Definition LootLockerPurchasesRequestHandler.h:575
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)
ULootLockerPurchasesRequestHandler()
Definition LootLockerPurchasesRequestHandler.h:578
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 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 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:300
void(* FLootLockerRefundByEntitlementIdsDelegate)(FLootLockerRefundByEntitlementIdsResponse)
C++ response callback delegate; receives an FLootLockerRefundByEntitlementIdsResponse result.
Definition LootLockerPurchasesRequestHandler.h:534
ELootLockerRefundNonReversibleRewardKind
Possible kinds of non-reversible rewards in a refund warning.
Definition LootLockerPurchasesRequestHandler.h:313
void(* FLootLockerCreateStripeCheckoutSessionDelegate)(FLootLockerCreateStripeCheckoutSessionResponse)
C++ response callback delegate; receives an FLootLockerCreateStripeCheckoutSessionResponse result.
Definition LootLockerPurchasesRequestHandler.h:570
void(* FLootLockerQuerySteamPurchaseRedemptionStatusDelegate)(FLootLockerQuerySteamPurchaseRedemptionStatusResponse)
C++ response callback delegate; receives an FLootLockerQuerySteamPurchaseRedemptionStatusResponse res...
Definition LootLockerPurchasesRequestHandler.h:532
ELootLockerSteamPurchaseRedemptionStatus
Possible statuses a Steam Purchase can have.
Definition LootLockerPurchasesRequestHandler.h:176
void(* FLootLockerAsyncPurchaseStatusDelegate)(FLootLockerAsyncPurchaseStatusResponse)
C++ response callback delegate; receives an FLootLockerAsyncPurchaseStatusResponse result.
Definition LootLockerPurchasesRequestHandler.h:508
void(* FLootLockerAsyncPurchaseInitiatedDelegate)(FLootLockerAsyncPurchaseInitiatedResponse)
C++ response callback delegate; receives an FLootLockerAsyncPurchaseInitiatedResponse result.
Definition LootLockerPurchasesRequestHandler.h:506
ELootLockerRefundWarningDetailType
Possible warning types in a refund response.
Definition LootLockerPurchasesRequestHandler.h:326
ELootLockerAsyncPurchaseStatus
Possible statuses for an async purchase.
Definition LootLockerPurchasesRequestHandler.h:456
void(* FLootLockerBeginSteamPurchaseRedemptionDelegate)(FLootLockerBeginSteamPurchaseRedemptionResponse)
C++ response callback delegate; receives an FLootLockerBeginSteamPurchaseRedemptionResponse result.
Definition LootLockerPurchasesRequestHandler.h:530
void(* FActivateRentalAssetResponseDelegate)(FLootLockerActivateRentalAssetResponse)
C++ response callback delegate; receives an FLootLockerActivateRentalAssetResponse result.
Definition LootLockerPurchasesRequestHandler.h:528
Definition LootLockerPurchasesRequestHandler.h:16
Response from initiating an async purchase.
Definition LootLockerPurchasesRequestHandler.h:470
Definition LootLockerPurchasesRequestHandler.h:511
FTimerHandle AsyncPurchaseProcessTimerHandle
Definition LootLockerPurchasesRequestHandler.h:521
TArray< FLootLockerCatalogItemAndQuantityPair > Items
Definition LootLockerPurchasesRequestHandler.h:515
FLootLockerAsyncPurchaseProcess(float _PollingIntervalSeconds, float TimeoutAfterMinutes)
FLootLockerPlayerData PlayerData
Definition LootLockerPurchasesRequestHandler.h:516
FLootLockerAsyncPurchaseProcess()=default
FDateTime TimeoutTime
Definition LootLockerPurchasesRequestHandler.h:517
Response from polling the status of an async purchase.
Definition LootLockerPurchasesRequestHandler.h:484
Request to begin the Steam purchase redemption process for a catalog item for a specific class,...
Definition LootLockerPurchasesRequestHandler.h:223
Request to begin the Steam purchase redemption process for a catalog item, specifying the Steam user ...
Definition LootLockerPurchasesRequestHandler.h:194
Response indicating whether the Steam purchase redemption process started successfully,...
Definition LootLockerPurchasesRequestHandler.h:237
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:541
Response from creating a Stripe Checkout session.
Definition LootLockerPurchasesRequestHandler.h:555
Request to finalize a completed Steam purchase redemption by entitlement identifier.
Definition LootLockerPurchasesRequestHandler.h:284
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:256
Response containing the current redemption status of a Steam purchase.
Definition LootLockerPurchasesRequestHandler.h:270
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
Definition LootLockerPurchasesRequestHandler.h:336
Definition LootLockerPurchasesRequestHandler.h:426
Definition LootLockerPurchasesRequestHandler.h:360
Definition LootLockerPurchasesRequestHandler.h:375
Definition LootLockerPurchasesRequestHandler.h:345
Definition LootLockerPurchasesRequestHandler.h:393
Definition LootLockerPurchasesRequestHandler.h:414
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19