fintecture 0.4.1 → 0.5.0
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/README.md +3 -2
- data/lib/fintecture/api/pis/refund.rb +5 -5
- data/lib/fintecture/pis_client.rb +2 -2
- data/lib/fintecture/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 380ee5e078235f8c550e02cd80251b1d75a75a5cf9d3214fe3002fc64a8b45bb
|
4
|
+
data.tar.gz: fe2cb7a9cf8ae4bdc4ad9277bec47464ca2c5bd78fed48e76e586a2898b468bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53e538a15c2e0d543584cd6b82f63a10162f36565cdff4acea3cbc432826692e0ff7cbb89ddbf125a0c026ac6602d8126262f914977bc6de0381fe53738d4a73
|
7
|
+
data.tar.gz: f4ff6bae4d2b8fb0b38b05f28da8c991bf55eb9da97bf5b694499588b3433dc80fa3b6ecb0107a78948c6eccaf2fec78fe704cc40cf542869243336a9af856c3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -121,11 +121,12 @@ Documentation => https://docs.fintecture.com/v2/#post-post-post-refund
|
|
121
121
|
- An exemple of response in the right column in "Request Body" section
|
122
122
|
|
123
123
|
```ruby
|
124
|
-
# refund (session_id, amount = nil)
|
124
|
+
# refund (session_id, amount = nil, user_id = nil))
|
125
125
|
# session_id: string
|
126
126
|
# amount: number
|
127
|
+
# user_id: string
|
127
128
|
|
128
|
-
response = pis_client.refund "7f47d3675f5d4964bc416b43af63b06e", 5.75
|
129
|
+
response = pis_client.refund "7f47d3675f5d4964bc416b43af63b06e", 5.75, "8886aaa4-527d-4253-8951-a07d8bf4cf52"
|
129
130
|
```
|
130
131
|
If the amount is not specified, refund the total
|
131
132
|
|
@@ -9,11 +9,11 @@ module Fintecture
|
|
9
9
|
class Refund
|
10
10
|
class << self
|
11
11
|
# ------------ PUBLIC METHOD ------------
|
12
|
-
def generate(client, session_id, amount)
|
12
|
+
def generate(client, session_id, amount, user_id)
|
13
13
|
@client = client
|
14
14
|
|
15
15
|
# Build the request payload
|
16
|
-
payload = _build_payload session_id, amount
|
16
|
+
payload = _build_payload session_id, amount, user_id
|
17
17
|
# Do the _request request
|
18
18
|
_request payload
|
19
19
|
end
|
@@ -37,11 +37,12 @@ module Fintecture
|
|
37
37
|
end
|
38
38
|
|
39
39
|
# ------------ BUILD PAYLOAD ------------
|
40
|
-
def _build_payload(session_id, amount)
|
40
|
+
def _build_payload(session_id, amount, user_id)
|
41
41
|
# Return the payload
|
42
42
|
{
|
43
43
|
meta: {
|
44
|
-
session_id: session_id
|
44
|
+
session_id: session_id,
|
45
|
+
user_id: user_id
|
45
46
|
},
|
46
47
|
data: {
|
47
48
|
attributes: {
|
@@ -60,7 +61,6 @@ module Fintecture
|
|
60
61
|
def _api_base_url
|
61
62
|
Fintecture::Api::BaseUrl::FINTECTURE_API_URL[@client.environment.to_sym]
|
62
63
|
end
|
63
|
-
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -67,8 +67,8 @@ module Fintecture
|
|
67
67
|
JSON.parse res.body
|
68
68
|
end
|
69
69
|
|
70
|
-
def refund(session_id, amount = nil)
|
71
|
-
res = Fintecture::Pis::Refund.generate self, session_id, amount
|
70
|
+
def refund(session_id, amount = nil, user_id = nil)
|
71
|
+
res = Fintecture::Pis::Refund.generate self, session_id, amount, user_id
|
72
72
|
|
73
73
|
JSON.parse res.body
|
74
74
|
end
|
data/lib/fintecture/version.rb
CHANGED