Skip to main content

ProductService

ZEPETO.Product.ProductService

ProductService manages operations associated with in-World products. Players can access in-World product information and perform purchases through this service.

Hierarchy

Constructors

constructor

new ProductService()

Overrides

System.Object.constructor

Properties

OnPurchaseCompleted

Static OnPurchaseCompleted: UnityEvent$2<ProductRecord, PurchaseResponse>

Event triggered upon a successful in-World product purchase. Listeners can be added, receiving ProductRecord (the purchased product information) and PurchaseResponse (the purchase result information) instances as arguments.


OnPurchaseFailed

Static OnPurchaseFailed: UnityEvent$2<ProductRecord, ProductBaseResponse>

Event triggered upon a failed in-World product purchase. Listeners can be added, receiving ProductRecord (product information in the attempted purchase) and PurchaseResponse (the unsuccessful purchase result information) instances as arguments.

Methods

GetCurrenciesAsync

Static GetCurrenciesAsync(): BaseRequest$1<CurrencyListResponse>

Asynchronous method to get a list of currencies. Upon completion, the list of currencies is obtained, and you can access the CurrencyListResponse object through the responseData property.

Returns

BaseRequest$1<CurrencyListResponse>


GetCurrencyAsync

Static GetCurrencyAsync($currencyId): BaseRequest$1<CurrencyResponse>

This asynchronous method retrieves the in-World currency information based on the provided product ID.

Parameters

NameTypeDescription
$currencyIdstringID of the currency to fetch.

Returns

BaseRequest$1<CurrencyResponse>

A BaseRequest object. When the asynchronous process is complete, you can access the CurrencyResponse object by the responseData property.


GetProductAsync

Static GetProductAsync($productId): BaseRequest$1<ProductResponse>

This asynchronous method retrieves the in-World product information based on the provided product ID.

Parameters

NameTypeDescription
$productIdstringID of the product to fetch.

Returns

BaseRequest$1<ProductResponse>

A BaseRequest object. When the asynchronous process is complete, you can access the ProductResponse object by the responseData property.


GetProductsAsync

Static GetProductsAsync(...productIds): BaseRequest$1<ProductListResponse>

This asynchronous method retrieves the in-World product list based on provided product IDs.

Parameters

NameType
...productIdsstring[]

Returns

BaseRequest$1<ProductListResponse>

A BaseRequest object. When the asynchronous process is complete, you can access the ProductListResponse object by the responseData property.


OpenPurchaseUI

Static OpenPurchaseUI($product): void

This method opens the in-World product purchase UI.

Parameters

NameTypeDescription
$productProductRecordProductRecord instance of the product to purchase.

Returns

void


PurchaseProductAsync

Static PurchaseProductAsync($product, $reason?): BaseRequest$1<PurchaseResponse>

This asynchronous method performs a purchase to the in-World product based on provided product information.

Parameters

NameTypeDescription
$productProductRecordProductRecord instance of the product to purchase.
$reason?stringOptional Explanation for the purchase.

Returns

BaseRequest$1<PurchaseResponse>

A BaseRequest object. When the asynchronous process is complete, you can access the PurchaseResponse object by the responseData property.

Static PurchaseProductAsync($productId, $reason?): BaseRequest$1<PurchaseResponse>

This asynchronous method performs a purchase to the in-World product based on the provided product ID.

Parameters

NameTypeDescription
$productIdstringID of the product to purchase.
$reason?stringOptional Explanation for the purchase.

Returns

BaseRequest$1<PurchaseResponse>

A BaseRequest object. When the asynchronous process is complete, you can access the PurchaseResponse object by the responseData property.