Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5 issue #6

Open
k2m30 opened this issue Sep 1, 2016 · 7 comments
Open

Rails 5 issue #6

k2m30 opened this issue Sep 1, 2016 · 7 comments

Comments

@k2m30
Copy link

k2m30 commented Sep 1, 2016

RAILS 5 model:

def stop_recurring!
    Twocheckout::API.credentials = {
        username: ENV['CHECKOUT_USER'],
        password: ENV['CHECKOUT_PASSWORD'],
    }
    begin
      sale = Twocheckout::Sale.find(sale_id: order_number)
      sale.stop_recurring!
    rescue Exception => e
      logger.error e.message
      logger.error e.backtrace
    end
  end

undefined method response for #<NoMethodError:0x007f81470f2dd0> Did you mean? respond_to?

/usr/local/lib/ruby/gems/2.3.0/gems/twocheckout-0.4.0/lib/twocheckout/api.rb:24:in rescue in request'
/usr/local/lib/ruby/gems/2.3.0/gems/twocheckout-0.4.0/lib/twocheckout/api.rb:20:in request'
/usr/local/lib/ruby/gems/2.3.0/gems/twocheckout-0.4.0/lib/twocheckout/sale.rb:5:in find'
/Users/mikhail/projects/trendom/backend/app/models/user.rb:95:in stop_recurring!'
/Users/mikhail/projects/trendom/backend/app/controllers/users_controller.rb:27:in cancel_subscription'


The same in plain irb works perfectly fine

@calebh05
Copy link

calebh05 commented Sep 6, 2016

By chance are you using the responders gem? Others on rails 5 were able to resolve similar errors by adding the responders gem (richpeck/exception_handler#34)

@k2m30
Copy link
Author

k2m30 commented Sep 6, 2016

@calebh05 No, I don't use it directly.
However it is in my Gemfil.lock

    redis-namespace (1.5.2)
      redis (~> 3.0, >= 3.0.4)
    responders (2.2.0)
      railties (>= 4.2.0, < 5.1)
    resque (1.26.0)
      mono_logger (~> 1.0)
      multi_json (~> 1.0)
      redis-namespace (~> 1.3)
      sinatra (>= 0.9.2)
      vegas (~> 0.1.2)

@daareiza
Copy link

daareiza commented Sep 9, 2016

@k2m30, please check your rest-client version, I was able to make a request using rest-client 1.8.0 (was 1.6.7)

@calebh05
Copy link

@k2m30 any luck? I'm also able to make this request using rest-client 1.8.0.

@k2m30
Copy link
Author

k2m30 commented Sep 12, 2016

@daareiza @calebh05 Guys, will check tomorrow.
At the moment I have rest-client (1.6.7)

@frizbee
Copy link

frizbee commented Oct 10, 2016

Same here, gem update rest-client helped
I confirm, It works with 1.8.0

@EnziinSystem
Copy link

EnziinSystem commented Apr 11, 2018

I fixed it, in the Gemfile

...
gem 'netrc', '0.11.0'
gem 'http-cookie', '1.0.3'
gem 'rest-client', '1.8.0'
gem 'twocheckout', '0.4.0'
...

Or install from github.

gem 'twocheckout', git: 'https://github.com/EnziinSystem/2checkout-ruby.git'

https://github.com/EnziinSystem/2checkout-ruby

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants