Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIBillingAndroid Class Reference

Inherits MOAIGlobalClass< TYPE, SUPER >.

List of all members.

Function List

  checkBillingSupported
  confirmNotification
  getUserId
  requestPurchase
  restoreTransactions
  setBillingProvider
  setPublicKey
  checkInAppSupported
  checkSubscriptionSupported
  consumePurchaseSync
  getPurchasedProducts
  purchaseProduct
  requestProductsSync

Function Documentation

Check to see if the currently selected billing provider is available.


function checkBillingSupported ()
Returns:
success ( boolean )

Check to see if the device can get in app billing.


function checkInAppSupported ()
Returns:
success ( boolean )

Check to see if the device can get subscription billing.


function checkSubscriptionSupported ()
Returns:
success ( boolean )

Confirm a previously received notification. Only applies to the Google Play billing provider.


function confirmNotification ( string notification )
Parameters:
notification ( string ) The notification ID to confirm.
Returns:
success ( boolean )

Consumes a purchase.


function consumePurchaseSync ( string token )
Parameters:
token ( string )
Returns:
nil

Gets the user's purchased products.


function getPurchasedProducts ( number type [, string continuation ] )
Parameters:
type ( number )
continuation ( string ) Optional.
Returns:
products ( string )

Get the ID of the current user for the currently selected billing provider. Only applies to the Amazon billing provider.


function getUserId ()
Returns:
success ( boolean )

Starts a purchase intent for the desired product.


function purchaseProduct ( string sku, number type [, string devPayload ] )
Parameters:
sku ( string )
type ( number )
devPayload ( string ) Optional.
Returns:
nil

Gets the products from Google Play for the current app.


function requestProductsSync ( table skus, number type )
Parameters:
skus ( table )
type ( number )
Returns:
products ( string )

Request the purchase of an item.


function requestPurchase ( string sku [, string payload ] )
Parameters:
sku ( string ) The SKU to purchase.
payload ( string ) Optional. The request payload to be returned upon request completion. Default is nil.
Returns:
success ( boolean )

Request the restoration of any previously purchased items.


function restoreTransactions ( [ string offset ] )
Parameters:
offset ( string ) Optional. The offset in the paginated results to start from. Only applies to the Amazon billing provider. Default is nil.
Returns:
success ( boolean )

Set the billing provider to use for in-app purchases.


function setBillingProvider ( number provider )
Parameters:
provider ( number ) The billing provider.
Returns:
success ( boolean )

Set the public key to be used for receipt verification. Only applies to the Google Play billing provider.


function setPublicKey ( string key )
Parameters:
key ( string ) The public key.
Returns:
nil