PICO Platform Unity SDK
IAPService Class Reference

Static Public Member Functions

static Task ConsumePurchase (string sku)
 Records the order fulfillment result for a consumable. More...
 
static Task< ProductListGetProductsBySKU (string[] skus)
 Gets a list of purchasable add-ons in the current app. More...
 
static Task< PurchaseListGetViewerPurchases ()
 Gets a list of purchased add-ons for a user, including durables and unfilfilled consumables. More...
 
static Task< PurchaseLaunchCheckoutFlow (string sku, string price, string currency)
 Launches the checkout flow for a user to make a payment. More...
 
static Task< PurchaseLaunchCheckoutFlow2 (Product product)
 Launches the checkout flow for a user to make a payment. More...
 
static Task< ProductListGetNextProductListPage (ProductList list)
 Gets the next page of purchasable add-ons. More...
 
static Task< PurchaseListGetNextPurchaseListPage (PurchaseList list)
 Gets the next page of purchased add-ons. More...
 

Detailed Description

You can diversify user experience and grow your revenue by selling products such as cosmetics, props, and coins/diamonds within your app. The PICO Unity Integration SDK provides In-App Purchase (IAP) service which enables users to purchase products within your app. The IAP service packages a series of payments systems such as Alipay, bank card, and Paypal, thereby providing you with a one-stop multi-payment-method solution.

Member Function Documentation

◆ ConsumePurchase()

static Task ConsumePurchase ( string  sku)
static

Records the order fulfillment result for a consumable.

Note
Users are unable to repurchase the same comsumable until the previous order is fulfilled.
Parameters
skuThe SKU of the add-on to fulfill.

◆ GetProductsBySKU()

static Task< ProductList > GetProductsBySKU ( string[]  skus)
static

Gets a list of purchasable add-ons in the current app.

Parameters
skusThe SKUs of the add-ons to retrieve. If this parameter is empty, all purchasable add-ons will be returned.
Returns
A list of purchasable add-ons.

◆ GetViewerPurchases()

static Task< PurchaseList > GetViewerPurchases ( )
static

Gets a list of purchased add-ons for a user, including durables and unfilfilled consumables.

Returns
A list of the user's purchased add-ons.

◆ LaunchCheckoutFlow()

static Task< Purchase > LaunchCheckoutFlow ( string  sku,
string  price,
string  currency 
)
static

Launches the checkout flow for a user to make a payment.

Deprecated:
LaunchCheckoutFlow(string sku,string price,string currency) can be replaced by LaunchCheckoutFlow2(Product product)
Note
This method don't support subscription type product,you should use LaunchCheckoutFlow2 instead.
Parameters
skuThe SKU of the product the user wants to purchase.
priceThe price for the product.
currencyThe currency of the payment.
Returns
Returns the purchased product if the user successfully pays the money. Otherwise the purchase will be null. You can get the failure reason from the returned error code and error message.

◆ LaunchCheckoutFlow2()

static Task< Purchase > LaunchCheckoutFlow2 ( Product  product)
static

Launches the checkout flow for a user to make a payment.

Parameters
productThe add-on info which can be acquired by GetProductsBySKU. The Product struct contains the following:
  • SKU: The unique identifier of the add-on.
  • Price: The price of the add-on.
  • Currency: The currency of the payment.
  • OuterId: The unique identifier of a subscription period. This field is only available to subscription add-ons.
Returns
Returns the purchased add-on if the user successfully makes the payment. Otherwise the purchase will be null. You can get the failure reason from the returned error code and error message.

◆ GetNextProductListPage()

static Task< ProductList > GetNextProductListPage ( ProductList  list)
static

Gets the next page of purchasable add-ons.

Parameters
listThe current page of purchasable add-ons.
Returns
The next page of purchasable add-ons.

◆ GetNextPurchaseListPage()

static Task< PurchaseList > GetNextPurchaseListPage ( PurchaseList  list)
static

Gets the next page of purchased add-ons.

Parameters
listThe current page of purchased add-ons.
Returns
The next page of purchased add-ons.