Giter VIP home page Giter VIP logo

chartmogul-ruby's People

Contributors

briwa avatar diego-aslz avatar dimitrioslisenko avatar dina920 avatar dmitrydrobotov avatar eagleas avatar hassansin avatar ikanade avatar jasonl avatar jessicahearn avatar juanitofatas avatar kkdoo avatar kmossco avatar kremalicious avatar kshilovskiy avatar mariabraganca avatar ntomas avatar pabragin avatar pkopac avatar polis80cy avatar sbrych avatar soeunsona avatar spyrbri avatar srikalab avatar swember avatar uladzimiro avatar viktorchukhantsev avatar ytvinay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chartmogul-ruby's Issues

Error on any request

Hi,
Ruby 2.3.7
Faraday: 0.11.0

I am getting similar errors on any request in the API. Any ideas. Maybe some Faraday version problems?

ChartMogul::Ping.ping
ChartMogul::ChartMogulError: undefined method `retry_statuses=' for #<Faraday::Request::Retry::Options:0x00007fc4db982360>
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/chartmogul-ruby-1.2.0/lib/chartmogul/api_resource.rb:76:in `handle_other_error'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/chartmogul-ruby-1.2.0/lib/chartmogul/api_resource.rb:47:in `rescue in handling_errors'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/chartmogul-ruby-1.2.0/lib/chartmogul/api_resource.rb:42:in `handling_errors'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/chartmogul-ruby-1.2.0/lib/chartmogul/api/actions/custom.rb:20:in `custom_without_assign!'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/chartmogul-ruby-1.2.0/lib/chartmogul/api/actions/custom.rb:30:in `custom!'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/chartmogul-ruby-1.2.0/lib/chartmogul/ping.rb:11:in `ping'
	from (irb):5
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/railties-5.0.7.1/lib/rails/commands/console.rb:65:in `start'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/railties-5.0.7.1/lib/rails/commands/console_helper.rb:9:in `start'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/railties-5.0.7.1/lib/rails/commands/commands_tasks.rb:78:in `console'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/railties-5.0.7.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
	from /Users/tvollmer/.rvm/gems/ruby-2.3.7/gems/railties-5.0.7.1/lib/rails/commands.rb:18:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'

Update faraday dependency?

Chartmogul depends on an old version of faraday: faraday (~> 0.15.0)

This is causing conflicts with other installed gems.

Are there any plans for upgrading to a most recent version of faraday?

Cannot call find_by_external_id

Hi, I've recently upgraded from a pre 1.0.0 version of this gem and I now receive errors when I make calls to find customers.

undefined method `first' for #<ChartMogul::Customer:0x007f2c416c1050>
/gems/chartmogul-ruby-1.0.0/lib/chartmogul/customer.rb:26 in find_by_external_id

What is the upgrade process for data which is stored in the import API? - I simply replaced calls from the ChartMogul::Import namespace with the ChartMogul version as per the diff.

v1.1.6 has bad permissions

The gem tarball for v1.1.6 has only user read permissions:

chartmogul-1.1.6 % ls -lA . lib
-rwx------@ 1 sj26  staff    93 15 Mar 02:10 .gitignore
-rwx------@ 1 sj26  staff    31 15 Mar 02:10 .rspec
-rwx------@ 1 sj26  staff    99 15 Mar 02:10 .travis.yml
-rwx------@ 1 sj26  staff   100 15 Mar 02:10 Gemfile
-rwx------@ 1 sj26  staff  1081 15 Mar 02:10 LICENSE.txt
-rwx------@ 1 sj26  staff  4029 15 Mar 02:10 README.md
-rwx------@ 1 sj26  staff   114 15 Mar 02:10 Rakefile
drwxr-xr-x  4 sj26  staff   128 22 Mar 14:46 bin
-rwx------@ 1 sj26  staff   898 15 Mar 02:10 changelog.md
-rwx------@ 1 sj26  staff  1126 15 Mar 02:10 chartmogul-ruby.gemspec
drwxr-xr-x  3 sj26  staff    96 22 Mar 14:46 fixtures
drwxr-xr-x  4 sj26  staff   128 22 Mar 14:46 lib

lib:
total 8
drwxr-xr-x  24 sj26  staff   768 22 Mar 14:46 chartmogul
-rwx------@  1 sj26  staff  2248 15 Mar 02:10 chartmogul.rb

This means if you install the gems as one user then run an app with another user, say in a Linux deployment environment, the gem cannot be loaded. You should probably make sure these files are group and world readable when packaging the gem.

(chmod -Rc g+rX,o+rX . in your git directory before packaging the gem would do the trick.)

Threadsafety: ChartMogul::ChartMogulError: Configuration for account_token not set

We've started getting this error sporadically, after upgrading from 1.5.2 to 1.6.2:

ChartMogul::ChartMogulError: Configuration for account_token not set

In our application.rb file, Chartmogul is configured this way:

    # ChartMogul
    config.after_initialize do
      ChartMogul.account_token = Core.config.chart_mogul_account_token
      ChartMogul.secret_key = Core.config.chart_mogul_secret_key
    end

These settings are always available when we run a Rails console, but the error crops up pretty often when we make ChartMogul calls in web and background processes.

I think it might have to do with the change to enable thread safety, leading to the settings being present for some threads but not others. Could you clarify how the configuration is supposed to work in a multi-threaded environment?

Server error in subscription.cancel

Hi, we've started getting this issue when trying to cancel a subscription, this code work previously:

> ChartMogul::Subscription.all(customer_uuid).first
=> #<ChartMogul::Subscription:0x000055ede4b7ebe8
 @cancellation_dates=[],
 @data_source_uuid="ds_redacted-1ae8-46d9-b24d-a8474ebefa21",
 @external_id="sub_custom_fah_b_2688",
 @plan_uuid="pl_redacted-744f-48f4-a384-b557ff203b67",
 @uuid="sub_redacted-6db3-4f97-b34d-669cd6f2d7c2">

> ChartMogul::Subscription.all(customer_uuid).first.cancel(Time.now)
ChartMogul::ServerError: ChartMogul API server response error (HTTP Status: 500)
Response: {"error":"Internal server error"}
from /app/vendor/bundle/ruby/2.5.0/gems/chartmogul-ruby-1.5.1/lib/chartmogul/api_resource.rb:71:in `handle_request_error'
Caused by Faraday::ClientError: the server responded with status 500
from /app/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/lib/faraday/response/raise_error.rb:15:in `on_complete'

Fix flacky spec with seed=28561

Running specs with seed=28561 fails.

Failures:

  1) ChartMogul::PlanGroup API interactions deletes a plan group
     Failure/Error: raise ChartMogul::ChartMogulError, exception.message

     ChartMogul::ChartMogulError:
       Configuration for account_token not set
     # ./lib/chartmogul/api_resource.rb:81:in `handle_other_error'
     # ./lib/chartmogul/api_resource.rb:49:in `rescue in handling_errors'
     # ./lib/chartmogul/api_resource.rb:44:in `handling_errors'
     # ./lib/chartmogul/api/actions/create.rb:27:in `create!'
     # ./spec/chartmogul/plan_group_spec.rb:8:in `block (3 levels) in <top (required)>'
     # ./spec/chartmogul/plan_group_spec.rb:16:in `block (3 levels) in <top (required)>'
     # ./spec/chartmogul/plan_group_spec.rb:32:in `block (3 levels) in <top (required)>'
     # ./spec/chartmogul/plan_group_spec.rb:99:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # ChartMogul::ConfigurationError:
     #   Configuration for account_token not set
     #   ./lib/chartmogul/config_attributes.rb:9:in `block in config_accessor'

Finished in 0.59183 seconds (files took 1.58 seconds to load)
215 examples, 1 failure

Failed examples:

rspec ./spec/chartmogul/plan_group_spec.rb:98 # ChartMogul::PlanGroup API interactions deletes a plan group

Randomized with seed 28561

undefined method `global_api_key=' for ChartMogul:Module (NoMethodError)

Hello, im trying to implement ChartMogul in a RoR application and I'm getting the below error when I try to set the global_api_key, any ideas on how to fix that?

undefined method global_api_key=' for ChartMogul:Module (NoMethodError)`

ruby 2.6.6
rails 4.2.11.3
gem 'chartmogul-ruby', require: 'chartmogul'

ChartMogul.global_api_key = <KEY>

config/initializers/chartmogul.rb

Faraday 2.0 support?

Chartmogul depends on an old version of faraday: faraday (~> 1.0)

This is causing conflicts with other installed gems.

Are there any plans for upgrading to allow support for Faraday 2.0?

Getting undefined method `api_key=' for ChartMogul:Module (NoMethodError)

Hello,

I'm trying to use the gem in a Ruby on Rails 6.0.0 project with Ruby 2.5.0 but I'm getting this error: undefined method `api_key=' for ChartMogul:Module (NoMethodError)

I'm placing a file named chartmogul.rb with the following content:
ChartMogul.api_key = '<API key goes here>'

Is there anything that I'm doing wrong? Or the gem doesn't work with the version of Rails/Ruby that I'm using?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.