slimpay-client 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 235336e1e40a83c32d8862b08237971a86a4c62e81d83b3349d8cc0808e8cdf4
4
- data.tar.gz: 6329d84ef109d361ab3903d6c9f906c7cfb0a130ebe8d6b1f03302f5209ccd34
3
+ metadata.gz: 3278be0c320bf75f84f9a708d76694e3055bbb8478f7c46dd71d6b154106601e
4
+ data.tar.gz: 8b1708d3089d5671707dbe9239ac396aa2b0cdf617b43ac903e322ef54a90997
5
5
  SHA512:
6
- metadata.gz: 3e35ec584766a6981bb86d16c0fa2ae89a71e5e07f5f1b191ea47977e2c7c06002194c0bcb49a987e3340d021b45cf54135938a99eb97695a677662abf6c22f1
7
- data.tar.gz: a7a1e27d1b3fb2772a4c8299f4bab5e52a5774085bcf3133afcae25dbb997571476c86c6a5db71982ab6a8d3cfa9ad883a51fa21a5d8201d407e94b7ae1bfc26
6
+ metadata.gz: bf0a703659b7edee8deb480ac4fb680b1b9437bf2686e1d5145bc1a765c8bbf495a780574be23547f0f51a786342ea664d063c1a427504cb087ab11acd748a8f
7
+ data.tar.gz: 4970819676ae1b27e1b31df3ea4c78369d7404888c36ffad9e0000c7d35434d0dbd89fc4a6e6fa585b3cf2ec58efc7e82221cb6e214062b88ea7067382d16bbf
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2018 Jonathan VUKOVICH TRIBOUHARET
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # Slimpay
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/slimpay-client.svg)](http://badge.fury.io/rb/slimpay-client)
4
+
5
+ This library provides convenient access to the Slimpay API from applications written in the Ruby language.
6
+
7
+ ## Installation
8
+
9
+ SlimpayClient is distributed as a gem, which is how it should be used in your app.
10
+
11
+ Include the gem in your Gemfile:
12
+
13
+ gem 'slimpay-client', '~> 1.0'
14
+
15
+ ## Usage
16
+
17
+ ### Configuration
18
+
19
+ If you use Rails place this code in `config/initializers/slimpay.rb`:
20
+
21
+ ```ruby
22
+ Slimpay.configure do |s|
23
+ s.client_id = ENV["SLIMPAY_CLIENT_ID"]
24
+ s.client_secret = ENV["SLIMPAY_CLIENT_SECRET"]
25
+ s.creditor_reference = ENV["SLIMPAY_CREDITOR_REFERENCE"]
26
+ s.sandbox = !Rails.env.production?
27
+ s.logger = Rails.logger
28
+ end
29
+ ```
30
+
31
+ `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`.
32
+
33
+ The methods are dynamically created, the first call to `Slimpay.base` will call Slimpay API and generate a methods for each endpoints.
34
+
35
+ ### Example
36
+
37
+ ```ruby
38
+ recurrent_direct_debit = Slimpay.base.search_recurrent_direct_debits(reference: "QWERTY1234", activated: true).recurrentDirectDebits[0]
39
+ recurrent_direct_debit = Slimpay.base.get_recurrent_direct_debits(id: recurrent_direct_debit.data['id'])
40
+ recurrent_direct_debit.cancel_recurrent_debit
41
+ ```
42
+
43
+ ## Author
44
+
45
+ - [Jonathan VUKOVICH TRIBOUHARET](https://github.com/jonathantribouharet) ([@johnvuko](https://twitter.com/johnvuko))
46
+
47
+ ## License
48
+
49
+ This gem is released under the MIT license. See the LICENSE file for more info.
data/lib/slimpay.rb CHANGED
@@ -10,7 +10,7 @@ module Slimpay
10
10
 
11
11
  class << self
12
12
 
13
- attr_accessor :client_id, :client_secret, :creditor_reference, :logger
13
+ attr_accessor :client_id, :client_secret, :logger, :creditor_reference
14
14
 
15
15
  def initialize
16
16
  sandbox = true
@@ -76,7 +76,7 @@ module Slimpay
76
76
 
77
77
  if path.end_with?('{id}')
78
78
  klass.send(:define_method, method_name) do |id|
79
- new_path = "#{path}#{id}"
79
+ new_path = "#{path.sub('{id}', '')}#{id}"
80
80
  Slimpay.send(:parse_response, Slimpay.send(:request, http_method, new_path))
81
81
  end
82
82
  else
@@ -2,9 +2,10 @@ $:.unshift File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'slimpay-client'
5
- s.summary = "Slimpay client"
5
+ s.summary = "Ruby library for Slimpay"
6
6
  s.description = s.summary
7
- s.version = '1.0.2'
7
+ s.homepage = "https://github.com/jonathantribouharet/slimpay-client"
8
+ s.version = '1.0.3'
8
9
  s.files = `git ls-files`.split("\n")
9
10
  s.require_paths = ['lib']
10
11
  s.authors = ['Jonathan VUKOVICH TRIBOUHARET']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimpay-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan VUKOVICH TRIBOUHARET
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-17 00:00:00.000000000 Z
11
+ date: 2018-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -44,18 +44,20 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 0.9.0
47
- description: Slimpay client
47
+ description: Ruby library for Slimpay
48
48
  email: jonathan.tribouharet@gmail.com
49
49
  executables: []
50
50
  extensions: []
51
51
  extra_rdoc_files: []
52
52
  files:
53
53
  - ".gitignore"
54
+ - LICENSE
55
+ - README.md
54
56
  - lib/slimpay-client.rb
55
57
  - lib/slimpay.rb
56
58
  - lib/slimpay/error.rb
57
59
  - slimpay-client.gemspec
58
- homepage:
60
+ homepage: https://github.com/jonathantribouharet/slimpay-client
59
61
  licenses:
60
62
  - MIT
61
63
  metadata: {}
@@ -78,5 +80,5 @@ rubyforge_project:
78
80
  rubygems_version: 2.7.7
79
81
  signing_key:
80
82
  specification_version: 4
81
- summary: Slimpay client
83
+ summary: Ruby library for Slimpay
82
84
  test_files: []