I am running several issues trying to access the Ruby Paypal Adaptive Payments API.
The main problem I ran into was that Paypal requires their HTTP headers to be in all caches, but Net :: HTTP does not save the case of HTTP headers (it stores them “downcased” and then displays them “uppercase” - - therefore, if you set the header to "X-PAYPAL-SECURITY-USERID", it will be saved as "x-paypal-security-userid" and will be displayed as "X-Paypal-Security-Userid").
I was getting "500000 Internal Server" errors when I tried to use the API with these error headers.
So, I decapitated Net :: HTTP to keep the header case insensitive. But now I get timeout exceptions:
Timeout::Error (execution expired):
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:60:in `rbuf_fill'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:104:in `read_all'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2220:in `read_body_0'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2173:in `read_body'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2198:in `body'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2137:in `reading_body'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1052:in `request'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
So, back to my original question: is access to the adaptive payments API using Ruby successful? If so, what is the secret?
source
share