Pasupathi Rajamanickam
Pasupathi Rajamanickam

Reputation: 2052

PayPal SDK in android

I have imported the PayPalSDKExample and I've set to Sandbox environment, I was trying to execute in Emulator, its saying, "Payment from this device are not allowed"

How to resolve this, for Networkless environment, It was working well.

Upvotes: 1

Views: 1204

Answers (2)

Pablo Pantaleon
Pablo Pantaleon

Reputation: 1536

(Log In - With PayPal account) First enter here: https://developer.paypal.com/webapps/developer/applications/myapps

Then: Choose "Create Application" In this step, you need to choose Mobile SDK insted of Web. Write a name of your app and the press the button 'create'.

Finish this, press in the name of your app and choose REST API CREDENTIALS

inside ther you will see something like: "Test Credentials" and "Live Credentials" in test credentials are client_id tag, well copy that tag, something like:

aafsdsdssdsf3434famAp_o0Rdafadsafa334__O

then in your app have something like and paste the cliend_id here:

// set to PaymentActivity.ENVIRONMENT_LIVE to move real money.
// set to PaymentActivity.ENVIRONMENT_SANDBOX to use your test credentials from https://developer.paypal.com
// set to PaymentActivity.ENVIRONMENT_NO_NETWORK to kick the tires without communicating to PayPal's servers.
private static final String CONFIG_ENVIRONMENT = PaymentActivity.ENVIRONMENT_SANDBOX;

// note that these credentials will differ between live & sandbox environments.
***private static final String CONFIG_CLIENT_ID = "PASTE HERE";***
// when testing in sandbox, this is likely the -facilitator email address. 
private static final String CONFIG_RECEIVER_EMAIL = "matching paypal email address";

finish run your app again.

Remember this code are inside "MainActivity.java" inside PayPalSDK

Upvotes: 1

tomwhipple
tomwhipple

Reputation: 2850

Please make sure that you've set the client_id to the value given to you by https://developer.paypal.com. Note also that there are separate client_id values for production and sandbox.

Upvotes: 1

Related Questions