Description
The PayPal Merchant SDK provides Ruby APIs for processing payments, recurring payments, subscriptions and transactions using PayPal's Merchant APIs, which include Express Checkout, Recurring Payments, Direct Payment and Transactional APIs.
Paypal Merchant SDK alternatives and similar gems
Based on the "E-Commerce and Payments" category.
Alternatively, view Paypal Merchant SDK alternatives based on common mentions on social networks and blogs.
-
Active Merchant
Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways. -
credit_card_validations
:credit_card: ruby gem for validating credit card numbers, generating valid numbers, luhn checks
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Paypal Merchant SDK or a related project?
README
Merchant
The PayPal Merchant SDK provides Ruby APIs for processing payments, recurring payments, subscriptions and transactions using PayPal's Merchant APIs, which include Express Checkout, Recurring Payments, Direct Payment and Transactional APIs.
Support
Please contact PayPal Technical Support for any live or account issues.
Installation
Add this line to your application's Gemfile:
gem 'paypal-sdk-merchant'
And then execute:
$ bundle
Or install it yourself as:
$ gem install paypal-sdk-merchant
Configuration
Please note Rails 4+ is not supported due to backward compatibility concern.
For Rails application:
rails g paypal:sdk:install
For other ruby application, create a configuration file(config/paypal.yml
):
development: &default
username: jb-us-seller_api1.paypal.com
password: WX4WTU3S8MY44S7F
signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
app_id: APP-80W284485P519543T
http_timeout: 30
mode: sandbox
# # with certificate
# cert_path: "config/cert_key.pem"
# # with token authentication
# token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
# token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
# # with Proxy
# http_proxy: http://proxy-ipaddress:3129/
test:
<<: *default
production:
<<: *default
mode: live
Load Configurations from specified file:
PayPal::SDK.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
Example
require 'paypal-sdk-merchant'
PayPal::SDK.configure(
: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::Merchant.new
# Build request object
@do_direct_payment = @api.build_do_direct_payment({
:DoDirectPaymentRequestDetails => {
:PaymentAction => "Sale",
:PaymentDetails => {
:OrderTotal => {
:currencyID => "USD",
:value => "1" },
:NotifyURL => "http://localhost:3000/samples/merchant/ipn_notify" },
:CreditCard => {
:CreditCardType => "Visa",
:CreditCardNumber => "4904202183894535",
:ExpMonth => 12,
:ExpYear => 2022,
:CVV2 => "962" } } })
# Make API call & get response
@response = @api.do_direct_payment(@do_direct_payment)
# Access Response
if @response.success?
@response.TransactionID
else
@response.Errors
end
Samples
Add following line in rails Gemfile
:
gem 'paypal-sdk-merchant'
gem 'merchant_samples', :git => "https://github.com/paypal/merchant-sdk-ruby.git", :group => :development
Configure routes(config/routes.rb
):
mount MerchantSamples::Engine => "/samples" if Rails.env.development?
To get default paypal configuration execute:
rails g paypal:sdk:install
Run rails server
and check the samples.