5#include "CoreMinimal.h"
6#include "UObject/NoExportTypes.h"
7#include "PPF_Platform.h"
8#include "OnlineSubsystemPico.h"
9#include "Kismet/BlueprintFunctionLibrary.h"
10#include "Pico_IAP.generated.h"
14DECLARE_LOG_CATEGORY_EXTERN(PicoIAP, Log, All);
18DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetProductsBySKUDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_ProductArray*, ProductArray);
19DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetViewerPurchasesDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_PurchaseArray*, PurchaseArray);
20DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextProductArrayPageDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_ProductArray*, ProductArray);
21DECLARE_DYNAMIC_DELEGATE_TwoParams(FConsumePurchaseDelegate,
bool, bIsError,
const FString&, ErrorMessage);
22DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextPurchaseArrayPageDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_PurchaseArray*, PurchaseArray);
23DECLARE_DYNAMIC_DELEGATE_ThreeParams(FLaunchCheckoutFlowDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_Purchase*, Purchase);
24DECLARE_DYNAMIC_DELEGATE_ThreeParams(FLaunchCheckoutFlow_V2Delegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_Purchase*, Purchase);
25DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetSubscriptionStatusDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_SubscriptionStatus*, SubscriptionStatus);
26DECLARE_DYNAMIC_DELEGATE_ThreeParams(FLaunchCheckoutFlow_V3Delegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_Purchase*, Purchase);
43 FOnlineSubsystemPico& PicoSubsystem;
49 FConsumePurchaseDelegate ConsumePurchaseDelegate;
50 FGetProductsBySKUDelegate GetProductsBySKUDelegate;
51 FGetNextProductArrayPageDelegate GetNextProductArrayPageDelegate;
52 FGetViewerPurchasesDelegate GetViewerPurchasesDelegate;
53 FGetNextPurchaseArrayPageDelegate GetNextPurchaseArrayPageDelegate;
54 FLaunchCheckoutFlowDelegate LaunchCheckoutFlowDelegate;
55 FLaunchCheckoutFlow_V2Delegate LaunchCheckoutFlow_V2Delegate;
56 FGetSubscriptionStatusDelegate GetSubscriptionStatusDelegate;
57 FLaunchCheckoutFlow_V3Delegate LaunchCheckoutFlow_V3Delegate;
71 bool ConsumePurchase(
const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
85 bool GetProductsBySKU(TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
137 bool LaunchCheckoutFlow(
const FString& SKU,
const FString& Price,
const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
154 bool LaunchCheckoutFlowV2(
const FString& SKU,
const FString& Price,
const FString& Currency,
const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
186 bool LaunchCheckoutFlowV3(
const FString& SKU,
const FString& Price,
const FString& Currency,
const FString& OuterId,
const FString& OrderComment, FLaunchCheckoutFlow_V3Delegate InLaunchCheckoutFlow_V3Delegate);
224 UFUNCTION(BlueprintCallable, meta = (WorldContext =
"WorldContextObject"), Category =
"OnlinePico|IAP")
225 static
bool ConsumePurchase(UObject* WorldContextObject, const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
239 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
240 static
bool GetProductsBySKU(UObject* WorldContextObject, TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
253 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
254 static
bool GetNextProductsArrayPage(UObject* WorldContextObject,
UPico_ProductArray* InProductArray, FGetNextProductArrayPageDelegate InGetNextProductArrayPageDelegate);
267 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
268 static
bool GetViewerPurchases(UObject* WorldContextObject, FGetViewerPurchasesDelegate InGetViewerPurchasesDelegate);
281 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
282 static
bool GetNextPurchaseArrayPage(UObject* WorldContextObject,
UPico_PurchaseArray* InPurchaseArray, FGetNextPurchaseArrayPageDelegate InGetNextPurchaseArrayPageDelegate);
299 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
300 static
bool LaunchCheckoutFlow(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
318 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
319 static
bool LaunchCheckoutFlowV2(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
334 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
335 static
bool GetSubscriptionStatus(UObject* WorldContextObject, const FString& SKU, FGetSubscriptionStatusDelegate InGetSubscriptionStatusDelegate);
355 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
356 static
bool LaunchCheckoutFlowV3(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, const FString& OuterId, const FString& OrderComment, FLaunchCheckoutFlow_V3Delegate InLaunchCheckoutFlow_V3Delegate);
373 FString Description = FString();
374 FString DetailDescription = FString();
375 FString Price = FString();
376 FString Currency = FString();
377 FString Name = FString();
378 FString SKU = FString();
379 FString Icon = FString();
383 int32 TrialPeriodValue = -1;
384 FString OuterId = FString();
385 FString OriginalPrice = FString();
386 bool bIsContinuous =
false;
389 void InitParams(ppfProduct* InppfProductHandle);
392 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
393 FString GetDescription();
396 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
397 FString GetDetailDescription();
400 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
404 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
405 FString GetFormattedPrice();
408 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
409 FString GetCurrency();
412 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
416 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
420 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
424 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
428 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
432 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
436 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
437 int32 GetTrialPeriodValue();
440 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
441 FString GetOuterId();
446 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
447 FString GetOriginalPrice();
450 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
451 bool GetIsContinuous();
468 TArray<UPico_Product*> ProductArray;
471 FString NextPageParam = FString();
474 void InitParams(ppfProductArray* InppfProductArrayHandle);
477 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product Array")
480 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
481 FString GetNextPageParam();
484 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
488 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
503 int64 ExpirationTime = 0;
505 FString ID = FString();
506 FString SKU = FString();
507 FString Icon = FString();
509 FString OuterId = FString();
512 int64 NextPayTime = 0;
514 FString OrderComment = FString();
516 void InitParams(ppfPurchase* InppfPurchaseHandle);
520 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
521 int64 GetExpirationTime();
524 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
525 int64 GetGrantTime();
528 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
532 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
536 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
540 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
544 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
548 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
552 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
553 FString GetOuterId();
556 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
557 int64 GetNextPayTime();
560 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
564 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
565 FString GetOrderComment();
581 TArray<UPico_Purchase*> PurchaseArray;
584 FString NextPageParam = FString();
587 void InitParams(ppfPurchaseArray* InppfPurchaseArrayHandle);
590 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase Array")
593 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
594 FString GetNextPageParam();
597 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
601 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
616 FString SKU = FString();
617 FString OuterId = FString();
623 bool bIsFreeTrial =
false;
624 int32 NextPeriod = -1;
626 void InitParams(ppfSubscriptionStatus* InppfSubscriptionStatusHandle);
629 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|SubscriptionStatus")
633 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
634 FString GetOuterId();
637 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
638 int64 GetStartTime();
641 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
645 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
649 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
653 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
657 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
658 bool GetIsFreeTrial();
661 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
662 int32 GetNextPeriod();
PicoIAPInterface class.
Definition: Pico_IAP.h:40
bool GetProductsBySKU(TArray< FString > ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate)
Gets a list of purchasable add-ons in the current app.
bool ConsumePurchase(const FString &SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate)
Records the order fulfillment result for a consumable.
bool GetNextPurchaseArrayPage(UPico_PurchaseArray *InPurchaseArray, FGetNextPurchaseArrayPageDelegate InGetNextPurchaseArrayPageDelegate)
Gets the next page of purchased add-ons.
bool LaunchCheckoutFlow(const FString &SKU, const FString &Price, const FString &Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate)
Launches the checkout flow to purchase a durable or consumable.
bool GetNextProductsArrayPage(UPico_ProductArray *InProductArray, FGetNextProductArrayPageDelegate InGetNextProductArrayPageDelegate)
Gets the next page of purchasable add-ons.
bool LaunchCheckoutFlowV3(const FString &SKU, const FString &Price, const FString &Currency, const FString &OuterId, const FString &OrderComment, FLaunchCheckoutFlow_V3Delegate InLaunchCheckoutFlow_V3Delegate)
Launches the checkout flow to purchase a subscription add-on.
bool GetSubscriptionStatus(const FString &SKU, FGetSubscriptionStatusDelegate InGetSubscriptionStatusDelegate)
Gets the subscription status of an add-on.
bool LaunchCheckoutFlowV2(const FString &SKU, const FString &Price, const FString &Currency, const FString &OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate)
Launches the checkout flow to purchase a subscription add-on.
bool GetViewerPurchases(FGetViewerPurchasesDelegate InGetViewerPurchasesDelegate)
Gets a list of purchased add-ons for a user, including durables and unfulfilled consumables.
OnlinePicoIAP Blueprint Function class.
Definition: Pico_IAP.h:205
UPico_ProductArray class.
Definition: Pico_IAP.h:462
UPico_Product class.
Definition: Pico_IAP.h:369
UPico_PurchaseArray class.
Definition: Pico_IAP.h:575
UPico_Purchase class.
Definition: Pico_IAP.h:499
UPico_SubscriptionStatus class.
Definition: Pico_IAP.h:612
EEntitlementStatus
The subscription entitlement status type.
Definition: OnlineSubsystemPicoNames.h:722
EDiscountType
Discount type.
Definition: OnlineSubsystemPicoNames.h:711
ECancelReason
The subscription entitlement cancel reason type.
Definition: OnlineSubsystemPicoNames.h:735
EPeriodType
Subscription period type.
Definition: OnlineSubsystemPicoNames.h:696
EAddonsType
Add-on type.
Definition: OnlineSubsystemPicoNames.h:685