4

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:

enter image description here

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.

Mahdi Hijazi
  • 4,424
  • 3
  • 24
  • 29
  • [Android Paypal Integration: Sandbox to Production](https://stackoverflow.com/questions/19034468/android-paypal-integration-sandbox-to-production) – RonTLV Aug 06 '17 at 12:19

1 Answers1

2

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

Lalit Fauzdar
  • 5,953
  • 2
  • 26
  • 50
  • According to integrations steps here https://github.com/paypal/PayPal-Android-SDK I need to do 2 things: 1. switch the client_id to production one 2. switch ENVIRONMENT_PRODUCTION. it is clear not to me from the above answer what should I do else. I don't have testMode in my Android integration, it seems part of the REST API integration not Android – Mahdi Hijazi Jul 31 '17 at 09:56
  • Try disabling the sandbox mode from the above stackoverflow link. Disabling that will enable your actual credentials. – Lalit Fauzdar Jul 31 '17 at 10:17
  • are you talking about these steps: PayPal account, and clicking Profile > My Selling Tools > API Access > Request/View API Credentials > Request API Signature ? – Mahdi Hijazi Jul 31 '17 at 10:31