Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differentiate PayPalConfiguration CONFIG_ENVIRONMENT

I am developing app with PayPal integration. While code for Paypal, PayPalConfiguration CONFIG_ENVIRONMENT provide different 3 option to set value for setenvironment(..).

These option are as below:

    //1
    private static final String CONFIG_ENVIRONMENT = PayPalConfiguration.ENVIRONMENT_NO_NETWORK;
    //2
    private static final String CONFIG_ENVIRONMENT = PayPalConfiguration.ENVIRONMENT_PRODUCTION;
    //3
    private static final String CONFIG_ENVIRONMENT = PayPalConfiguration.ENVIRONMENT_SANDBOX;

How different these 3 option while developing and integration paypal in app.

My code where I am configure Paypal.

Code:

private static final String CONFIG_ENVIRONMENT = PayPalConfiguration.ENVIRONMENT_NO_NETWORK;//here set other option

  //private static final String CONFIG_CLIENT_ID = "My client ID";

private static final int REQUEST_CODE_PAYMENT = 11111;

private static PayPalConfiguration config = new PayPalConfiguration()
        .environment(CONFIG_ENVIRONMENT)
        .clientId(CONFIG_CLIENT_ID)
        // The following are only used in PayPalFuturePaymentActivity.
        .merchantName("Merchant Name here")
        .merchantPrivacyPolicyUri(Uri.parse("https://www.example.com/privacy"))
        .merchantUserAgreementUri(Uri.parse("https://www.example.com/legal"));
like image 396
pRaNaY Avatar asked Dec 07 '25 05:12

pRaNaY


1 Answers

ENVIRONMENT_NO_NETWORK

Used for fake transactions only.

The SDK will not attempt to contact PayPal's servers with this option.

ENVIRONMENT_SANDBOX

Used for development and testing.

Sandbox transactions can be seen in the dashboard.

ENVIRONMENT_PRODUCTION

Real money will be moved using this option.

like image 176
Sandy Avatar answered Dec 09 '25 15:12

Sandy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!