Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marchbold/bac1a5373f846c55970b to your computer and use it in GitHub Desktop.
Save marchbold/bac1a5373f846c55970b to your computer and use it in GitHub Desktop.
Consuming a purchase
// The service must be setup and a list of products retrieved.
// Make sure you have the following listeners
InAppBilling.service.addEventListener( InAppBillingEvent.CONSUME_SUCCESS, consumePurchase_successHandler );
InAppBilling.service.addEventListener( InAppBillingEvent.CONSUME_FAILED, consumePurchase_failedHandler );
InAppBilling.service.consumePurchase( new PurchaseRequest( productId ) );
...
private function consumePurchase_successHandler( event:InAppBillingEvent ):void
{
trace( "consume success" );
}
private function consumePurchase_failedHandler( event:InAppBillingEvent ):void
{
trace( "consume failed" );
}
// com.distriqt.InAppBilling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment