
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
omniauth-paypal-permissions
Advanced tools
Note: This gem is designed to work with OmniAuth 1.0 library.
This gem contains the PayPal permissions service strategy for OmniAuth.
Add to your Gemfile:
gem "omniauth-paypal-permissions"
Then bundle install.
Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb.
Rails.application.config.middleware.use OmniAuth::Builder do
provider :paypal_permissions, {
:mode => "sandbox", # Set "live" for production
:app_id => "APP-80W284485P519543T",
:username => "jb-us-seller_api1.paypal.com",
:password => "WX4WTU3S8MY44S7F",
:signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy"
}, scope: ["ACCESS_BASIC_PERSONAL_DATA","TRANSACTION_SEARCH"]
end
PayPal permissions service information can be found on https://developer.paypal.com/docs/classic/permissions-service/ht_permissions-invoice/
The possible attributes to be returned at the moment are:
info['display_name']
info['email']
info['first_name']
info['last_name']
info['full_name']
info['company_name']
The "ACCESS_BASIC_PERSONAL_DATA" scope must be set for this to work.
Within the OmniAuth auth hash, token and token_secret are set within the credentials hash. For example, in the callback, you could use this to fetch the user's information:
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def paypalpermissions
@credentials = env["omniauth.auth"].credentials
@paypal_config = {
:mode => "sandbox", # Set "live" for production
:app_id => "APP-80W284485P519543T",
:username => "jb-us-seller_api1.paypal.com",
:password => "WX4WTU3S8MY44S7F",
:signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy"
}
@api = ::PayPal::SDK::Permissions::API.new(@paypal_config.merge({
:token => @credentials.token,
:token_secret => @credentials.token_secret
}))
response = @api.get_basic_personal_data({
:attributeList => {
:attribute => [ "http://axschema.org/namePerson/first",
"http://axschema.org/namePerson/last",
"http://schema.openid.net/contact/fullname",
"http://axschema.org/company/name",
"http://axschema.org/contact/email",
"https://www.paypal.com/webapps/auth/schema/payerID" ] } })
if response.success?
# YAY! User data!
else
# BOO :(
end
end
end
This code is open-sourced under the Apache License, a copy of which is available in the LICENSE file.
FAQs
Unknown package
We found that omniauth-paypal-permissions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.