Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- InAppBilling.init( APPLICATION_KEY );
- if (InAppBilling.isSupported)
- {
- trace( "InAppBilling.service.version = " + InAppBilling.service.version );
- InAppBilling.service.addEventListener( InAppBillingEvent.SETUP_SUCCESS, setup_successHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.SETUP_FAILURE, setup_failureHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.PRODUCTS_LOADED, products_loadedHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.PRODUCTS_FAILED, products_failedHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.INVALID_PRODUCT, product_invalidHandler );
- InAppBilling.service.addEventListener( PurchaseEvent.PURCHASE_SUCCESS, purchase_successHandler );
- InAppBilling.service.addEventListener( PurchaseEvent.PURCHASE_PURCHASING, purchase_purchasingHandler );
- InAppBilling.service.addEventListener( PurchaseEvent.PURCHASE_RESTORED, purchase_restoredHandler );
- InAppBilling.service.addEventListener( PurchaseEvent.PURCHASE_CANCELLED, purchase_cancelledHandler );
- InAppBilling.service.addEventListener( PurchaseEvent.PURCHASE_FAILED, purchase_failedHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.RESTORE_PURCHASES_SUCCESS, restorePurchases_successHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.RESTORE_PURCHASES_FAILED, restorePurchases_failedHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.CONSUME_SUCCESS, consumePurchase_successHandler );
- InAppBilling.service.addEventListener( InAppBillingEvent.CONSUME_FAILED, consumePurchase_failedHandler );
- // Set the required service type and call setup
- InAppBilling.service.setServiceType( InAppBillingServiceTypes.GOOGLE_PLAY_INAPP_BILLING );
- InAppBilling.service.setup( GOOGLE_PLAY_INAPP_BILLING_KEY );
- }
- else
- {
- trace( "InAppBilling not supported" );
- }
- }
- catch (e:Error)
- {
- trace( e );
- }
- // com.distriqt.InAppBilling
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement