Petep
March 28, 2008, 7:39am
1
Hello,
We have global customers, and we’re planning on using Worldpay since
they could upgrade us to Bibit quite easily. However, Active Merchant
doesn’t have a rails plugin yet. Therefore, we’re going to use PayPal
for now.
Could anyone suggest a payment gateway with a rails plugin that can
handle international payments?
Thanks,
Pete
Petep
March 28, 2008, 11:00am
2
we implemented this for ruby within a week or so.
the basic interface is quite simple. to start a payment you would do
something like this:
def self.open_with_ssl(url)
WWW::Mechanize.new.post(url).body
end
def self.new_payment_cluster(basket)
basket.update_attributes({:payment_code =>
“tdps_#{basket.id}_#{basket.payment_iterations + 1}”,
:payment_iterations => basket.payment_iterations + 1})
open_with_ssl(“#{TDPS_URL}”
<< “?command=new_payment_cluster”
<< “&merchant_name=#{TDPS_MERCHANT_NAME}”
<< “&merchant_password=#{TDPS_MERCHANT_PASSWORD}”
<< “&merchant_transaction_id=#{u basket.payment_code}”
<< “&profile=menu”
<< “&client_id=usr#{u basket.user.id}”
<< “&price=#{u(‘%01.2f’ % basket.total_to_pay)}”
<< “&cur_price=EUR”
<< “&client_email=#{u basket.user.email}”
<< “&client_firstname=#{u basket.user.first_name}”
<< “&client_initials=#{u basket.user.first_name[0,1]}#{u
basket.user.name[0,1]}”
<< “&client_lastname=#{u basket.user.name}”
<< “&client_address=#{u basket.user.address_one}”
<< “&client_zip=#{u basket.user.zip}”
<< “&client_city=#{u basket.user.city}”
<< “&client_country=#{u basket.user.country.iso}”
<< “&client_language=EN”
<< “&days_pay_period=0”)
end
most other functions are called the same way. and you can implement
simple callbacks that get status changes of your payment processes.