treezor_connect 0.18.0 → 0.19.0

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: 62135597a3a258409cfb519b1559f332e661e4b8641605199b1fdf9a579db9f9
4
- data.tar.gz: 0c200a83d5ef1d4e1a671585ad6768afa74c5bb48f748d464e9014627bcf516d
3
+ metadata.gz: a928f8558aa06a72634d8167f688419bf64ca0948a8ff3985f2f4b4331facff9
4
+ data.tar.gz: c0250c04496a17fff64a2b17806bce8335c7507ca31ed1998efa977834e4150b
5
5
  SHA512:
6
- metadata.gz: a9bb67df7d62da142fa4fa60906644c66874be207f04568d645e4428ed0e4cb0a1250cec9faf102cb34e2bca5b7a654841a843e4f04c9337060466c0e82bbaa7
7
- data.tar.gz: 85538da9313be4b364e5d924dbffe655fb172f3717a13d449074cc640cf5608fcdc1c350908dbe73a475686b94c20bb79702d7e5b248c75bede6b98cf61e90dd
6
+ metadata.gz: 7f0ed3d532bc0eb91447fa960d5334beeef1950120639b47a2b27f427b8ac346ce95fa06370d6a027ee06fef7b2f29b09ce03b5968d7557e1bacd55fefcab5ac
7
+ data.tar.gz: a64f69cad505b2adf664d9b706f3b287e5df169dfe53d5fb8ba130f4b3aee4f770727341f8c61757b98eb06e7b61644646bd208a57e0287c125d7bc19bf6f2e7
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TreezorConnect
4
- class ApiResource
4
+ class ApiResource < TreezorObject
5
5
  include TreezorConnect::ApiOperations::Request
6
6
 
7
7
  class << self
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TreezorConnect
4
+ class BeneficiaryValidation < ApiResource
5
+ OBJECT_NAME = 'beneficiary_validation'
6
+ OBJECT_KEY = 'beneficiariesValidation'
7
+ OBJECT_PRIMARY_KEY = 'beneficiaryValidationId'
8
+
9
+ def self.resource_url
10
+ '/v1/beneficiaries/validation'
11
+ end
12
+
13
+ extend TreezorConnect::ApiOperations::Create
14
+ extend TreezorConnect::ApiOperations::Fetch
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TreezorConnect
4
+ class MassPayout < ApiResource
5
+ OBJECT_NAME = 'mass_payout'
6
+ OBJECT_KEY = 'massPayouts'
7
+ OBJECT_PRIMARY_KEY = 'massPayoutId'
8
+
9
+ def self.resource_url
10
+ '/v1/massPayouts'
11
+ end
12
+
13
+ extend TreezorConnect::ApiOperations::Create
14
+ end
15
+ end
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'treezor_connect/resources/beneficiary'
4
+ require 'treezor_connect/resources/beneficiary_validation'
4
5
  require 'treezor_connect/resources/card'
5
6
  require 'treezor_connect/resources/card_image'
7
+ require 'treezor_connect/resources/mass_payout'
6
8
  require 'treezor_connect/resources/payin'
7
9
  require 'treezor_connect/resources/payout'
8
10
  require 'treezor_connect/resources/tax_residence'
@@ -6,6 +6,12 @@ module TreezorConnect
6
6
  @attributes = {}
7
7
  end
8
8
 
9
+ def to_hash
10
+ @attributes.transform_values do |value|
11
+ transform_value(value)
12
+ end
13
+ end
14
+
9
15
  def self.construct_from(data, opts = {})
10
16
  object_class = constantize_object_class(opts[:object_class])
11
17
  id = extract_id(data, object_class)
@@ -44,5 +50,15 @@ module TreezorConnect
44
50
  end
45
51
  end
46
52
  end
53
+
54
+ private
55
+
56
+ def transform_value(value)
57
+ if value.is_a?(Array)
58
+ value.map { |v| v.respond_to?(:to_hash) ? v.to_hash : v }
59
+ else
60
+ value.respond_to?(:to_hash) ? value.to_hash : value
61
+ end
62
+ end
47
63
  end
48
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treezor_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stefakins
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-03-18 00:00:00.000000000 Z
12
+ date: 2026-01-15 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A gem for making HTTP calls to Treezor Connect.
15
15
  email: stefan.atkinson69@gmail.com
@@ -29,8 +29,10 @@ files:
29
29
  - lib/treezor_connect/errors.rb
30
30
  - lib/treezor_connect/resources.rb
31
31
  - lib/treezor_connect/resources/beneficiary.rb
32
+ - lib/treezor_connect/resources/beneficiary_validation.rb
32
33
  - lib/treezor_connect/resources/card.rb
33
34
  - lib/treezor_connect/resources/card_image.rb
35
+ - lib/treezor_connect/resources/mass_payout.rb
34
36
  - lib/treezor_connect/resources/oauth/token.rb
35
37
  - lib/treezor_connect/resources/payin.rb
36
38
  - lib/treezor_connect/resources/payout.rb
@@ -64,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
66
  - !ruby/object:Gem::Version
65
67
  version: '0'
66
68
  requirements: []
67
- rubygems_version: 3.4.10
69
+ rubygems_version: 3.4.19
68
70
  signing_key:
69
71
  specification_version: 4
70
72
  summary: A gem for making HTTP calls to Treezor Connect.