David
David

Reputation: 37596

Unauthorized Device - Payment from this device are not allowed

Running the Paypal Sample app, on Nexus4 - 4.3, Using PayPal SDK for Android. The sample works perfect with when the below code is added:

CONFIG_ENVIRONMENT = PaymentActivity.ENVIRONMENT_NO_NETWORK;

When switching to real money:

CONFIG_ENVIRONMENT = PaymentActivity.ENVIRONMENT_PRODUCTION;
CONFIG_CLIENT_ID = "Afa................c";
CONFIG_RECEIVER_EMAIL = "[email protected]";

I'm getting next error: "Payment from this device are not allowed", And the log shows next line:

W/DefaultRequestDirector﹕ Authentication error: Unable to respond to any of these challenges: {}

what is the problem?

enter image description here

Upvotes: 4

Views: 3093

Answers (3)

Rumit Patel
Rumit Patel

Reputation: 12579

In my case, It was just a Wifi - network problem. First, try to change the network or use mobile data and then go for other solutions.

  • It was throwing the same error in Android-studio logs as well on a computer browser.

Logs:

<HTML><HEAD>
    <TITLE>Access Denied</TITLE>
    </HEAD><BODY>
    <H1>Access Denied</H1>

    You don't have permission to access "http&#58;&#47;&#47;api&#45;m&#46;sandbox&#46;paypal&#46;com&#47;v1&#47;oauth2&#47;token" on this server.<P>
    Reference&#32;&#35;18&#46;15367c68&#46;1564405918&#46;472e4813
    </BODY>
    </HTML>

On a computer browser:

enter image description here

Upvotes: 0

Shailendra Madda
Shailendra Madda

Reputation: 21551

Me too faced similar issue, but I solved it by changing my ENVIRONMENT_PRODUCTION to ENVIRONMENT_SANDBOX (Because I am using it only for testing purpose)and added my CONFIG_CLIENT_ID by login in paypall

  • Please double check that you're using the correct environment extra (EXTRA_PAYPAL_ENVIRONMENT). Note that there are separate client_id values for ENVIRONMENT_PRODUCTION and ENVIRONMENT_SANDBOX.

Upvotes: 0

Jeff Brateman
Jeff Brateman

Reputation: 3277

Jeff here from PayPal. Please double check that you're using the correct clientId. When you signed up at developer.paypal.com, generally the sandbox credentials are immediately provided. Only after vetting, will your app be given a production clientId. Please see a similar issue in GitHub for more thorough information.

Also, if you can, please investigate the Android logs for more information. If you see a 401, then you're definitely providing an invalid clientId / environment combination.

Upvotes: 1

Related Questions