This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* __ __ __ | |
* ____/ /_ ____/ /______ _ ___ / /_ | |
* / __ / / ___/ __/ ___/ / __ `/ __/ | |
* / /_/ / (__ ) / / / / / /_/ / / | |
* \__,_/_/____/_/ /_/ /_/\__, /_/ | |
* / / | |
* \/ | |
* http://distriqt.com | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialise the extension before attempting to refresh the receipt | |
InAppBilling.service.applicationReceipt.addEventListener( ApplicationReceiptEvent.REFRESH_FAILED, refreshFailedHandler ); | |
InAppBilling.service.applicationReceipt.addEventListener( ApplicationReceiptEvent.REFRESH_SUCCESS, refreshSuccessHandler ); | |
InAppBilling.service.applicationReceipt.refresh(); | |
... | |
private function refreshSuccessHandler( event:ApplicationReceiptEvent ):void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.init( APP_KEY ); | |
if (Application.isSupported) | |
{ | |
// | |
// PRINT DEVICE INFORMATION | |
trace( "DEVICE INFO ============================" ); | |
trace( " name: " + Application.service.device.name ); | |
trace( " brand: " + Application.service.device.brand ); | |
trace( " manufacturer: " + Application.service.device.manufacturer ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static const PAYPAL_PRODUCTION_CLIENT_ID : String = "APPLICATION_PRODUCTION_CLIENT_ID"; | |
public static const PAYPAL_SANDBOX_CLIENT_ID : String = "APPLICATION_SANDBOX_CLIENT_ID"; | |
try | |
{ | |
PayPalSDK.init( APP_KEY ); | |
trace( "PayPalSDK Supported: " + PayPalSDK.isSupported ); | |
trace( "PayPalSDK Version: " + PayPalSDK.service.version ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (PayPalSDK.isSupported) | |
{ | |
PayPalSDK.service.addEventListener( PayPalPaymentEvent.COMPLETE, paypal_paymentCompleteHandler ); | |
PayPalSDK.service.addEventListener( PayPalPaymentEvent.CANCELLED, paypal_paymentCancelledHandler ); | |
PayPalSDK.service.addEventListener( PayPalPaymentEvent.ERROR, paypal_paymentErrorHandler ); | |
// Can do this call anywhere before you make a payment, | |
// but PayPal suggest calling it close to the payment/consent calls | |
// as connection is 'short lived' | |
if (PayPalSDK.service.connect( PayPalEnvironment.SANDBOX )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (PayPalSDK.isSupported) | |
{ | |
PayPalSDK.service.addEventListener( PayPalFuturePaymentEvent.COMPLETE, paypal_futurePaymentCompleteHandler ); | |
PayPalSDK.service.addEventListener( PayPalFuturePaymentEvent.CANCELLED, paypal_futurePaymentCancelledHandler ); | |
PayPalSDK.service.addEventListener( PayPalFuturePaymentEvent.ERROR, paypal_futurePaymentErrorHandler ); | |
if (PayPalSDK.service.connect( PayPalEnvironment.NO_NETWORK )) | |
{ | |
PayPalSDK.service.obtainConsentForFuturePayment(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (PayPalSDK.isSupported) | |
{ | |
PayPalSDK.service.addEventListener( PayPalProfileSharingEvent.COMPLETE, paypal_profileSharingCompleteHandler ); | |
PayPalSDK.service.addEventListener( PayPalProfileSharingEvent.CANCELLED, paypal_profileSharingCancelledHandler ); | |
PayPalSDK.service.addEventListener( PayPalProfileSharingEvent.ERROR, paypal_profileSharingErrorHandler ); | |
if (PayPalSDK.service.connect( PayPalEnvironment.NO_NETWORK )) | |
{ | |
var scopes:Vector.<String> = Vector.<String>( [ PayPalAuthScopes.SCOPE_EMAIL, PayPalAuthScopes.SCOPE_ADDRESS ] ); | |
PayPalSDK.service.obtainConsentForProfileSharing( scopes ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest android:installLocation="auto"> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |
<uses-permission android:name="android.permission.VIBRATE" /> | |
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | |
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> | |