A wrapper for PayPal's merchant-sdk-ruby library
gem install paypal_merchant
PayPal.mode = "live" # default is "sandbox"
PayPal.username = PAYPAL_USERNAME
PayPal.password = PAYPAL_PASSWORD
PayPal.signature = PAYPAL_SIGNATURE
Or alternatively:
PayPal.configure do |config|
config.mode = "live"
config.username = PAYPAL_USERNAME
config.password = PAYPAL_PASSWORD
config.signature = PAYPAL_SIGNATURE
end
PayPal::Account.balance # => 4831023
charge = PayPal::Charge.create(amount: 1000, card: {number: 4222222222222, exp_month: 12, exp_year: 2018})
charge.success? # => true
transfer = PayPal::Transfer.create(amount: 2000, email: "[email protected]")
transfer.success? # => true