fintecture 0.3.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d789620eea2a69deea71bdf6c3be05b0fb68116bd33f001291c688566713f03
4
- data.tar.gz: af4fffca73d93fa28ff50769072cc60efa8bb5aae49129f889c0aaf798476f43
3
+ metadata.gz: 615af3c2995d70d6824a8bbe5451277ed006b5fc6d2296da45175f5a61823b74
4
+ data.tar.gz: 4649518d4c073b2d718f8bba9c7f9ddca6f8a06c919c2f59b77b0d813ec104dd
5
5
  SHA512:
6
- metadata.gz: a0b3c39d0e5591d0f27caea8a32a0fcee0e707dc3c5efe8b30f3ff2880f30f4f46af9db85c719a1cc2e4d379241322790761bc4dd49e63ebe00b66245da9ace3
7
- data.tar.gz: ef26d562d3a5efa9fe86eb94e2fb2b1045a2ba4d407882cefcf51389ed729bc12eaae00efd93b9d62f83d5218282bc8aa870d9fd8cd2358bcdaf5a1b49e54873
6
+ metadata.gz: ab9d335773f8cea5877d6402bf5457ae81110f80e6fe91bfc227ad07b3ba0d6c91b6aedca26804fecd1d6bba0a893de7a5f414b0ea22a0811a54b90d5b41ec46
7
+ data.tar.gz: efb8de2b2f929ff237ef24381fc2e36d3b4b193d3317b3a55a8b75b9d4ef4f2efe6681fb49ba13704151e84078dcab131d7598e3b67608f139aed9ae5dd21554
data/CODE_OF_CONDUCT.md CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at alvaro.fernandez@nazaries.com. All
58
+ reported by contacting the project team at contact@fintecture.com. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fintecture (0.3.0)
4
+ fintecture (0.4.1)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -28,7 +28,7 @@ GEM
28
28
  faraday-patron (1.0.0)
29
29
  faraday-rack (1.0.0)
30
30
  multipart-post (2.1.1)
31
- rake (10.5.0)
31
+ rake (13.0.6)
32
32
  rspec (3.9.0)
33
33
  rspec-core (~> 3.9.0)
34
34
  rspec-expectations (~> 3.9.0)
@@ -52,7 +52,7 @@ DEPENDENCIES
52
52
  bundler (~> 2.0)
53
53
  faraday
54
54
  fintecture!
55
- rake (~> 10.0)
55
+ rake (~> 13.0)
56
56
  rspec (~> 3.0)
57
57
 
58
58
  BUNDLED WITH
data/README.md CHANGED
@@ -150,12 +150,15 @@ Documentation => https://docs.fintecture.com/v2/#get-get-get-settlements
150
150
  - An exemple of response in the right column in "Request Body" section
151
151
 
152
152
  ```ruby
153
- # settlements (settlement_id = nil)
153
+ # settlements (settlement_id = nil, include_payments = false)
154
154
  # settlement_id: string
155
+ # include_payments: boolean
155
156
 
156
157
  response = pis_client.settlements
157
158
  OR
158
159
  response = pis_client.settlements "127335fdeb073e0eb2313ba0bd71ad44"
160
+ OR
161
+ response = pis_client.settlements "127335fdeb073e0eb2313ba0bd71ad44", true
159
162
  ```
160
163
 
161
164
  ## AIS
data/exemples/pis.rb CHANGED
@@ -145,4 +145,4 @@ puts pis_client.initiate payload_initiate, 'cmcifrpp', 'https://www.google.fr',
145
145
  puts pis_client.refund '7f47d3675f5d4964bc416b43af63b06e', 1
146
146
  # ------------ settlements ------------
147
147
  pis_client.settlements
148
- pis_client.settlements '127335fdeb073e0eb2313ba0bd71ad44'
148
+ pis_client.settlements '127335fdeb073e0eb2313ba0bd71ad44', true
data/fintecture.gemspec CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.require_paths = ['lib']
39
39
 
40
40
  spec.add_development_dependency 'bundler', '~> 2.0'
41
- spec.add_development_dependency 'rake', '~> 10.0'
41
+ spec.add_development_dependency 'rake', '~> 13.0'
42
42
  spec.add_development_dependency 'rspec', '~> 3.0'
43
43
  spec.add_dependency 'faraday'
44
44
  end
@@ -10,21 +10,23 @@ module Fintecture
10
10
  class Settlements
11
11
  class << self
12
12
  # ------------ PUBLIC METHOD ------------
13
- def get(client, settlement_id)
13
+ def get(client, settlement_id, include_payments)
14
14
  @client = client
15
15
 
16
16
  # Do the get_payments request
17
- _request settlement_id
17
+ _request settlement_id, include_payments
18
18
  end
19
19
 
20
20
  private
21
21
 
22
22
  # ------------ REQUEST ------------
23
- def _request(settlement_id)
23
+ def _request(settlement_id, include_payments)
24
24
  url = _endpoint
25
+ url += "/#{settlement_id}" if settlement_id
26
+ url += "?include=payments" if include_payments
25
27
 
26
28
  Fintecture::Faraday::Authentication::Connection.get(
27
- url: "#{url}/#{settlement_id}",
29
+ url: url,
28
30
  client: @client,
29
31
  custom_content_type: 'application/json',
30
32
  bearer: "Bearer #{@client.token}",
@@ -11,7 +11,7 @@ module Fintecture
11
11
  FINTECTURE_API_URL = {
12
12
  local: 'http://localhost:3030',
13
13
  test: 'https://api-sandbox-test.fintecture.com',
14
- sandbox: 'https://api-sandbox-test.fintecture.com',
14
+ sandbox: 'https://api-sandbox.fintecture.com',
15
15
  production: 'https://api.fintecture.com'
16
16
  }
17
17
 
@@ -34,8 +34,9 @@ module Fintecture
34
34
  error_string += "\n code: #{code}"
35
35
  error_string += "\n id : #{log_id}"
36
36
 
37
- errors_array.each do |error|
38
- formated_error = error.map { |key, value| " #{key}: #{value}" }.join("\n")
37
+ errors_array.compact.each do |error|
38
+ formated_error = error
39
+ formated_error = error.map { |key, value| " #{key}: #{value}" }.join("\n") if error.is_a?(Hash)
39
40
  error_string += "\n\n#{formated_error}"
40
41
  end
41
42
  error_string += "\n\n"
@@ -55,7 +56,9 @@ module Fintecture
55
56
  error_string = "\nFintecture server errors : "
56
57
  error_string += "\n status: #{status} "
57
58
 
58
- formated_error = error.map { |key, value| " #{key}: #{value}" }.join("\n")
59
+ formated_error = error
60
+ formated_error = error.map { |key, value| " #{key}: #{value}" }.join("\n") if error.is_a?(Hash)
61
+
59
62
  error_string += "\n\n#{formated_error}"
60
63
 
61
64
  error_string += "\n\n"
@@ -73,8 +73,8 @@ module Fintecture
73
73
  JSON.parse res.body
74
74
  end
75
75
 
76
- def settlements(settlement_id = nil)
77
- res = Fintecture::Pis::Settlements.get self, settlement_id
76
+ def settlements(settlement_id = nil, include_payments = false)
77
+ res = Fintecture::Pis::Settlements.get self, settlement_id, include_payments
78
78
 
79
79
  JSON.parse res.body
80
80
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fintecture
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fintecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fintecture
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-08 00:00:00.000000000 Z
11
+ date: 2022-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.2.22
146
+ rubygems_version: 3.1.4
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Short summary