Login with Paypal, userinfo not returning Full Name or Email

tsango
Contributor
Contributor

This call  https://api-m.sandbox.paypal.com/v1/identity/oauth2/userinfo?schema=openid  Returns : object(stdClass)[13]
public 'user_id' => string 'https://www.paypal.com/webapps/auth/identity/user/YO7dT0giXc1jMlyZFS_78i0nRRU6CEEMJq6EMlywi9w' (length=93)
public 'sub' => string 'https://www.paypal.com/webapps/auth/identity/user/YO7dT0giXc1jMlyZFS_78i0nRRU6CEEMJq6EMlywi9w' (length=93)
public 'address' =>
object(stdClass)[14]
public 'postal_code' => string '<removed>' (length=5)
public 'country' => string 'US' (length=2)
public 'state' => string 'CA' (length=2)
public 'street1' => string '<removed' (length=9)
public 'city' => string 'San Jose' (length=8) I have all the scope selected in the app I set up. I haven't a clue how to get the rest of the info. Any ideas and help gratefully appreciated.

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

tsango
Contributor
Contributor

Ok I solved this literally 5 minutes later. I will leave the post up and my solution for anyone else maybe having a similar issue

 

The scope also had to be set in the login button script as per highlighted in red below. Silly mistake but cost me a day!!

 

paypal.use( ['login'], function (login) {
    login.render ({
        "appid":"<app id>,
        "authend":"sandbox",
        "scopes":"openid profile email address",
        "containerid":"paypalLogin",
        "responseType":"code",
        "locale":"en-us",
        "buttonType":"LWP",
        "buttonShape":"pill",
        "buttonSize":"lg",
        "fullPage":"true",
        "returnurl":"<return url>"
    });

View solution in original post

Login to Me Too
1 REPLY 1
Solved

tsango
Contributor
Contributor

Ok I solved this literally 5 minutes later. I will leave the post up and my solution for anyone else maybe having a similar issue

 

The scope also had to be set in the login button script as per highlighted in red below. Silly mistake but cost me a day!!

 

paypal.use( ['login'], function (login) {
    login.render ({
        "appid":"<app id>,
        "authend":"sandbox",
        "scopes":"openid profile email address",
        "containerid":"paypalLogin",
        "responseType":"code",
        "locale":"en-us",
        "buttonType":"LWP",
        "buttonShape":"pill",
        "buttonSize":"lg",
        "fullPage":"true",
        "returnurl":"<return url>"
    });
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.