pfs 0.0.5 → 0.0.8

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: 043d37e569940a1f1cf3be1d690f4c4f84e3c37924171d3c66f5c314994e55fb
4
- data.tar.gz: 5a00857236ba3a0473d7aed84f68ac0fa82147a35a41de7d92b1bbbb234d2eb1
3
+ metadata.gz: 8a085d9259e3eb98f2fe1b761e4c3017d5e078847ebaf196978c36df5b575284
4
+ data.tar.gz: b5ad378234d9522e3f07a44095876d0f505058c6a122f6a41d78d3976f69f303
5
5
  SHA512:
6
- metadata.gz: e7932aea62d9494471bf0922b45f1aa44b80e38f517f430328d556c8899e6bbd5175ac286ce07fe8472f7e0ab4b92bb04e8cbfcae3c06280d79b751049eda285
7
- data.tar.gz: 70342f1bfafa3b29c12b0aac381f4411c26d5c95dcdb0d19c09ddbcf8ed21d1026561f45e8d21af60c5a841721b69f68db3f93db73ef41410e7ad5bcf0ad9ce2
6
+ metadata.gz: 63e7bce0ba36f33b5afc7885ba39ebe1e40222fceec9a78235f6f19d69f0a3541ed48d171a874e5dc4de5887130b3a01dfe27d83f051ed3e58f68bbe1d4aca8d
7
+ data.tar.gz: 8403be7bfe84d11f8ebe5038c3a197587a500fcbc1d0b4305251f1d5cb01d20dd807da4cb076b4c530c01456cddc5cbd4cd634e348a5b44fc932da4d0a08ae23
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: ci
3
3
 
4
- on:
4
+ # https://github.com/adrienverge/yamllint/issues/430
5
+ "on":
5
6
  push:
6
7
  pull_request:
7
8
  # Allows you to run this workflow manually from the Actions tab
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: release
3
3
 
4
- on:
4
+ # https://github.com/adrienverge/yamllint/issues/430
5
+ "on":
5
6
  push:
6
7
  tags:
7
8
  - v*.*.*
data/.rubocop_devengo.yml CHANGED
@@ -1,3 +1,4 @@
1
+ ---
1
2
  AllCops:
2
3
  DisplayCopNames: true
3
4
  TargetRubyVersion: 2.7
@@ -84,10 +85,10 @@ Style/NumericPredicate:
84
85
  Enabled: false
85
86
 
86
87
  Style/HashEachMethods:
87
- Enabled: True
88
+ Enabled: true
88
89
 
89
90
  Style/HashTransformKeys:
90
- Enabled: True
91
+ Enabled: true
91
92
 
92
93
  Style/HashTransformValues:
93
94
  Enabled: true
@@ -158,25 +159,32 @@ Style/RedundantSelfAssignment:
158
159
  Style/SoleNestedConditional:
159
160
  Enabled: true
160
161
 
161
- Style/ArgumentsForwarding: # (new in 1.1)
162
+ # (new in 1.1)
163
+ Style/ArgumentsForwarding:
162
164
  Enabled: true
163
165
 
164
- Style/DocumentDynamicEvalDefinition: # (new in 1.1)
166
+ # (new in 1.1)
167
+ Style/DocumentDynamicEvalDefinition:
165
168
  Enabled: true
166
169
 
167
- Style/SwapValues: # (new in 1.1)
170
+ # (new in 1.1)
171
+ Style/SwapValues:
168
172
  Enabled: true
169
173
 
170
- Style/CollectionCompact: # (new in 1.2)
174
+ # (new in 1.2)
175
+ Style/CollectionCompact:
171
176
  Enabled: true
172
177
 
173
- Style/NegatedIfElseCondition: # (new in 1.2)
178
+ # (new in 1.2)
179
+ Style/NegatedIfElseCondition:
174
180
  Enabled: true
175
181
 
176
- Style/NilLambda: # (new in 1.3)
182
+ # (new in 1.3)
183
+ Style/NilLambda:
177
184
  Enabled: true
178
185
 
179
- Style/RedundantArgument: # (new in 1.4)
186
+ # (new in 1.4)
187
+ Style/RedundantArgument:
180
188
  Enabled: true
181
189
 
182
190
  Style/FetchEnvVar:
@@ -251,28 +259,36 @@ Lint/UselessMethodDefinition:
251
259
  Lint/UselessTimes:
252
260
  Enabled: true
253
261
 
254
- Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
262
+ # (new in 1.1)
263
+ Lint/DuplicateRegexpCharacterClassElement:
255
264
  Enabled: true
256
265
 
257
- Lint/EmptyBlock: # (new in 1.1)
266
+ # (new in 1.1)
267
+ Lint/EmptyBlock:
258
268
  Enabled: true
259
269
 
260
- Lint/ToEnumArguments: # (new in 1.1)
270
+ # (new in 1.1)
271
+ Lint/ToEnumArguments:
261
272
  Enabled: true
262
273
 
263
- Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
274
+ # (new in 1.1)
275
+ Lint/UnmodifiedReduceAccumulator:
264
276
  Enabled: true
265
277
 
266
- Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
278
+ # (new in 1.2)
279
+ Lint/NoReturnInBeginEndBlocks:
267
280
  Enabled: true
268
281
 
269
- Lint/DuplicateBranch: # (new in 1.3)
282
+ # (new in 1.3)
283
+ Lint/DuplicateBranch:
270
284
  Enabled: true
271
285
 
272
- Lint/EmptyClass: # (new in 1.3)
286
+ # (new in 1.3)
287
+ Lint/EmptyClass:
273
288
  Enabled: true
274
289
 
275
- Lint/UnexpectedBlockArity: # (new in 1.5)
290
+ # (new in 1.5)
291
+ Lint/UnexpectedBlockArity:
276
292
  Enabled: true
277
293
 
278
294
  RSpec/AggregateExamples:
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in pfs.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
data/Guardfile ADDED
@@ -0,0 +1,48 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Turnip features and steps
44
+ watch(%r{^spec/acceptance/(.+)\.feature$})
45
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
46
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
47
+ end
48
+ end
@@ -15,9 +15,26 @@ module PFS
15
15
  }
16
16
  data[:isinstant] = true if options[:instant]
17
17
  data[:reference] = options[:reference] if options[:reference]
18
+ data[:unstructuredreference] = options[:unstructured_reference] if options[:unstructured_reference]
19
+ data[:userdefinedfields] = options[:user_defined_fields] if options[:user_defined_fields]
18
20
  response = client.post("/BankPayment/#{account_id}/OneOffPayment", data, options)
19
21
  Resources::Transfers::Transfer.new(response, response.body[:data])
20
22
  end
23
+
24
+ def internal(from_account_id, to_account_id, amount, currency, fee_code, description, terminal_id)
25
+ data = {
26
+ id: from_account_id,
27
+ toId: to_account_id,
28
+ amount: amount,
29
+ currencyCode: currency,
30
+ description: description,
31
+ feeCode: fee_code,
32
+ terminalId: terminal_id,
33
+ }
34
+
35
+ response = client.post("/Account/CardholderToCardholderTransfer", data)
36
+ Resources::Transfers::InternalTransfer.new(response, response.body[:data])
37
+ end
21
38
  end
22
39
  end
23
40
  end
@@ -34,6 +34,9 @@ require_relative "accounts/balance_credit"
34
34
  require_relative "accounts/status"
35
35
  require_relative "authentication/token"
36
36
  require_relative "transfers/transfer"
37
+ require_relative "transfers/internal_transfer"
38
+ require_relative "transfers/internal_transfer_from"
39
+ require_relative "transfers/internal_transfer_to"
37
40
  require_relative "transactions/transaction"
38
41
  require_relative "transactions/transactions"
39
42
  require_relative "statements/statement"
@@ -42,7 +42,6 @@ module PFS
42
42
  alias processor_type processorType
43
43
  alias status paymentStatus
44
44
  alias user_defined_fields userDefinedFields
45
-
46
45
  end
47
46
  end
48
47
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PFS
4
+ module Resources
5
+ module Transfers
6
+ class InternalTransfer < Base
7
+ attr_reader :from,
8
+ :to
9
+ def initialize(response, attributes = {})
10
+ super(response, attributes)
11
+ @from = InternalTransferFrom.new(response, attributes[:from])
12
+ @to = InternalTransferTo.new(response, attributes[:to])
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PFS
4
+ module Resources
5
+ module Transfers
6
+ class InternalTransferFrom < Base
7
+ map :id, :id
8
+ map :balance, :balance
9
+ map :currencyCode, :currency
10
+ map :debitedAmount, :amount
11
+ map :conversionRate, :conversion_rate
12
+ map :transferFee, :transfer_fee
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PFS
4
+ module Resources
5
+ module Transfers
6
+ class InternalTransferTo < Base
7
+ map :id, :id
8
+ map :balance, :balance
9
+ map :currencyCode, :currency
10
+ map :creditedAmount, :amount
11
+ map :loadFee, :load_fee
12
+ end
13
+ end
14
+ end
15
+ end
16
+
data/lib/pfs/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PFS
2
- VERSION = "0.0.5"
4
+ VERSION = "0.0.8"
3
5
  end
data/pfs.gemspec CHANGED
@@ -26,4 +26,10 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.required_ruby_version = ">= 2.5.0"
28
28
  spec.add_dependency "faraday", '>= 0.15'
29
+
30
+ spec.add_development_dependency "guard", "~> 2.0"
31
+ spec.add_development_dependency "guard-rspec", "~> 4.0"
32
+ spec.add_development_dependency "rake", "~> 12.0"
33
+ spec.add_development_dependency "rspec", "~> 3.0"
34
+ spec.add_development_dependency "webmock", "~> 3.0"
29
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aitor García Rey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-01 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,6 +24,76 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard-rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '4.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '12.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '12.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
27
97
  description: A ruby client to consume PFS Finac API
28
98
  email:
29
99
  - aitor@devengo.com
@@ -40,6 +110,7 @@ files:
40
110
  - ".rubocop_devengo.yml"
41
111
  - CODE_OF_CONDUCT.md
42
112
  - Gemfile
113
+ - Guardfile
43
114
  - LICENSE
44
115
  - LICENSE.txt
45
116
  - README.md
@@ -68,6 +139,9 @@ files:
68
139
  - lib/pfs/resources/statements/statement.rb
69
140
  - lib/pfs/resources/transactions/transaction.rb
70
141
  - lib/pfs/resources/transactions/transactions.rb
142
+ - lib/pfs/resources/transfers/internal_transfer.rb
143
+ - lib/pfs/resources/transfers/internal_transfer_from.rb
144
+ - lib/pfs/resources/transfers/internal_transfer_to.rb
71
145
  - lib/pfs/resources/transfers/transfer.rb
72
146
  - lib/pfs/version.rb
73
147
  - pfs.gemspec