CdvPurchase.Product
Product definition from a store
• description: string
= ''
Product full description from the store.
• Optional
group: string
Group the product is member of.
Only 1 product of a given group can be owned. This is generally used to provide different levels for subscriptions, for example: silver and gold.
Purchasing a different level will replace the previously owned one.
• id: string
Product identifier on the store (unique per platform)
• offers: Offer
[]
List of offers available for this product
• platform: Platform
Platform this product is available from
• title: string
= ''
Product title from the store.
• type: ProductType
Type of product (subscription, consumable, etc.)
• get
canPurchase(): boolean
Returns true if the product can be purchased.
boolean
• get
owned(): boolean
Returns true if the product is owned.
boolean
• get
pricing(): undefined
| PricingPhase
Shortcut to offers[0].pricingPhases[0]
Useful when you know products have a single offer and a single pricing phase.
undefined
| PricingPhase
▸ getOffer(id?
): undefined
| Offer
Find and return an offer for this product from its id
If id isn't specified, returns the first offer.
Name | Type | Default value | Description |
---|---|---|---|
id |
string |
'' |
Identifier of the offer to return |
undefined
| Offer
An Offer or undefined if no match is found