Skip to content
Mohammad Naghavi edited this page Jul 4, 2014 · 25 revisions

Global

Type Definitions

buySuccessCallback(purchase)

The success callback for buy and subscribe

Parameters:
Name Type Description
purchase Purchase

the data of purchase

Source:

consumeProductSuccessCallback(purchase)

This is the callback for consumeProduct

Parameters:
Name Type Description
purchase Purchase
Source:

errorCallback(error)

All the failure callbacks have the same signature as this.

Parameters:
Name Type Description
error Object

the information about the error

Properties
Name Type Description
errorCode int

one of the error codes defined with ERR_*

msg string

a textual message intended for developer in order to make debuging easier

Source:

getLoadedProductsSuccessCallback(products)

The success callback for getLoadedProducts.

Parameters:
Name Type Description
products Array.<ProductDetails>
Source:

getPurchaseDetailsSuccessCallback(purchase)

This is the success callback for getPurchaseDetails. This will return the purchase data containing the verification payload.

Parameters:
Name Type Description
purchase Purchase
Source:

getPurchasesSuccessCallback(purchaseList)

The success callback for getPurchases

Parameters:
Name Type Description
purchaseList Array.<Purchase>
Source:

initSuccessCallback(products)

The success callback for init.

Parameters:
Name Type Description
products Array.<ProductDetails>
Source:

loadProductDetailsSuccessCallback(products)

This is the success callback for loadProductDetails. This will be called when process is successfully finished and will receive a list of valid and loaded products.

Invalid products will not be on this list.

Parameters:
Name Type Description
products Array.<ProductDetails>
Source:

ProductDetails

Properties:
Name Type Description
id string

the product id

type string

type of product, possible values: inapp, subscription

price string

the formatted localized price

priceMicros int

the price in micro amount (2$ ~> 2000000)

currencyCode string

the currency code used for localized price

title string

humanreadable title of product

description string

description of product

Source:

Purchase

Properties:
Name Type Description
id string

populated with orderId (when on PlayStore) or transactionIdentifier (when on iTunes)

originalId string

populated with originalTransaction.transactionIdentifier available only on iOS and only for restored transactions

productId string

the id of the bought product

expirationDate date

the date of expiration for this purchase, only if the product is of subscription type and only as long as this is not past.

verificationPayload string

this is populated with purchaseToken when on PlayStore and with application's receipt when on iTunes. Only set when this data is returned to buy or subscribe success callback.

Source:

restoreSuccessCallback(purchases)

The success callback for restore. This is only available on iOS.

Parameters:
Name Type Description
purchases Array.<Purchase>

the data of purchase

Source:

Generated with wicked.