A ruby wrapper for the Paymill API.
Add this line to your application's Gemfile:
gem 'paymill'
And then execute:
$ bundle
Or install it yourself as:
$ gem install paymill
First configure Paymill by setting your API key:
Paymill.api_key = '123' # your private API key
or more fancy:
Paymill.configure do |config|
config.api_key = '1234'
config.timeout = 3
end
Paymill::Client.create({email: 'hi@te.am'})
Paymill::Client.find(id)
Paymill::Client.update(id, {email: 'hallo@te.am'})
Paymill::Client.delete(id)
Paymill::Client.delete_all
Paymill::Client.all
Paymill::Client.count
Paymill::Client.where(email: 'hi@te.am').limit(2).offset(10).first
Paymill::Client.order(:description, :desc).last(3)
Paymill::Client.where(email: '@gmail.com').order(:date_created, :desc).delete_all
Use scoped, where, order, limit, offset, paginate
to build up chainable query scopes.
These methods will return a Paymill::Scope object.
Use all, each, first, last, count, total, empty? and all methods from Enumerable module on the scope to trigger a query to the Paymill API.