Provider – PayPal

PayPal Sample

Table of contents

How to enable PayPal login in WordPress

1. Create a PayPal App

To be able to log in via PayPal you must create a PayPal app first.

  1. Navigate to https://developer.paypal.com/developer/applications/
  2. Log in with your PayPal credentials if you are not logged in.
  3. Scroll down to “REST API apps”.
  4. Click the “Create App” button.
  5. Fill the “App Name” field and click “Create App” button.
  6. Select the “Live” option on the top-right side.
  7. Scroll down to “LIVE APP SETTINGS”, search the “Live Return URL” heading and click “Show”.
  8. Add the following URL to the “Live Return URL” field https://yoursite.com/wp-login.php?loginSocial=paypal, where the yoursite.com is your domain.
  9. Scroll down to “App feature options” section and tick “Log In with PayPal”.
  10. Click “Advanced Options” which can be found at the end of text “Log In with PayPal”.
  11. Tick “Full name” and “Email address”.
  12. Fill “Privacy policy URL” and “User agreement URL”.
  13. When all fields are filled, click “Save”.
  14. Scroll up to “LIVE API CREDENTIALS” section and find the necessary “Client ID” and “Secret”! ( Make sure you are in “Live” mode and not “Sandbox”! ).

2. App setup

Once your PayPal app is ready you’ll need to copy and paste the Client ID and Secret to the PayPal provider’s Settings tab. You can find the information at your PayPal app’s Settings which you can reach from the left sidebar.

3. Verifying

Once your Client ID and Secret has been added you need to verify the setup first. This verification helps you identify possible problems with the app.

Settings

PayPal Settings

Client ID

The Client ID of your PayPal app. You can find it at your App → left menu: Settings.

Secret

The Secret of your PayPal app. You can find it at your App → left menu: Settings.

Email scope

To access to the email of the user an App review is required and the App must be Approved by PayPal.
By disabling this option, the email won’t be requested, so users will be able to login with PayPal even when the App is not approved by PayPal yet.
-Available since: 3.0.15

PayPal Other Settings

Username prefix on Register

Whenever a new user registers with their PayPal account they can get a custom prefix so you can easily identify them.

Fallback username prefix on register

Whenever a new user registers with their PayPal account and we can not generate a valid username from the first name or last name, a random username will be generated. With this option they can get a custom prefix so you can easily identify them.

Terms and conditions

This option can only be seen, if Terms and conditions is set to Show in Global Settings → Privacy tab. Here you can set custom Terms and Conditions for users who register with PayPal. For more information please read our GDPR documentation.

Sync data

By default Nextend Social Login stores the first name, last name, email, avatar url and access token if it is possible, however some additional information can also be retrieved and stored.
When an option is checked, that field will be stored in a meta key with the specified name.

PayPal Sync Data

Sync fields

It determines when the synchronization shall happen.

  • Register: whenever a new user registers with a provider, their data will be retrieved and stored.
  • Login: whenever user logs in with a provider, their data will be retrieved and stored.
  • Link: whenever user links and existing WordPress account with a provider, their data will be retrieved and stored.

Date of birth

Stores the user’s birthday.

Age range

Stores the user’s age range.

Address

Stores the user’s address. The following fields can be stored: street address, locality, region, postal code, country code.

Phone

Stores the user’s phone number.

Account status (verified)

Stores a bool value which represents the verified status of the PayPal account.

Account type

Stores the user’s account type, like Personal, Premier or Business .

Account creation date

Stores the date when the user’s PayPal account was created.

Time zone

Stores the user’s timezone.

Locale

Stores the user’s locale.

Language

Stores the user’s language.

Common error messages returned by PayPal during verification

invalid client_id or redirect_uri

We’re sorry.
Looks like this action is not supported. Please return and report this error so that we can support it in the future. (invalid client_id or redirect_uri)

The problem is that the entered Live Return URL field is not correct for your app. Check the 7th step of the App setup to fix the problem.

It is also possible, that the entered Client ID is not correct. Maybe the app with the entered ID was deleted. Go to the PayPal provider → Settings and make sure that an existing App’s Client ID and Secret was entered.

Invalid client credentials

Error: unauthorized_client: Invalid client credentials

The Secret you copied from the PayPal app is invalid. Make sure the correct one was copied.

Invalid scope

We’re sorry.
Looks like this action is not supported. Please return and report this error so that we can support it in the future. (invalid scope)

-Probably you didn’t tick the Log In with PayPal option under the LIVE APP SETTINGS.
-You didn’t tick the Full name and Email address scope to request the user to share that data with you.
-You didn’t tick the required scope for the selected Sync data option.