bigcommerce-api-ruby icon indicating copy to clipboard operation
bigcommerce-api-ruby copied to clipboard

customer.login_token "missing method"

Open uuunk opened this issue 8 years ago • 1 comments

Using the customer login example, customer.login_token returns a NoMethodError.

Expected behavior

Should return JWT

Actual behavior

/Users/lorsbach/.rvm/gems/ruby-2.3.1/gems/hashie-3.5.6/lib/hashie/extensions/method_access.rb:46:in `method_missing': undefined method `login_token' for #<Bigcommerce::Customer:0x007fc0f7e80688> (NoMethodError)

Steps to reproduce behavior

in gemfile: gem 'bigcommerce', '~> 1.0.0'

require 'bigcommerce'

Bigcommerce.configure do |config|
  config.store_hash = ENV['BC_STORE_HASH']
  config.client_id = ENV['BC_CLIENT_ID']
  config.client_secret = ENV['BC_CLIENT_SECRET']
  config.access_token = ENV['BC_ACCESS_TOKEN']
end

puts Bigcommerce::System.time
# Get a customer
puts customer = Bigcommerce::Customer.all(page: 1).first
puts customer.first_name #returns first name correctly

puts Bigcommerce::Customer.methods - Bigcommerce::Resource.methods

# Generate token login url
puts customer.login_token

The methods call above returns: count path find update create all destroy destroy_all delete post get put raw_request

uuunk avatar Oct 02 '17 17:10 uuunk

@uuunk as a temporary solution: gem 'bigcommerce', git: 'https://github.com/bigcommerce/bigcommerce-api-ruby.git', branch: 'master'

illsv avatar Nov 08 '17 12:11 illsv