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. Editing Live Apps are only possible with a PayPal Business Account. If you own one, go to the 4th step, if not click on the link!
  2. Click on Registration and create a Business account.
  3. If you are done, follow the guide from the 5th step.
  4. Log in with your PayPal credentials.
  5. Navigate to https://developer.paypal.com/dashboard/applications/live
  6. There is a Sandbox/Live switch. Make sure “Live” is selected!
  7. Click the “Create App” button under the REST API apps section.
  8. Fill the “App Name” field and click “Create App” button.
  9. Scroll down to “Features” section, and turn off all features. ( If you are trying to set up social login in an existing App, then create a new App, as this App should be used only for social login because some of the non used features might cause scope specific problems. )
  10. Find the “Log in with PayPal” feature and check the checkbox.
  11. Click on the “Advanced Settings” link that you can find below the “Log in with PayPal” feature.
  12. Add the URL to the “Return URL” field that Nextend Social Login suggests at the backend and press “Save“:
  13. Scroll down to “Information requested from customers” section, and tick the “Full Name” field.
  14. If you want to get the email address as well, then don’t forget to tick Email address option. In this case you should also enable the Email scope setting in our PayPal Settings tab. ( If you enabled extra fields on our Sync data tab, don’t forget to tick the other necessary fields either! )
  15. Fill the “Privacy policy URL” and “User agreement URL” fields.
  16. Optional: If you want the unverified PayPal accounts to be able to login with your App, then check the “Enable customers who have not yet confirmed their email with PayPal to log in to your app.” field, too.
  17. When all fields are filled, click “Save” in the modal.
  18. Wait for PayPal to approve the “Log in with PayPal” feature ( this might take up to 7 business days ). The “Approval Status” row will indicate the current status.
  19. Once the “Log in with PayPal” feature is approved, scroll up to the “API credentials” section and find the necessary “Client ID” and “Secret key 1” values, you will need these on the “Settings” tab of the plugin!

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 “API credentials” section.

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.

Address

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

Account status (verified)

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

PayPal account ID (payer ID)

Stores the end user’s external PayPal account ID.

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 Return URL field is not correct for your app. Check the 12th 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 Features section.
-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.