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;
77 bool ConsumePurchase(
const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
90 bool GetProductsBySKU(TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
139 bool LaunchCheckoutFlow(
const FString& SKU,
const FString& Price,
const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
155 bool LaunchCheckoutFlowV2(
const FString& SKU,
const FString& Price,
const FString& Currency,
const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
193 UFUNCTION(BlueprintCallable, meta = (WorldContext =
"WorldContextObject"), Category =
"OnlinePico|IAP")
194 static
bool ConsumePurchase(UObject* WorldContextObject,const FString& SKU, FConsumePurchaseDelegate InConsumePurchaseDelegate);
207 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
208 static
bool GetProductsBySKU(UObject* WorldContextObject, TArray<FString> ProductSKUs, int32 Count, FGetProductsBySKUDelegate InGetProductsBySKUDelegate);
220 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
221 static
bool GetNextProductsArrayPage(UObject* WorldContextObject,
UPico_ProductArray* InProductArray, FGetNextProductArrayPageDelegate InGetNextProductArrayPageDelegate);
234 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
235 static
bool GetViewerPurchases(UObject* WorldContextObject, FGetViewerPurchasesDelegate InGetViewerPurchasesDelegate);
247 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
248 static
bool GetNextPurchaseArrayPage(UObject* WorldContextObject,
UPico_PurchaseArray* InPurchaseArray, FGetNextPurchaseArrayPageDelegate InGetNextPurchaseArrayPageDelegate);
264 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
265 static
bool LaunchCheckoutFlow(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, FLaunchCheckoutFlowDelegate InLaunchCheckoutFlowDelegate);
282 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|IAP")
283 static
bool LaunchCheckoutFlowV2(UObject* WorldContextObject, const FString& SKU, const FString& Price, const FString& Currency, const FString& OuterId, FLaunchCheckoutFlow_V2Delegate InLaunchCheckoutFlow_V2Delegate);
298 FString Description = FString();
299 FString DetailDescription = FString();
300 FString Price = FString();
301 FString Currency = FString();
302 FString Name = FString();
303 FString SKU = FString();
304 FString Icon = FString();
308 int32 TrialPeriodValue = -1;
309 FString OuterId = FString();
310 FString OriginalPrice = FString();
311 bool bIsContinuous =
false;
314 void InitParams(ppfProduct* InppfProductHandle);
316 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
317 FString GetDescription();
319 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
320 FString GetDetailDescription();
322 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
325 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
326 FString GetFormattedPrice();
328 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
329 FString GetCurrency();
331 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
334 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
337 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
340 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
343 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
346 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
349 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
350 int32 GetTrialPeriodValue();
352 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
353 FString GetOuterId();
355 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
356 FString GetOriginalPrice();
358 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product")
359 bool GetIsContinuous();
374 TArray<UPico_Product*> ProductArray;
377 FString NextPageParam = FString();
380 void InitParams(ppfProductArray* InppfProductArrayHandle);
382 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product Array")
385 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product Array")
386 FString GetNextPageParam();
388 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product Array")
391 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Product Array")
404 int64 ExpirationTime = 0;
406 FString ID = FString();
407 FString SKU = FString();
408 FString Icon = FString();
410 FString OuterId = FString();
413 int64 NextPayTime = 0;
416 void InitParams(ppfPurchase* InppfPurchaseHandle);
418 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
419 int64 GetExpirationTime();
421 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
422 int64 GetGrantTime();
424 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
427 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
430 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
433 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
436 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
439 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
442 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
443 FString GetOuterId();
445 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
446 int64 GetNextPayTime();
448 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase")
463 TArray<UPico_Purchase*> PurchaseArray;
466 FString NextPageParam = FString();
469 void InitParams(ppfPurchaseArray* InppfPurchaseArrayHandle);
471 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase Array")
474 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase Array")
475 FString GetNextPageParam();
477 UFUNCTION(BlueprintPure, Category =
"Pico Platform|IAP|Purchase Array")
480 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:175
Definition: Pico_IAP.h:368
Definition: Pico_IAP.h:294
Definition: Pico_IAP.h:457
Definition: Pico_IAP.h:400
EDiscountType
Discount type.
Definition: OnlineSubsystemPicoNames.h:723
EPeriodType
Subscription period type.
Definition: OnlineSubsystemPicoNames.h:708
EAddonsType
Add-on type.
Definition: OnlineSubsystemPicoNames.h:697