Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.