x

Getting exception when using Transaction API Charge method on Ruby SDK

Im getting this exception: 

 

Failure when receiving data from the peer

 

When using the Ruby SDK's Transaction API Charge method. The cards get charged, sales appear on dashboard, all ok. But it errors out on the charge call regardless. This did not happen when using the sandbox environment.

 

Using: square_connect (2.0.2.30) gem

 

This is the call that triggers the error:

 

resp = transaction_api.charge(ENV["SQUARE_ACCESS_TOKEN"], locations.locations[0].id, request_body)

 

As mentioned above regardless of error the charge still happens and shows up as sale.

1,286 Views
Message 1 of 3
Report
1 Best Answer

Best Answer

FYI, and for whoever might come across this in the future.

 

This was caused by Heroku cedar-14 stack. It uses a really old version of cURL that was causing the issue. Fixed by changing my Heroku stack to heroku-16 (which is a beta version).

 

You might want to state that on your Ruby SDK docs, as it might affect others running on heroku as well. I tried to create an issue on github but that seems disabled.

 

Thanks for support!

View Best Answer >

1,532 Views
Message 3 of 3
Report
2 REPLIES 2
Alumni

Seems like some kind of system error, since that phrase isn't listed anywhere in the SDK itself. Would you mind setting debugging to true in your SDK, and pasting more of the output? 

 

https://github.com/square/connect-ruby-sdk/blob/1f7fcd62cef9f259ac7575cfc4b0ace7c326113b/lib/square_...

1,252 Views
Message 2 of 3
Report

Best Answer

FYI, and for whoever might come across this in the future.

 

This was caused by Heroku cedar-14 stack. It uses a really old version of cURL that was causing the issue. Fixed by changing my Heroku stack to heroku-16 (which is a beta version).

 

You might want to state that on your Ruby SDK docs, as it might affect others running on heroku as well. I tried to create an issue on github but that seems disabled.

 

Thanks for support!

1,533 Views
Message 3 of 3
Report