Hi everyone,
I need to make a server-to-server connection in my rails app to confirm
online credit card payments on the fly. When the confirm payment action
is run it calls a method in the ''Order'' model object, the
model attempts
to make an SSL connection to the payment gateway to confirm the payment
using the following code:
# url: payment gateway domain name
# path: relative path to confirmation script
# params: string of HTTP params
http = Net::HTTP.new(url, 443)
http.use_ssl = true
resp, data = http.post(path, params)
The http.post() call returns the following error:
No such file or directory
/usr/lib/ruby/1.8/net/http.rb:586:in `connect''
/usr/lib/ruby/1.8/net/http.rb:586:in `connect''
/usr/lib/ruby/1.8/net/http.rb:553:in `do_start''
/usr/lib/ruby/1.8/net/http.rb:542:in `start''
/usr/lib/ruby/1.8/net/http.rb:1032:in `request''
/usr/lib/ruby/1.8/net/http.rb:842:in `post''
#{RAILS_ROOT}/app/models/order.rb:59:in `confirm_payment''
#{RAILS_ROOT}/app/controllers/store_controller.rb:221:in
`payment_approved''
Now, the code snippet above works 100% everywhere except when I try to
use it in a Rails app. The only way I can make this work in Rails is to
use nonsecure https rather than SSL, however the payment gateway
requires an SSL POST request to do the confirmation. The error is
obviously SSL specific, I have traced back through the Ruby code as far
as I can, any further entails tracing back through openssl.so. Has
anyone been ably to make this work?
Thanks,
Chris
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---