gem install chargehound
Import chargehound and set your API key.
require 'chargehound'
Chargehound.api_key = '{ YOUR_API_KEY }'
Every resource is accessed via the Chargehound module.
Chargehound::Disputes.submit('dp_123', {
fields: {
customer_name: 'Susie'
}
})
Responses from the API are automatically parsed from JSON and returned as Ruby objects.
Responses also include the HTTP status code on the response object as the status field.
dispute = Chargehound::Disputes.retrieve('dp_123')
puts dispute.state
# 'needs_response'
puts dispute.response.status
# '200'
To build and install from the latest source:
$ git clone git@github.com:chargehound/chargehound-ruby.git
$ bundle install
Run tests:
$ bundle exec rake
To deploy a new version of the SDK, perform the following steps:
- Update the CHANGELOG to describe what feature have been added.
- Bump the version number in
/lib/chargehound/version.rb
- Rebuild the gem with:
gem build chargehound.gemspec
- Deploy the new gemfile to rubygems with:
gem push <name_of_generated_gem>
- Confirm the new gem version is available at https://rubygems.org/gems/chargehound