fintecture 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fintecture/api/pis/connect.rb +4 -9
- data/lib/fintecture/api/pis/payments.rb +10 -7
- data/lib/fintecture/pis_client.rb +4 -4
- data/lib/fintecture/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 382d21d6fcbd51583a2b4f7f6b3e7660475694874d74e9abe45656357a73f785
|
4
|
+
data.tar.gz: e77d0419db9e098efa149e741f82eacdf613a4d4f7a4f0582b87edeedddc3e27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4b8aee29ea4ef485f37435bba44c33b38f4940dbaf78985141e0314e4217e16ca2d8968c4b66027fb3571cc6e00c1f571fac889b759733397b41f3b4b9e87f3
|
7
|
+
data.tar.gz: 1d053965a350afb4bd1959a9f1c7d8eeda267f3aba5190c591baaa23efeb32ed140eb4c2376c09a9e02560d76b8d46bf245e1302931b93f24584a90bf2a5bf2a
|
data/Gemfile.lock
CHANGED
@@ -13,7 +13,7 @@ module Fintecture
|
|
13
13
|
class Connect
|
14
14
|
class << self
|
15
15
|
# ------------ PUBLIC METHOD ------------
|
16
|
-
def generate(client, payload, state, redirect_uri, origin_uri,
|
16
|
+
def generate(client, payload, state, redirect_uri, origin_uri, with_virtualbeneficiary: false)
|
17
17
|
|
18
18
|
@client = client
|
19
19
|
|
@@ -21,18 +21,13 @@ module Fintecture
|
|
21
21
|
payload = _build_payload(payload)
|
22
22
|
|
23
23
|
# Do the request
|
24
|
-
_request payload, state, redirect_uri, origin_uri,
|
24
|
+
_request payload, state, redirect_uri, origin_uri, with_virtualbeneficiary: with_virtualbeneficiary
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
29
|
# ------------ REQUEST ------------
|
30
|
-
def _request(payload, state, redirect_uri, origin_uri,
|
31
|
-
defaults = {
|
32
|
-
:with_virtualbeneficiary => false
|
33
|
-
}
|
34
|
-
options = defaults.merge(options)
|
35
|
-
|
30
|
+
def _request(payload, state, redirect_uri, origin_uri, with_virtualbeneficiary: false)
|
36
31
|
# Get the url request
|
37
32
|
url = _endpoint
|
38
33
|
|
@@ -40,7 +35,7 @@ module Fintecture
|
|
40
35
|
params = {}
|
41
36
|
params['redirect_uri'] = redirect_uri if redirect_uri
|
42
37
|
params['origin_uri'] = origin_uri if origin_uri
|
43
|
-
params['with_virtualbeneficiary'] = 'true' if
|
38
|
+
params['with_virtualbeneficiary'] = 'true' if with_virtualbeneficiary
|
44
39
|
params['state'] = state
|
45
40
|
|
46
41
|
query_string = "?#{params.map { |key, value| "#{key}=#{value}" }.join('&')}"
|
@@ -10,24 +10,27 @@ module Fintecture
|
|
10
10
|
class Payments
|
11
11
|
class << self
|
12
12
|
# ------------ PUBLIC METHOD ------------
|
13
|
-
def get(client, session_id,
|
13
|
+
def get(client, session_id, with_virtualbeneficiary: false)
|
14
14
|
@client = client
|
15
15
|
|
16
16
|
# Do the get_payments request
|
17
|
-
_request session_id,
|
17
|
+
_request session_id, with_virtualbeneficiary: with_virtualbeneficiary
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
21
21
|
|
22
22
|
# ------------ REQUEST ------------
|
23
|
-
def _request(session_id,
|
23
|
+
def _request(session_id, with_virtualbeneficiary: false)
|
24
24
|
url = _endpoint
|
25
25
|
|
26
26
|
# Build uri params
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
query_string = ''
|
28
|
+
if with_virtualbeneficiary
|
29
|
+
params = {}
|
30
|
+
params['with_virtualbeneficiary'] = 'true' if with_virtualbeneficiary
|
31
|
+
|
32
|
+
query_string = "?#{params.map { |key, value| "#{key}=#{value}" }.join('&')}"
|
33
|
+
end
|
31
34
|
|
32
35
|
Fintecture::Faraday::Authentication::Connection.get(
|
33
36
|
url: "#{url}/#{session_id}" + query_string,
|
@@ -42,8 +42,8 @@ module Fintecture
|
|
42
42
|
body
|
43
43
|
end
|
44
44
|
|
45
|
-
def connect(payload, state, redirect_uri = nil, origin_uri = nil,
|
46
|
-
res = Fintecture::Pis::Connect.generate self, Marshal.load(Marshal.dump(payload)), state, redirect_uri, origin_uri,
|
45
|
+
def connect(payload, state, redirect_uri = nil, origin_uri = nil, with_virtualbeneficiary: false)
|
46
|
+
res = Fintecture::Pis::Connect.generate self, Marshal.load(Marshal.dump(payload)), state, redirect_uri, origin_uri, with_virtualbeneficiary: with_virtualbeneficiary
|
47
47
|
|
48
48
|
JSON.parse res.body
|
49
49
|
end
|
@@ -61,8 +61,8 @@ module Fintecture
|
|
61
61
|
JSON.parse res.body
|
62
62
|
end
|
63
63
|
|
64
|
-
def payments(session_id = nil,
|
65
|
-
res = Fintecture::Pis::Payments.get self, session_id,
|
64
|
+
def payments(session_id = nil, with_virtualbeneficiary: false)
|
65
|
+
res = Fintecture::Pis::Payments.get self, session_id, with_virtualbeneficiary: with_virtualbeneficiary
|
66
66
|
|
67
67
|
JSON.parse res.body
|
68
68
|
end
|
data/lib/fintecture/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fintecture
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|