Forum: Ruby on Rails Automatically sending a PayPal payment with Ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Commander J. (Guest)
on 2009-01-05 16:54
(Received via mailing list)
I found that Chang Sau S.'s ruby-paypal library can use Mass Payment
( to automatically send money to any
recipient. What's confusing is that the RDoc on the site is from an
version that did not support Mass Payment.

Some older (2006) threads mention they want this, but they were never
resolved. I hope this information will be useful to people that still
have the answer to this.

 == Unofficial guide to sending automatic payments with Ruby

   1. gem install ruby-paypal
   2. require 'ruby-paypal' at the top of your file
   3. Use this example code for a single transaction or create your own:

# Credentials found in environment files.
# def do_mass_payment(payments, email_subject,
payments = []
payments[0] =
payments[0].email =
payments[0].unique_id = 1239829
payments[0].note = "Note"
payments[0].amount =
# Make the call.
response = pp_nvp.do_mass_payment(payments, "Email subject line")
# Update our own administration.
if response.ack == 'Success'
# Do success stuff here

A sidenote:
I could not get the ruby-paypal and the paypal (by Tobias L.) gem to
work on the same Rails installation - they both use a class called
Paypal. I
fixed this by including ruby-paypal in my vendor/ dir and renaming the
Paypal to PaypalNVP. The Money library is included with the 'paypal'
the ruby-paypal) gem.

This topic is locked and can not be replied to.