History of ChargifyApiAresGem

HomePage | RecentChanges | Preferences

Revision 20 . . December 21, 2019 2:38 pm by 78-93-98-198.dsl.wavetel.us
Revision 19 . . May 28, 2016 4:23 pm by Wendy

Difference (from prior major revision) (no other diffs)

Changed: 1,76c1

Chargify API Active Resource Gem

CI: https://travis-ci.org/chargify/chargify_api_ares/ (is it running the remote tests?)

Working on https://github.com/chargify/chargify_api_ares/issues/100

* http://api.rubyonrails.org/v2.3.8/classes/ActiveResource/Base.html#M001286
* http://api.rubyonrails.org/v2.3.8/classes/ActiveResource/CustomMethods.html
* https://docs.chargify.com/api-subscriptions#api-usage-json-subscriptions-update

Updating my fork
* https://help.github.com/articles/configuring-a-remote-for-a-fork/
* https://help.github.com/articles/syncing-a-fork/

To use local changes:
* http://guides.rubygems.org/make-your-own-gem/
* modify chargify_api_ares.gemspec to use .pre of the next version number
* remember to `git add` new files because the gemspec uses `git ls-files` for what to include

gem build chargify_api_ares.gemspec
gem install ./chargify_api_ares-1.3.2.pre.gem

seemed to have to install even though I pointed at it locally in Gemfile with

gem "chargify_api_ares", :path => "~/projects/chargify_api_ares"

Note: Make sure to run with "bundle exec" in order to pick up the Gemfile

Looking at a similar issue to add delayed cancel
* https://github.com/chargify/chargify_api_ares/pull/98/files

They've added subscription.delayed_cancel(true|false)

So how do you do a delayed cancel with a message? Are you meant to call *both* cancel and delayed_cancel to do that?

which implies I should have subscription.delayed_product_change(true|false) ?

I'm thinking
subscription.product.handle = "new-product"

(How do you cancel a delayed product change through the API? It's possible through the UI...)
* https://docs.chargify.com/upgrades-downgrades#delayed-product-changes

Running the remote tests

To run the remote tests:

1. Create a new Chargify Site, and leave it in test mode with the test gateway (this is the default). I suggest username-gem-test, for example, mine is wsmoak-gem-test

2. Copy spec/remote/remote.example.yml to spec/remote/remote.yml, and update the subdomain name and your api key

3. Modify spec/remote_spec.rb to add a sleep after each time it clears the site data. Clearing a site was recently moved to a background job, so the API request is returning immediately, before the site is *actually* cleared. For example:

- before { Chargify::Site.clear_data! }
+ before { Chargify::Site.clear_data!; sleep 15 }

4. Run the tests:

bundle exec rspec

Note: the remote tests seem to be running by default with `bundle exec rspec` even though the output *says*

exclude {:remote=>true}

This seems wrong, but I haven't looked for the reason yet.

As of 2016-05-28, one test is broken. See https://github.com/chargify/chargify_api_ares/issues/131

Current CI: https://travis-ci.org/chargify/chargify_api_ares/builds/100185879

HomePage | RecentChanges | Preferences