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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 615af3c2995d70d6824a8bbe5451277ed006b5fc6d2296da45175f5a61823b74
4
- data.tar.gz: 4649518d4c073b2d718f8bba9c7f9ddca6f8a06c919c2f59b77b0d813ec104dd
3
+ metadata.gz: 380ee5e078235f8c550e02cd80251b1d75a75a5cf9d3214fe3002fc64a8b45bb
4
+ data.tar.gz: fe2cb7a9cf8ae4bdc4ad9277bec47464ca2c5bd78fed48e76e586a2898b468bc
5
5
  SHA512:
6
- metadata.gz: ab9d335773f8cea5877d6402bf5457ae81110f80e6fe91bfc227ad07b3ba0d6c91b6aedca26804fecd1d6bba0a893de7a5f414b0ea22a0811a54b90d5b41ec46
7
- data.tar.gz: efb8de2b2f929ff237ef24381fc2e36d3b4b193d3317b3a55a8b75b9d4ef4f2efe6681fb49ba13704151e84078dcab131d7598e3b67608f139aed9ae5dd21554
6
+ metadata.gz: 53e538a15c2e0d543584cd6b82f63a10162f36565cdff4acea3cbc432826692e0ff7cbb89ddbf125a0c026ac6602d8126262f914977bc6de0381fe53738d4a73
7
+ data.tar.gz: f4ff6bae4d2b8fb0b38b05f28da8c991bf55eb9da97bf5b694499588b3433dc80fa3b6ecb0107a78948c6eccaf2fec78fe704cc40cf542869243336a9af856c3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fintecture (0.4.1)
4
+ fintecture (0.5.0)
5
5
  faraday
6
6
 
7
7
  GEM
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fintecture
4
- VERSION = '0.4.1'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fintecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fintecture