5#include "CoreMinimal.h"
6#include "UObject/NoExportTypes.h"
7#include "PPF_Platform.h"
8#include "OnlineSubsystemPico.h"
9#include "Pico_IAP.generated.h"
13DECLARE_LOG_CATEGORY_EXTERN(PicoIAP, Log, All);
17DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetProductsBySKUDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_ProductArray*, ProductArray);
18DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetViewerPurchasesDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_PurchaseArray*, PurchaseArray);
19DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextProductArrayPageDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_ProductArray*, ProductArray);
20DECLARE_DYNAMIC_DELEGATE_TwoParams(FConsumePurchaseDelegate,
bool, bIsError,
const FString&, ErrorMessage);
21DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextPurchaseArrayPageDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_PurchaseArray*, PurchaseArray);
22DECLARE_DYNAMIC_DELEGATE_ThreeParams(FLaunchCheckoutFlowDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_Purchase*, Purchase);
23DECLARE_DYNAMIC_DELEGATE_ThreeParams(FLaunchCheckoutFlow_V2Delegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_Purchase*, Purchase);
24DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetSubscriptionStatusDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_SubscriptionStatus*, SubscriptionStatus);
41 FOnlineSubsystemPico& PicoSubsystem;
47 FConsumePurchaseDelegate ConsumePurchaseDelegate;
48 FGetProductsBySKUDelegate GetProductsBySKUDelegate;
49 FGetNextProductArrayPageDelegate GetNextProductArrayPageDelegate;
50 FGetViewerPurchasesDelegate GetViewerPurchasesDelegate;
51 FGetNextPurchaseArrayPageDelegate GetNextPurchaseArrayPageDelegate;
52 FLaunchCheckoutFlowDelegate LaunchCheckoutFlowDelegate;
53 FLaunchCheckoutFlow_V2Delegate LaunchCheckoutFlow_V2Delegate;
54 FGetSubscriptionStatusDelegate GetSubscriptionStatusDelegate;
68 bool ConsumePurchase(
const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
82 bool GetProductsBySKU(TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
135 bool LaunchCheckoutFlow(
const FString& SKU,
const FString& Price,
const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
152 bool LaunchCheckoutFlowV2(
const FString& SKU,
const FString& Price,
const FString& Currency,
const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
205 UFUNCTION(BlueprintCallable, meta = (WorldContext =
"WorldContextObject"), Category =
"OnlinePico|IAP")
206 static
bool ConsumePurchase(UObject* WorldContextObject, const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
220 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
221 static
bool GetProductsBySKU(UObject* WorldContextObject, TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
234 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
235 static
bool GetNextProductsArrayPage(UObject* WorldContextObject,
UPico_ProductArray* InProductArray, FGetNextProductArrayPageDelegate InGetNextProductArrayPageDelegate);
249 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
250 static
bool GetViewerPurchases(UObject* WorldContextObject, FGetViewerPurchasesDelegate InGetViewerPurchasesDelegate);
263 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
264 static
bool GetNextPurchaseArrayPage(UObject* WorldContextObject,
UPico_PurchaseArray* InPurchaseArray, FGetNextPurchaseArrayPageDelegate InGetNextPurchaseArrayPageDelegate);
281 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
282 static
bool LaunchCheckoutFlow(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
300 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
301 static
bool LaunchCheckoutFlowV2(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
316 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
317 static
bool GetSubscriptionStatus(UObject* WorldContextObject, const FString& SKU, FGetSubscriptionStatusDelegate InGetSubscriptionStatusDelegate);
335 FString Description = FString();
336 FString DetailDescription = FString();
337 FString Price = FString();
338 FString Currency = FString();
339 FString Name = FString();
340 FString SKU = FString();
341 FString Icon = FString();
345 int32 TrialPeriodValue = -1;
346 FString OuterId = FString();
347 FString OriginalPrice = FString();
348 bool bIsContinuous =
false;
351 void InitParams(ppfProduct* InppfProductHandle);
354 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
355 FString GetDescription();
358 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
359 FString GetDetailDescription();
362 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
366 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
367 FString GetFormattedPrice();
370 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
371 FString GetCurrency();
374 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
378 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
382 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
386 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
390 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
394 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
398 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
399 int32 GetTrialPeriodValue();
402 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
403 FString GetOuterId();
408 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
409 FString GetOriginalPrice();
412 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
413 bool GetIsContinuous();
430 TArray<UPico_Product*> ProductArray;
433 FString NextPageParam = FString();
436 void InitParams(ppfProductArray* InppfProductArrayHandle);
439 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product Array")
442 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
443 FString GetNextPageParam();
446 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
450 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
465 int64 ExpirationTime = 0;
467 FString ID = FString();
468 FString SKU = FString();
469 FString Icon = FString();
471 FString OuterId = FString();
474 int64 NextPayTime = 0;
477 void InitParams(ppfPurchase* InppfPurchaseHandle);
481 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
482 int64 GetExpirationTime();
485 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
486 int64 GetGrantTime();
489 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
493 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
497 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
501 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
505 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
509 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
513 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
514 FString GetOuterId();
517 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
518 int64 GetNextPayTime();
521 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
538 TArray<UPico_Purchase*> PurchaseArray;
541 FString NextPageParam = FString();
544 void InitParams(ppfPurchaseArray* InppfPurchaseArrayHandle);
547 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase Array")
550 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
551 FString GetNextPageParam();
554 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
558 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
573 FString SKU = FString();
574 FString OuterId = FString();
580 bool bIsFreeTrial =
false;
581 int32 NextPeriod = -1;
583 void InitParams(ppfSubscriptionStatus* InppfSubscriptionStatusHandle);
586 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|SubscriptionStatus")
590 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
591 FString GetOuterId();
594 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
595 int64 GetStartTime();
598 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
602 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
606 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
610 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
614 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
615 bool GetIsFreeTrial();
618 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|SubscriptionStatus")
619 int32 GetNextPeriod();
PicoIAPInterface class.
Definition: Pico_IAP.h:38
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 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.
OnlinePicoIAP Blueprint Function class.
Definition: Pico_IAP.h:186
UPico_ProductArray class.
Definition: Pico_IAP.h:424
UPico_Product class.
Definition: Pico_IAP.h:331
UPico_PurchaseArray class.
Definition: Pico_IAP.h:532
UPico_Purchase class.
Definition: Pico_IAP.h:461
UPico_SubscriptionStatus class.
Definition: Pico_IAP.h:569
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