【发布时间】:2012-09-28 06:39:08
【问题描述】:
我正在尝试使用 Active Merchant 和 PayPal 在暂存服务器上处理付款。我的一切设置如下。
- 设置 PayPal 商家帐户
- 将凭据放入活动商家/PayPal 配置中
- 已下载 PayPal PEM 并将其放在我的服务器上
- 从 PositiveSSL 购买并上传了 SSL 证书
但是,当我运行代码(如下)时,我收到此错误:
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: sslv3 alert handshake failure
这是我正在使用的代码
ActiveMerchant::Billing::PaypalGateway.pem_file = File.read("#{Rails.root}/config/cert_key_pem.pem")
@credit_card ||= ActiveMerchant::Billing::CreditCard.new(:brand => "Visa", :number => "4242424242424242", :verification_value => "123", :month => "11", :year => "2016", :first_name => "John", :last_name => "Doe")
gateway = ActiveMerchant::Billing::PaypalGateway.new(:login => "sales_api1.example.com", :password => "password")
response = gateway.authorize(150, @credit_card, :ip=>"123.123.123.1")
有人遇到过这个问题或知道 SSL 失败的解决方案吗?
【问题讨论】:
标签: ruby-on-rails ruby ssl paypal activemerchant