Created
July 9, 2015 06:40
-
-
Save marchbold/c8ad7aa4e587965b6014 to your computer and use it in GitHub Desktop.
Setting up the PayPal Environment and configuration
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 ); | |
| 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