Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (42 sloc) 1.54 KB
Paypal Adaptive Payments Library for ActiveMerchant
Supports payments, preapprovals, refunds and currency conversions
.Rails 2.3.x
.ActiveMerchant 1.5.x
to install
git clone git://
cd /path/to/paypal_adaptive_gateway
./script/install /path/to/active/merchant
to use
in application_controller.rb
def gateway
@gateway ||=
:login => 'your_email',
:password => 'your_password',
:signature => ' your_signature',
:appid => 'your_app_id'
in the payment process
#for chained payments
def checkout
recipients = [{:email => 'receiver_email',
:amount => some_amount,
:primary => true},
{:email => 'receiver_email',
:amount => recipient_amount,
:primary => false}
response =
:return_url => url_for(:action => 'action', :only_path => false),
:cancel_url => url_for(:action => 'action', :only_path => false),
:notify_url => url_for(:action => 'notify_action', :only_path => false),
:receiver_list => recipients
redirect_to response.redirect_url_for
set the :primary flag to false for each recipient for a split payment
to debug
use either gateway.debug or response.debug this gives you the json response, the xml sent and the url it was posted to.