
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
paypal-sdk-adaptivepayments
Advanced tools
Important: Adaptive Payments is now a limited release product. It is restricted to select partners for approved use cases and should not be used for new integrations without guidance from PayPal.
Please contact PayPal Technical Support for any live or account issues.
Add this line to your application's Gemfile:
gem 'paypal-sdk-adaptivepayments'
And then execute:
$ bundle
Or install it yourself as:
$ gem install paypal-sdk-adaptivepayments
For Rails application:
rails g paypal:sdk:install
For other ruby application, create a configuration file(config/paypal.yml
):
development: &default
username: USERNAME
password: PASSWORD
signature: SIGNATURE
app_id: APP-80W284485P519543T
http_timeout: 30
mode: sandbox
sandbox_email_address: Platform.sdk.seller@gmail.com
# # with certificate
# cert_path: "config/cert_key.pem"
# # with token authentication
# token: TOKEN_AUTHENTICATION
# token_secret: TOKEN_SECRET
# # with Proxy
# http_proxy: http://proxy-ipaddress:3129/
# # with device ip address
# device_ipaddress: "127.0.0.1"
test:
<<: *default
production:
mode: live
username: USERNAME
password: PASSWORD
signature: SIGNATURE
app_id: APP_ID
Load Configurations from specified file:
PayPal::SDK.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
Or without configuration file:
PayPal::SDK.configure(
:mode => "sandbox", # Set "live" for production
:app_id => "APP-80W284485P519543T",
:username => "Replace with API username",
:password => "Replace with API password",
:signature => "Replace with API signature" )
require 'paypal-sdk-adaptivepayments'
PayPal::SDK.configure(
:mode => "sandbox", # Set "live" for production
:app_id => "APP-80W284485P519543T",
:username => "Replace with API username",
:password => "Replace with API password",
:signature => "Replace with API signature" )
@api = PayPal::SDK::AdaptivePayments.new
# Build request object
@pay = @api.build_pay({
:actionType => "PAY",
:cancelUrl => "http://localhost:3000/samples/adaptive_payments/pay",
:currencyCode => "USD",
:feesPayer => "SENDER",
:ipnNotificationUrl => "http://localhost:3000/samples/adaptive_payments/ipn_notify",
:receiverList => {
:receiver => [{
:amount => 1.0,
:email => "platfo_1255612361_per@gmail.com" }] },
:returnUrl => "http://localhost:3000/samples/adaptive_payments/pay" })
# Make API call & get response
@response = @api.pay(@pay)
# Access response
if @response.success? && @response.payment_exec_status != "ERROR"
@response.payKey
@api.payment_url(@response) # Url to complete payment
else
@response.error[0].message
end
Add following line in rails Gemfile
:
gem 'paypal-sdk-adaptivepayments'
gem 'adaptive_payments_samples', :git => "https://github.com/paypal/adaptivepayments-sdk-ruby.git", :group => :development
Configure routes(config/routes.rb
):
mount AdaptivePaymentsSamples::Engine => "/samples" if Rails.env.development?
To get default paypal configuration execute:
rails g paypal:sdk:install
Run rails server
and check the samples.
FAQs
Unknown package
We found that paypal-sdk-adaptivepayments demonstrated a healthy version release cadence and project activity because the last version was released less than 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.