0

I am attempting to set up the WePay API to accept payments on my website via the Embedded Checkout, and I am running into some issues. The website is currently hosted on my local machine for testing and was created in Ruby on Rails (ruby 1.9.3p545 and Rails 3.2.13). I have my own shopping cart system in place, so when the user clicks on the “Checkout” button in the cart, I added the following code in the next controller action:

# set _use_stage to false for live environments
wepay = WePay.new(CLIENT_ID, CLIENT_SECRET, USE_STAGE)

# create the checkout
response = wepay.call('/checkout/create', ACCESS_TOKEN, {
  :account_id         => ACCOUNT_ID,
  :amount             => '24.95',
  :short_description  => 'Software',
  :type               => 'SERVICE'
})

I have done this because the page that loads after the user clicks on “Checkout” will show the WePay iframe, and I need to receive a checkout_id and a checkout_uri before showing the iframe. All of the variables in capital letters are defined in the config\environments\development.rb file and are based on their respective values from my WePay account. Upon clicking the “Checkout” button, I found that the call to /checkout/create fails. I receive the following error message:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

The WePay calls and objects are recognized since I have included the correct WePay gem in my Gemfile.

For reference, the official documentation for WePay's Embedded Checkout can be found here: https://www.wepay.com/developer/process_payments/iframe-checkout

EDIT:

I resolved the issue by following the instructions on the first answer at the following link: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed on WINDOWS

Community
  • 1
  • 1
Alexander
  • 3,959
  • 2
  • 31
  • 58
  • Are you able to make the same call via CURL? It seems like there might be a problem with your development environment. For a sample Rails App that uses WePay-https://github.com/wepay/wefarm – Scott Feinberg Aug 05 '14 at 13:42
  • @ScottFeinberg Thank you for the response. I'm not sure how to make the same call via CURL, so I don't know if it works, but I've looked at all of the WePay support documentation to try to fix the issue, but nothing has worked. I've also tried out the solutions at this SO link to no avail: http://stackoverflow.com/questions/25108440/ruby-certificate-verify-failed-error-on-wepay-embedded-checkout?noredirect=1#comment39133153_25108440 WePay support has ignored my ticket for over two weeks, and this implementation is all I need to finish my website. Any help would be extremely appreciated! – Alexander Aug 08 '14 at 01:24
  • Followed the advice from the answer at the following SO topic: http://stackoverflow.com/questions/14719670/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat – Alexander Aug 08 '14 at 01:36
  • Did the advice to add Certified work? – Scott Feinberg Aug 09 '14 at 20:23
  • Yes! All I did was add the "certified" gem to my Gemfile and run "bundle install." The issue was fixed afterwards! Thank you for following up. – Alexander Aug 09 '14 at 21:10

1 Answers1

0

To recap the fix here-added the 'certified' gem to the Gemfile fixed the problem.

Scott Feinberg
  • 574
  • 4
  • 20