Problem getting encrypted submit buttons working with the pa

I’m running Rails 1.1.2, and using version 1.9.0 of the paypal gem.
When I make unencrypted paypal forms, they work just fine, I get the
IPN notification from the sandbox and everything is wonderful. When I
try to encrypt the form though, all I get is the error message “We
were unable to authorize the transaction. Please contact your
merchant.”, which is … unhelpful.

I generated a key and public certificate with the following ssl

openssl genrsa -out business_key.pem 1024
openssl req -new -key business_key.pem -x509 -days 3650 -out

I load the keys with the following code in my controller
@our_privatekey = File::read("#{RAILS_ROOT}/config/
@our_pubcert = File::read("#{RAILS_ROOT}/config/business_cert.pem")

and confirmed via that I’m loading the correct data from
the files.

I use them in my form view like so:

<%= paypal_setup @invoice_id, Money.us_dollar(@pp_amount_owed),
@paypal_to, :business_key => @our_privatekey, :business_cert =>
@our_pubcert, :business_certid => @our_certid, :return =>
@pp_return, :item_name => @pp_item_name, :notify_url => url_for
(:only_path => false, :action => ‘paypal_ipn’) %>

I set the certificate ID to the ID showing in my sandbox user’s
Encrypted payment settings after uploading the key.

Any suggestions about what I’m doing wrong? Also, is there any way to
get the paypal sandbox to give more useful debugging information?


Joe B. [email protected]

Computer Science is about lofty design goals and algorithmic
optimization. System Administration is about cleaning up the
resulting mess.

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