Namespace: playerio
Language: ActionScript 3
Provides access to the PayVault service provided by Player.IO.
Properties | |||
|---|---|---|---|
| public |
The current coin balance the users PayVault. Can only be read after a successful call of refresh(). |
||
| public |
All the items currently in the users PayVault. Can only be read after a successful call of refresh(). |
||
Methods | |||
| public |
Buy items with coins. |
||
| public |
Consume items from the users vault. This will cause them to be removed from the users vault. |
||
| public |
How many items of the given type (itemKey) does the user has in the vault? |
||
| public |
Put coins into the users vault |
||
| public |
Take coins out of the users vault |
||
| public |
Get the first item of the given type (itemKey) |
||
| public |
Gets information about how to make a coin purchase with the specified PayVault provider. |
||
| public |
Gets information about how to make a direct item purchase with the specified PayVault provider. |
||
| public |
Give the user items without taking any of his coins from the vault. |
||
| public |
Does the vault contain at least on item of the given type (itemKey)? |
||
| public |
Load a page of entries from the users PayVault history in reverse chronological order. |
||
| public |
Refreshes the Items and Coins from the PayVault. |
||
| public |
|
The current coin balance the users PayVault. Can only be read after a successful call of refresh().
| public |
|
All the items currently in the users PayVault. Can only be read after a successful call of refresh().
| public |
|
Buy items with coins.
| items:Array | |
| Each BuyItemInfo instance contains the key of the item to buy in the PayVaultItems BigDB table and any additional payload. | |
| storeItems:Boolean | |
| If true, the items will be stored in the users vault, if false, it's the same as using an item directly after purchase. | |
| callback:Function (Default = null) | |
| method called when request where successful. | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
Consume items from the users vault. This will cause them to be removed from the users vault.
| items:Array | |
| The items to use from the users vault - this should be instances from the .Items array property. | |
| callback:Function (Default = null) | |
| method called when request where successful. | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
How many items of the given type (itemKey) does the user has in the vault?
| itemKey:String | |
| public |
|
Put coins into the users vault
| amount:uint | |
| The amount of coins to put into the users vault. | |
| reason:String | |
| Any string you'll later wish to retrieve with the ReadHistory() method. | |
| callback:Function (Default = null) | |
| method called when request where successful. | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
Take coins out of the users vault
| amount:uint | |
| The amount of coins to take out of the users vault. | |
| reason:String | |
| Any string you'll later wish to retrieve with the ReadHistory() method. | |
| callback:Function (Default = null) | |
| method called when request where successful. | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
Get the first item of the given type (itemKey)
| itemKey:String | |
| public |
|
Gets information about how to make a coin purchase with the specified PayVault provider.
| provider:String | |
| Gets information about how to make a coin purchase with the specified PayVault provider. | |
| purchaseArguments:Object | |
| Any additional information that will be given to the PayVault provider to configure this purchase. | |
| callback:Function (Default = null) | |
| method called when request where successful. An object with provider specific arguments are returned to the callback. function(o:Object){...} | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
Gets information about how to make a direct item purchase with the specified PayVault provider.
| provider:String | |
| The name of the PayVault provider to use for the coin purchase. | |
| purchaseArguments:Object | |
| Any additional information that will be given to the PayVault provider to configure this purchase. | |
| items:Array | |
| Each BuyItemInfo instance contains the key of the item to buy and any additional payload. | |
| callback:Function (Default = null) | |
| method called when request where successful. An object with provider specific arguments are returned to the callback. function(o:Object){...} | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
Give the user items without taking any of his coins from the vault.
| items:Array | |
| Each BuyItemInfo instance contains the key of the item to give in the PayVaultItems BigDB table and any additional payload. | |
| callback:Function (Default = null) | |
| method called when request where successful. | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
Does the vault contain at least on item of the given type (itemKey)?
| itemKey:String | |
| public |
|
Load a page of entries from the users PayVault history in reverse chronological order.
| page:uint | |
| The id of the page to load. The first page is id 1. | |
| pageSize:uint | |
| The amount of entries for each page. | |
| callback:Function (Default = null) | |
| method called when request where successful. An array if PayVaultHistoryEntry elements is returned to the callback function(history:Array){...} | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |
| public |
|
Refreshes the Items and Coins from the PayVault.
| callback:Function (Default = null) | |
| method called when request where successful | |
| errorHandler:Function (Default = null) | |
| method called if an error occurs during the refresh. |