我正嘗試使用Active Merchant和PayPal處理暫存服務器上的付款。我有一切設置如下。使用Active Merchant和PayPal時出現SSL錯誤
- 設置貝寶商家帳戶
- 把憑證到活動商家/貝寶的配置
- 下載PayPal的PEM並把它放在我的服務器上
- 購買並從PositiveSSL
但是,當我運行代碼(下面)時,我收到此錯誤:
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失敗的代碼?