chartmogul / chartmogul-ruby Goto Github PK
View Code? Open in Web Editor NEWChartMogul API Ruby Client
License: MIT License
ChartMogul API Ruby Client
License: MIT License
Howdy! Could you please tag v1.1.9 so v1.1.7...v1.1.9 works, and update the changelog, so we can figure out if the update might impact us?
Look at official doc example:
customer = ChartMogul::Import::Customer.all(external_id:"cus_0001").first
subscription = customer.subscriptions.last
subscription.cancel(Time.utc(2016, 1, 15))
Last line is raising an error:
ChartMogul::SchemaInvalidError: JSON schema validation hasn't passed.
The problem is in this line: https://github.com/chartmogul/chartmogul-ruby/blob/master/lib/chartmogul/api/actions/custom.rb#L14
Thanks))
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>'
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?
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.
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.)
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?
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'
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
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
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?
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?
Hello!
Could you tag and release a new version with #49 please? We see some timeout errors and this would help us a lot to avoid these noisy errors.
Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.