ActionScript3 Reference
Class PayVault
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 |
|
||
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 |
-- |
PayVault.coins
public |
|
The current coin balance the users PayVault. Can only be read after a successful call of refresh().
PayVault.items
public |
|
All the items currently in the users PayVault. Can only be read after a successful call of refresh().
PayVault.buy
public |
|
Buy items with coins.
Arguments
items:Array | |
An array of object instances; each 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. |
PayVault.consume
public |
|
Consume items from the users vault. This will cause them to be removed from the users vault.
Arguments
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. |
PayVault.count
public |
|
How many items of the given type (itemKey) does the user has in the vault?
Arguments
itemKey:String | |
PayVault.credit
public |
|
Put coins into the users vault
Arguments
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. |
PayVault.debit
public |
|
Take coins out of the users vault
Arguments
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. |
PayVault.first
public |
|
Get the first item of the given type (itemKey)
Arguments
itemKey:String | |
PayVault.getBuyCoinsInfo
public |
|
Gets information about how to make a coin purchase with the specified PayVault provider.
Arguments
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. |
PayVault.getBuyDirectInfo
public |
|
Gets information about how to make a direct item purchase with the specified PayVault provider.
Arguments
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 | |
An array of object instances; each 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. |
PayVault.give
public |
|
Give the user items without taking any of his coins from the vault.
Arguments
items:Array | |
An array of object instances; each 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. |
PayVault.has
public |
|
Does the vault contain at least on item of the given type (itemKey)?
Arguments
itemKey:String | |
PayVault.PayVault
public |
|
Arguments
channel:playerio.utils:HTTPChannel | |
client:playerio:Client | |
PayVault.readHistory
public |
|
Load a page of entries from the users PayVault history in reverse chronological order.
Arguments
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. |
PayVault.refresh
public |
|
Refreshes the Items and Coins from the PayVault.
Arguments
callback:Function (Default = null) | |
method called when request where successful | |
errorHandler:Function (Default = null) | |
method called if an error occurs during the refresh. |
PayVault.usePaymentInfo
public |
|
--
Arguments
provider:String | |
-- | |
providerArguments:Object | |
-- | |
callback:Function (Default = null) | |
-- | |
errorHandler:Function (Default = null) | |
-- |