nov / paypal-express

Ruby Gem for PayPal Express Checkout API
MIT License
373 stars 162 forks source link

Recurring payments (undefined method `closed?' for #<Hash:>) #32

Closed gummybears closed 11 years ago

gummybears commented 11 years ago

When running the example code (see https://github.com/nov/paypal-express/wiki/Recurring-Payment) I suddenly getting errors (since 30 augustus 2012) when making a call to

payment_request = Paypal::Payment::Request.new( :currency_code => :EUR, :billing_type => :RecurringPayments, :billing_agreement_description => "My billing agreement" )

/home/gummybears/bundler/common/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/payload.rb:109:in close': undefined methodclosed?' for #Hash:0xa172b7c (NoMethodError) from /home/gummybears/bundler/common/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:66:in ensure in execute' from /home/gummybears/bundler/common/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:66:inexecute' from /home/gummybears/bundler/common/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in execute' from /home/gummybears/bundler/common/ruby/1.9.1/gems/restclient_with_cert-0.0.8/lib/restclient_with_cert.rb:17:inpost' from /home/gummybears/bundler/common/ruby/1.9.1/gems/paypal-express-0.5.0/lib/paypal/nvp/request.rb:43:in post' from /home/gummybears/bundler/common/ruby/1.9.1/gems/paypal-express-0.5.0/lib/paypal/nvp/request.rb:36:inblock in request' from /home/gummybears/bundler/common/ruby/1.9.1/gems/paypal-express-0.5.0/lib/paypal/nvp/request.rb:47:in handle_response' from /home/gummybears/bundler/common/ruby/1.9.1/gems/paypal-express-0.5.0/lib/paypal/nvp/request.rb:35:inrequest' from /home/gummybears/bundler/common/ruby/1.9.1/gems/paypal-express-0.5.0/lib/paypal/express/request.rb:28:in setup' from recurring.rb:30:in

'

$ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

$ bundle list Gems included by the bundle:

  • Ascii85 (1.0.1)
  • POpen4 (0.1.4)
  • Platform (0.4.0)
  • RedGreen (1.0)
  • actionmailer (3.2.8)
  • actionpack (3.2.8)
  • activemodel (3.2.8)
  • activerecord (3.2.8)
  • activerecord-import (0.2.10)
  • activeresource (3.2.8)
  • activesupport (3.2.8)
  • addressable (2.3.2)
  • arel (3.0.2)
  • attr_required (0.0.5)
  • autotest-standalone (4.5.9)
  • awesome_print (1.0.2)
  • bcrypt-ruby (3.0.1)
  • better-logging (0.0.2)
  • bootstrap-sass (2.0.4.2)
  • builder (3.0.0)
  • bullet (4.1.6)
  • bundler (1.1.4)
  • capybara (1.1.2)
  • childprocess (0.3.5)
  • chromedriver-helper (0.0.5)
  • chronic (0.6.7)
  • coderay (1.0.7)
  • coffee-rails (3.2.2)
  • coffee-script (2.2.0)
  • coffee-script-source (1.3.3)
  • colored (1.2)
  • cucumber (1.2.0)
  • cucumber-rails (1.3.0)
  • daemons (1.1.9)
  • database_cleaner (0.8.0)
  • deadweight (0.2.1)
  • diff-lcs (1.1.3)
  • domain_name (0.5.3)
  • email_spec (1.2.1)
  • erubis (2.7.0)
  • eventmachine (0.12.10)
  • execjs (1.4.0)
  • factory_girl (4.0.0)
  • factory_girl_rails (4.0.0)
  • fakeweb (1.3.0)
  • ffi (1.1.5)
  • foreigner (1.2.1)
  • gherkin (2.10.0)
  • hashery (2.0.1)
  • hike (1.2.1)
  • i18n (0.6.1)
  • immigrant (0.1.2)
  • jasmine (1.2.1)
  • jasmine-core (1.2.0)
  • journey (1.0.4)
  • jquery-rails (2.1.1)
  • jquery-ui-rails (2.0.0)
  • json (1.7.5)
  • kaminari (0.13.0 a8637f2)
  • launchy (2.1.2)
  • libnotify (0.7.3)
  • libv8 (3.3.10.4)
  • libwebsocket (0.1.5)
  • macaddr (1.6.1)
  • mail (2.4.4)
  • mechanize (2.5.1)
  • method_source (0.8)
  • mime-types (1.19)
  • multi_json (1.3.6)
  • mysql2 (0.3.11)
  • net-http-digest_auth (1.2.1)
  • net-http-persistent (2.7)
  • nokogiri (1.5.5)
  • notifier (0.2.1)
  • ntlm-http (0.1.1)
  • open4 (1.3.0)
  • parallel (0.5.18)
  • parallel_tests (0.8.9)
  • paypal-express (0.5.0)
  • pdf-reader (1.2.0)
  • polyglot (0.3.3)
  • prawn (0.12.0)
  • pry (0.9.10)
  • rack (1.4.1)
  • rack-cache (1.2)
  • rack-protection (1.2.0)
  • rack-ssl (1.3.2)
  • rack-test (0.6.1)
  • rails (3.2.8)
  • railties (3.2.8)
  • rake (0.9.2.2)
  • rb-fsevent (0.9.1)
  • rb-inotify (0.8.8)
  • rdoc (3.12)
  • redis (3.0.1)
  • redis-namespace (1.2.1)
  • redisk (0.2.2)
  • resque (1.22.0)
  • resque-status (0.3.3 f466dbc)
  • rest-client (1.6.7)
  • restclient_with_cert (0.0.8)
  • rspec (2.11.0)
  • rspec-core (2.11.1)
  • rspec-expectations (2.11.2)
  • rspec-mocks (2.11.2)
  • rspec-rails (2.11.0)
  • ruby-ole (1.2.11.4)
  • ruby-rc4 (0.1.5)
  • rubyzip (0.9.9)
  • sass (3.2.1)
  • sass-rails (3.2.5)
  • selenium-webdriver (2.25.0)
  • shoulda-matchers (1.3.0)
  • simplecov (0.6.4)
  • simplecov-html (0.5.3)
  • simplecov-rcov (0.2.3)
  • sinatra (1.3.3)
  • slop (3.3.3)
  • spreadsheet (0.7.3)
  • sprockets (2.1.3)
  • systemu (2.5.2)
  • test_notifier (1.0.0)
  • therubyracer (0.10.2)
  • thin (1.4.1)
  • thor (0.16.0)
  • tilt (1.3.3)
  • timecop (0.4.5)
  • treetop (1.4.10)
  • ttfunk (1.0.3)
  • tzinfo (0.3.33)
  • uglifier (1.2.7)
  • unf (0.0.5)
  • unf_ext (0.0.5)
  • uniform_notifier (1.0.2)
  • uuid (2.3.5)
  • vegas (0.1.11)
  • webrobots (0.0.13)
  • whenever (0.7.3)
  • xpath (0.1.4)
  • yui-compressor (0.9.6)
nov commented 11 years ago

Hum, I couldn't reproduce the error on my Mac even with RestClient 1.6.7.

Could you try this test script on your machine? https://gist.github.com/3601298

At this line, you should get StringIO instead of Hash. /home/gummybears/bundler/common/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/payload.rb:109:inclose': undefined method closed?' for #<Hash:0xa172b7c> (NoMethodError)

If you can tell me which gems are recently updated in your project, it might help me too.

gummybears commented 11 years ago

After much digging it seems a new gem hashery was being bundled by the gem pdf-reader. Don't know what it is supposed to do, but by reverting my Gemfile back to a previous commit and running all my rspec tests, the error is gone.

Thanks for your help