17#include "CoreMinimal.h"
18#include "UObject/NoExportTypes.h"
19#include "PPF_Platform.h"
20#include "OnlineSubsystemPico.h"
21#include "Pico_IAP.generated.h"
25DECLARE_LOG_CATEGORY_EXTERN(PicoIAP, Log, All);
29DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetProductsBySKUDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_ProductArray*, ProductArray);
30DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetViewerPurchasesDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_PurchaseArray*, PurchaseArray);
31DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextProductArrayPageDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_ProductArray*, ProductArray);
32DECLARE_DYNAMIC_DELEGATE_TwoParams(FConsumePurchaseDelegate,
bool, bIsError,
const FString&, ErrorMessage);
33DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextPurchaseArrayPageDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_PurchaseArray*, PurchaseArray);
34DECLARE_DYNAMIC_DELEGATE_ThreeParams(FLaunchCheckoutFlowDelegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_Purchase*, Purchase);
35DECLARE_DYNAMIC_DELEGATE_ThreeParams(FLaunchCheckoutFlow_V2Delegate,
bool, bIsError,
const FString&, ErrorMessage,
UPico_Purchase*, Purchase);
52 FOnlineSubsystemPico& PicoSubsystem;
58 FConsumePurchaseDelegate ConsumePurchaseDelegate;
59 FGetProductsBySKUDelegate GetProductsBySKUDelegate;
60 FGetNextProductArrayPageDelegate GetNextProductArrayPageDelegate;
61 FGetViewerPurchasesDelegate GetViewerPurchasesDelegate;
62 FGetNextPurchaseArrayPageDelegate GetNextPurchaseArrayPageDelegate;
63 FLaunchCheckoutFlowDelegate LaunchCheckoutFlowDelegate;
64 FLaunchCheckoutFlow_V2Delegate LaunchCheckoutFlow_V2Delegate;
78 bool ConsumePurchase(
const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
92 bool GetProductsBySKU(TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
145 bool LaunchCheckoutFlow(
const FString& SKU,
const FString& Price,
const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
162 bool LaunchCheckoutFlowV2(
const FString& SKU,
const FString& Price,
const FString& Currency,
const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
201 UFUNCTION(BlueprintCallable, meta = (WorldContext =
"WorldContextObject"), Category =
"OnlinePico|IAP")
202 static
bool ConsumePurchase(UObject* WorldContextObject, const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
216 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
217 static
bool GetProductsBySKU(UObject* WorldContextObject, TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
230 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
231 static
bool GetNextProductsArrayPage(UObject* WorldContextObject,
UPico_ProductArray* InProductArray, FGetNextProductArrayPageDelegate InGetNextProductArrayPageDelegate);
245 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
246 static
bool GetViewerPurchases(UObject* WorldContextObject, FGetViewerPurchasesDelegate InGetViewerPurchasesDelegate);
259 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
260 static
bool GetNextPurchaseArrayPage(UObject* WorldContextObject,
UPico_PurchaseArray* InPurchaseArray, FGetNextPurchaseArrayPageDelegate InGetNextPurchaseArrayPageDelegate);
277 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
278 static
bool LaunchCheckoutFlow(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
296 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
297 static
bool LaunchCheckoutFlowV2(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
314 FString Description = FString();
315 FString DetailDescription = FString();
316 FString Price = FString();
317 FString Currency = FString();
318 FString Name = FString();
319 FString SKU = FString();
320 FString Icon = FString();
324 int32 TrialPeriodValue = -1;
325 FString OuterId = FString();
326 FString OriginalPrice = FString();
327 bool bIsContinuous =
false;
330 void InitParams(ppfProduct* InppfProductHandle);
333 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
334 FString GetDescription();
337 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
338 FString GetDetailDescription();
341 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
345 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
346 FString GetFormattedPrice();
349 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
350 FString GetCurrency();
353 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
357 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
361 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
365 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
369 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
373 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
377 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
378 int32 GetTrialPeriodValue();
381 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
382 FString GetOuterId();
387 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
388 FString GetOriginalPrice();
391 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product")
392 bool GetIsContinuous();
409 TArray<UPico_Product*> ProductArray;
412 FString NextPageParam = FString();
415 void InitParams(ppfProductArray* InppfProductArrayHandle);
418 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product Array")
421 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
422 FString GetNextPageParam();
425 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
429 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Product Array")
444 int64 ExpirationTime = 0;
446 FString ID = FString();
447 FString SKU = FString();
448 FString Icon = FString();
450 FString OuterId = FString();
453 int64 NextPayTime = 0;
456 void InitParams(ppfPurchase* InppfPurchaseHandle);
460 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
461 int64 GetExpirationTime();
464 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
465 int64 GetGrantTime();
468 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
472 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
476 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
480 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
484 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
488 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
492 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
493 FString GetOuterId();
496 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
497 int64 GetNextPayTime();
500 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase")
517 TArray<UPico_Purchase*> PurchaseArray;
520 FString NextPageParam = FString();
523 void InitParams(ppfPurchaseArray* InppfPurchaseArrayHandle);
526 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase Array")
529 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
530 FString GetNextPageParam();
533 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
537 UFUNCTION(BlueprintPure, Category = "Pico Platform|IAP|Purchase Array")
PicoIAPInterface class.
Definition: Pico_IAP.h:49
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 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:182
UPico_ProductArray class.
Definition: Pico_IAP.h:403
UPico_Product class.
Definition: Pico_IAP.h:310
UPico_PurchaseArray class.
Definition: Pico_IAP.h:511
UPico_Purchase class.
Definition: Pico_IAP.h:440
EDiscountType
Discount type.
Definition: OnlineSubsystemPicoNames.h:723
EPeriodType
Subscription period type.
Definition: OnlineSubsystemPicoNames.h:708
EAddonsType
Add-on type.
Definition: OnlineSubsystemPicoNames.h:697