Skip to content

Commit

Permalink
readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Gradidge authored and Matthew Gradidge committed Nov 4, 2009
1 parent 99260fa commit 859c814
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,42 @@ to install
<code>
cd /path/to/paypal_adaptive_gateway
script/install /path/to/active/merchant
</code>
</code>

to use

in application_controller.rb

def gateway
@gateway ||= PaypalAdaptivePaymentGateway.new(
:login => 'your_email',
:password => 'your_password',
:signature => ' your_signature',
:appid => 'your_app_id'
)
end

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 = gateway.pay(
: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
end

to debug

use either gateway.debug or response.debug

0 comments on commit 859c814

Please sign in to comment.