PayPal IPN without activemerchant, please

Please could someone explain the communication with PayPal for IPN
without activemerchant plugin. I couldn’t get that to work. It should be
a matter of a few lines of code so why use a plugin.

This is what I have:

@query = ‘cmd=_notify-validate’
request.params.each_pair {|key, value| @query = @query + ‘&’ + key + ‘=’

  • value.first if key != ‘register/pay_pal_ipn.html/pay_pal_ipn’ }
    http = Net::HTTP.new(‘www.sandbox.paypal.com’, 443)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_PEER
    http.ca_file = “#{RAILS_ROOT}/lib/paypal/paypal_cert.pem”

What about this setup? Is it ok? Please, could someone help?

The log says it can’t verify the certficate and if I take that away I
get “Errno::ECONNRESET (Connection reset by peer)”

Btw, I don’t have SSL on our server, yet.

Pål Bergström wrote:

I get “certificate verify failed”. Do I really need a certificate on my
end in order to post to the PayPal server?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs