Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save marchbold/c8ad7aa4e587965b6014 to your computer and use it in GitHub Desktop.

Select an option

Save marchbold/c8ad7aa4e587965b6014 to your computer and use it in GitHub Desktop.
Setting up the PayPal Environment and configuration
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 );
if (PayPalSDK.isSupported)
{
// Setup the environments currently supported
// (during testing it is fine to leave the PRODUCTION environment out)
PayPalSDK.service.setEnvironments(
Vector.<PayPalEnvironment>( [
// new PayPalEnvironment( PayPalEnvironment.PRODUCTION, PAYPAL_PRODUCTION_CLIENT_ID ),
new PayPalEnvironment( PayPalEnvironment.SANDBOX, PAYPAL_SANDBOX_CLIENT_ID ),
new PayPalEnvironment( PayPalEnvironment.NO_NETWORK )
])
);
var config:PayPalConfiguration = new PayPalConfiguration();
// Parameters are required for future payments and profile sharing
config.merchantName = "distriqt // airnativeextensions";
config.merchantPrivacyPolicyURL = "http://airnativeextensions.com/privacy";
config.merchantUserAgreementURL = "http://airnativeextensions.com/license";
PayPalSDK.service.setConfiguration( config );
}
}
catch (e:Error)
{
trace( "ERROR::"+e.message );
}
// com.distriqt.PayPalSDK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment