Packageru.kavolorn.ane
Classpublic class Billing
InheritanceBilling Inheritance flash.events.EventDispatcher

Main library class for Billing native extension.

See also

PRO Native Extensions license server


Public Methods
 MethodDefined By
  
Constructs an extension.
Billing
  
consumePurchase(token:String):void
Consuming purchase.
Billing
  
[static] Gets the main instance to interact with.
Billing
  
getPurchases(purchaseType:String = inapp):void
Gets purchases information.
Billing
  
getSkuDetails(products:Array, productsType:String = inapp):void
Gets products details.
Billing
  
initialize(licenseKey:String):void
Initializes extension.
Billing
  
isSupported():Boolean
Reports if current platform is supported.
Billing
  
purchase(productId:String, productType:String = inapp):void
Purchases a product.
Billing
  
setDebug(debug:Boolean = false):void
[static] Enables or disables debug output.
Billing
Events
 Event Summary Defined By
   Dispatched when purchase was not consumed correctly.Billing
   Dispatched when purchase was consumed.Billing
   Dispatched when purchases list is not received correctly.Billing
   Dispatched when purchases list is received correctly.Billing
   Dispatched if initialization failed.Billing
   Dispatched after successful initialization.Billing
   Dispatched when purchase failed.Billing
   Dispatched when purchase succeeded.Billing
   Dispatched after successful connection to the payments service.Billing
   Dispatched after service disconnect.Billing
   Dispatched when products detail requested and error occurred.Billing
   Dispatched when details about products received.Billing
Constructor Detail
Billing()Constructor
public function Billing()

Constructs an extension. Don't use it directly but use getInstance() instead.


Throws
Error — Context was not created successfully.
Method Detail
consumePurchase()method
public function consumePurchase(token:String):void

Consuming purchase.

Parameters

token:String — purchase token.

getInstance()method 
public static function getInstance():Billing

Gets the main instance to interact with. Don't use constructor.

Returns
Billing — extension instance.
getPurchases()method 
public function getPurchases(purchaseType:String = inapp):void

Gets purchases information.

Parameters

purchaseType:String (default = inapp) — purchases type ('inapp', 'subs').

getSkuDetails()method 
public function getSkuDetails(products:Array, productsType:String = inapp):void

Gets products details.

Parameters

products:Array — array of products ids.
 
productsType:String (default = inapp) — products type ('inapp', 'subs').

initialize()method 
public function initialize(licenseKey:String):void

Initializes extension. Should be called before extension can be used.

Parameters

licenseKey:String — key obtained from license server.

isSupported()method 
public function isSupported():Boolean

Reports if current platform is supported.

Returns
Boolean — is platform supported or not.
purchase()method 
public function purchase(productId:String, productType:String = inapp):void

Purchases a product.

Parameters

productId:String — product id string.
 
productType:String (default = inapp) — product type ('inapp', 'subs').

setDebug()method 
public static function setDebug(debug:Boolean = false):void

Enables or disables debug output.

Parameters

debug:Boolean (default = false) — flag which enables debug output.

Event Detail
consumePurchaseError Event
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.CONSUME_PURCHASE_ERROR

Dispatched when purchase was not consumed correctly.
consumePurchaseSuccess Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.CONSUME_PURCHASE_SUCCESS

Dispatched when purchase was consumed.
getPurchasesError Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.GET_PURCHASES_ERROR

Dispatched when purchases list is not received correctly.
getPurchasesSuccess Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.GET_PURCHASES_SUCCESS

Dispatched when purchases list is received correctly.
initializationError Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.INITIALIZATION_ERROR

Dispatched if initialization failed.
initializationSuccess Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.INITIALIZATION_SUCCESS

Dispatched after successful initialization.
purchaseError Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.PURCHASE_ERROR

Dispatched when purchase failed.
purchaseSuccess Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.PURCHASE_SUCCESS

Dispatched when purchase succeeded.
serviceConnected Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.SERVICE_CONNECTED

Dispatched after successful connection to the payments service.
serviceDisconnected Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.SERVICE_DISCONNECTED

Dispatched after service disconnect.
skuDetailsError Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.SKU_DETAILS_ERROR

Dispatched when products detail requested and error occurred.
skuDetailsSuccess Event  
Event Object Type: ru.kavolorn.ane.BillingEvent
BillingEvent.type property = ru.kavolorn.ane.BillingEvent.SKU_DETAILS_SUCCESS

Dispatched when details about products received.