adpative payments (chained)

234 views
Skip to first unread message

Tom

unread,
Jan 9, 2011, 12:08:36 PM1/9/11
to Active Merchant
Hi
I would like to know is adpative chained payments possible with
active merchant? If yes please give a sample rails code to do that.
That will be very helpful. I am totally new to paypal. My rails
version is 2.3.8

Thanks in advance

Scott Windsor

unread,
Jan 9, 2011, 2:04:05 PM1/9/11
to activem...@googlegroups.com
I have a fork of active record with adaptive payments here:
https://github.com/sentientmonkey/active_merchant

From here you can do chained payment with the pay call..
https://github.com/sentientmonkey/active_merchant/blob/9f3c98f484c00d017e6507781a5207e60d692044/lib/active_merchant/billing/gateways/paypal_adaptive_payments.rb#L43

From the documentation:

# gateway.pay [1000, 'fr...@example.com'],
# [2450, 'wi...@example.com', :primary => true],
# [2000, 'bar...@example.com'],
# :sender_email => "jo...@example.com", :return_url =>
"http://example.com/return", :cancel_url =>
"http://example.com/cancel"
#

- scott

> --
> You received this message because you are subscribed to the Google Groups "Active Merchant" group.
> To post to this group, send email to activem...@googlegroups.com.
> To unsubscribe from this group, send email to activemerchan...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/activemerchant?hl=en.
>
>

Tom

unread,
Jan 12, 2011, 3:01:57 AM1/12/11
to Active Merchant
Hi
Dont know my question is relevant. Latest activemerchant version
is 1.9.4. I would like to know how I can use this version and apply
your patches?

Thanks again

Tom

unread,
Jan 12, 2011, 4:38:45 AM1/12/11
to Active Merchant
And one more thing I forgot to ask is do you have patches for
API_VERSION 1.5.0 ?

Scott Windsor

unread,
Jan 13, 2011, 2:26:11 AM1/13/11
to activem...@googlegroups.com
Nope, sorry. I haven't been able to keep up with the lastest version
of activemerchant. You should be able to merge over the changes,
though. Let me know if you run into any issues.

- scott

On Wed, Jan 12, 2011 at 1:38 AM, Tom <to.to...@gmail.com> wrote:
> And one more thing I forgot to ask is do you have patches for
> API_VERSION 1.5.0 ?
>

Tom

unread,
Jan 17, 2011, 4:13:23 AM1/17/11
to Active Merchant
Hi
I first checked out your form and merged with active merchant
latest (1.9.4). And wrote a small sample program as below. But I am
getting error
adaptive.rb:6: uninitialized constant
ActiveMerchant::Billing::PaypalAdaptivePaymentGateway (NameError)

###Sample code###

require "rubygems"
require "/home/tom/PaypalAdaptive/active_merchant/lib/active_merchant"

ActiveMerchant::Billing::Base.mode = :test

gateway = ActiveMerchant::Billing::PaypalAdaptivePaymentGateway.new(
:login => "merchantemailid",
:password => "password",
:signature => "signature"
)

response = gateway.pay [1000, 'receiveremail'],
[2450,'merchantemail', :primary => true], :sender_email =>
"sender_email"
puts response.inspect
if response.success?
puts "Purchase complete!"
else
puts "Error: #{response.message}"
end

##end of sample code##

But I am getting error

adaptive.rb:14: syntax error, unexpected tASSOC, expecting ']'
...itechnologies.in', :primary => true], :sender_email => "sen...



And one more thing. When I tried with
gateway.pay 1000, 'merchantemail', :sender_email => "sender_email"
I am getting error


adaptive.rb:6: uninitialized constant
ActiveMerchant::Billing::PaypalAdaptivePaymentGateway (NameError)


I can't figure out what it is. Please help

Thanks

Scott Windsor

unread,
Jan 17, 2011, 7:49:46 PM1/17/11
to activem...@googlegroups.com
You appear to be requiring rubygems, then requiring your own lib. You
should really install your changes as a new gem, then just load that
gem.

Also, do the unit tests pass? Try running "rake test:units" and see
what you get back.

- scott

Tom

unread,
Jan 18, 2011, 11:09:25 PM1/18/11
to Active Merchant
Hi
Thanks for your reply. But could you please give me some more
guidance doing the above. ie,

> requiring your own lib. You should really install your changes as a new gem
Since a beginner I dont know how to do this
Reply all
Reply to author
Forward
0 new messages