0.0
No commit activity in last 3 years
No release in over 3 years
Ruby library for Slimpay
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.9, >= 0.9.0
 Project Readme

Slimpay

Gem Version

This library provides convenient access to the Slimpay API from applications written in the Ruby language.

Installation

SlimpayClient is distributed as a gem, which is how it should be used in your app.

Include the gem in your Gemfile:

gem 'slimpay-client', '~> 1.0'

Usage

Configuration

If you use Rails place this code in config/initializers/slimpay.rb:

Slimpay.configure do |s|
	s.client_id = ENV["SLIMPAY_CLIENT_ID"]
	s.client_secret = ENV["SLIMPAY_CLIENT_SECRET"]
	s.creditor_reference = ENV["SLIMPAY_CREDITOR_REFERENCE"]
	s.sandbox = !Rails.env.production?
	s.logger = Rails.logger
end

creditor_reference is not used inside the library, it's just a convenient way to store this variable and reuse it after in your code with Slimpay.creditor_reference.

The methods are dynamically created, the first call to Slimpay.base will call Slimpay API and generate a methods for each endpoints.

Example

recurrent_direct_debit = Slimpay.base.search_recurrent_direct_debits(reference: "QWERTY1234", activated: true).recurrentDirectDebits[0]
recurrent_direct_debit = Slimpay.base.get_recurrent_direct_debits(id: recurrent_direct_debit.data['id'])
recurrent_direct_debit.cancel_recurrent_debit

Author

License

This gem is released under the MIT license. See the LICENSE file for more info.