So I'have integrated paypal-android-sdk:2.15.3 in my app and it works as expected in Sandbox. Now I want to move to production.
I switched the environment to PayPalConfiguration.ENVIRONMENT_PRODUCTION And the client id to the production client id. What happens is that first I can't login using my real PayPal account, second I see the blue Sandbox button as below screenshot:
my code:
PayPalConfiguration config = new PayPalConfiguration()
.environment(CustomBuildConfig.PAY_PAL_CONFIG_ENVIRONMENT)
.clientId(CustomBuildConfig.PAY_PAL_CONFIG_CLIENT_ID);
PayPalPayment thingToBuy = new PayPalPayment(new BigDecimal(value), currency, item,
PayPalPayment.PAYMENT_INTENT_SALE);
Intent intent = new Intent(getContext(), PaymentActivity.class);
intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);
intent.putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy);
startActivityForResult(intent, REQUEST_CODE_PAYPAL_PAYMENT);
Where:
PAY_PAL_CONFIG_ENVIRONMENT = PayPalConfiguration.ENVIRONMENT_PRODUCTION; PAY_PAL_CONFIG_CLIENT_ID = "production client id";
Edit: Same production client id is already in use and working for the iOS client.
Sandbox mode is the testing mode which works as an actual process without touching any live PayPal account. This is causing the issue that you can't log in with actual credentials because Sandbox enables logging in with test credentials.
So for your credentials to work, you have to disable the sandbox mode.
See here :- Disabling Sandbox mode
Also, read about sandbox in detail :- here and here