fintoc 1.12.0 → 1.14.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: 46f4a08a0f5729437449360d3a7be048c10c3112ad582f700db63958b09f4285
4
- data.tar.gz: a406f426788466ed069c2f7ad116c4c088577bdc5bdde6daeeda548e4b5245fe
3
+ metadata.gz: f276c501caff1bac32cb8a15915a2896a1128c34e37aefb76712ae1f711a668b
4
+ data.tar.gz: 7190c09cab66eb18662c998392470ccb14af900014d359e5561c035bd1f873f9
5
5
  SHA512:
6
- metadata.gz: 5266af2326900c31d75f62851da55fa2a3184513ac665519108e49d90e593958dfe0eca22dd0d6b9e1527e138871b02ba1c0fe54c61612f876cbc2d3ed6fa875
7
- data.tar.gz: 2de123ee0036be10999cf75817d947db62b9576306ba9e13ba8e57b4e10ff729c5ab532c8a0572061d3f176bc431c10960cd4c21a67e9581daee3032e05bf4eb
6
+ metadata.gz: 7c0b8e7f9dd50a5e68b4ef01b893f43e7689ad5d81d1146e65df62f2828673104599fec6b3d307ba1379c42e25215f1d055d22496a11aab0b16975421d0b7e8e
7
+ data.tar.gz: 07a3b314e53f67a9d3253c0a7edd5b3df7cd04dd5c8768e89850a442e7d93644094533b3f415ff471356c578f6365958946289512d1d13bdea1b65ec23de4f35
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fintoc (1.12.0)
4
+ fintoc (1.14.0)
5
5
  http
6
6
  money-rails
7
7
  tabulate
@@ -9,9 +9,9 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (8.0.2.1)
13
- actionview (= 8.0.2.1)
14
- activesupport (= 8.0.2.1)
12
+ actionpack (8.0.5.2)
13
+ actionview (= 8.0.5.2)
14
+ activesupport (= 8.0.5.2)
15
15
  nokogiri (>= 1.8.5)
16
16
  rack (>= 2.2.4)
17
17
  rack-session (>= 1.0.1)
@@ -19,13 +19,13 @@ GEM
19
19
  rails-dom-testing (~> 2.2)
20
20
  rails-html-sanitizer (~> 1.6)
21
21
  useragent (~> 0.16)
22
- actionview (8.0.2.1)
23
- activesupport (= 8.0.2.1)
22
+ actionview (8.0.5.2)
23
+ activesupport (= 8.0.5.2)
24
24
  builder (~> 3.1)
25
25
  erubi (~> 1.11)
26
26
  rails-dom-testing (~> 2.2)
27
- rails-html-sanitizer (~> 1.6)
28
- activesupport (8.0.2.1)
27
+ rails-html-sanitizer (~> 1.6, >= 1.7.2)
28
+ activesupport (8.0.5.2)
29
29
  base64
30
30
  benchmark (>= 0.3)
31
31
  bigdecimal
@@ -76,9 +76,9 @@ GEM
76
76
  lint_roller (1.1.0)
77
77
  llhttp (0.6.2)
78
78
  logger (1.7.0)
79
- loofah (2.24.1)
79
+ loofah (2.25.3)
80
80
  crass (~> 1.0.2)
81
- nokogiri (>= 1.12.0)
81
+ nokogiri (>= 1.19.5)
82
82
  minitest (5.25.5)
83
83
  monetize (1.13.0)
84
84
  money (~> 6.12)
@@ -89,21 +89,21 @@ GEM
89
89
  monetize (~> 1.9)
90
90
  money (~> 6.13)
91
91
  railties (>= 3.0)
92
- nokogiri (1.18.9-aarch64-linux-gnu)
92
+ nokogiri (1.19.7-aarch64-linux-gnu)
93
93
  racc (~> 1.4)
94
- nokogiri (1.18.9-aarch64-linux-musl)
94
+ nokogiri (1.19.7-aarch64-linux-musl)
95
95
  racc (~> 1.4)
96
- nokogiri (1.18.9-arm-linux-gnu)
96
+ nokogiri (1.19.7-arm-linux-gnu)
97
97
  racc (~> 1.4)
98
- nokogiri (1.18.9-arm-linux-musl)
98
+ nokogiri (1.19.7-arm-linux-musl)
99
99
  racc (~> 1.4)
100
- nokogiri (1.18.9-arm64-darwin)
100
+ nokogiri (1.19.7-arm64-darwin)
101
101
  racc (~> 1.4)
102
- nokogiri (1.18.9-x86_64-darwin)
102
+ nokogiri (1.19.7-x86_64-darwin)
103
103
  racc (~> 1.4)
104
- nokogiri (1.18.9-x86_64-linux-gnu)
104
+ nokogiri (1.19.7-x86_64-linux-gnu)
105
105
  racc (~> 1.4)
106
- nokogiri (1.18.9-x86_64-linux-musl)
106
+ nokogiri (1.19.7-x86_64-linux-musl)
107
107
  racc (~> 1.4)
108
108
  parallel (1.27.0)
109
109
  parser (3.3.9.0)
@@ -130,16 +130,17 @@ GEM
130
130
  activesupport (>= 5.0.0)
131
131
  minitest
132
132
  nokogiri (>= 1.6)
133
- rails-html-sanitizer (1.6.2)
134
- loofah (~> 2.21)
133
+ rails-html-sanitizer (1.7.2)
134
+ loofah (~> 2.25, >= 2.25.3)
135
135
  nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
136
- railties (8.0.2.1)
137
- actionpack (= 8.0.2.1)
138
- activesupport (= 8.0.2.1)
136
+ railties (8.0.5.2)
137
+ actionpack (= 8.0.5.2)
138
+ activesupport (= 8.0.5.2)
139
139
  irb (~> 1.13)
140
140
  rackup (>= 1.0.0)
141
141
  rake (>= 12.2)
142
142
  thor (~> 1.0, >= 1.2.2)
143
+ tsort (>= 0.2)
143
144
  zeitwerk (~> 2.6)
144
145
  rainbow (3.1.1)
145
146
  rake (13.4.2)
@@ -207,6 +208,7 @@ GEM
207
208
  stringio (3.1.7)
208
209
  tabulate (0.1.2)
209
210
  thor (1.4.0)
211
+ tsort (0.2.0)
210
212
  tzinfo (2.0.6)
211
213
  concurrent-ruby (~> 1.0)
212
214
  unicode-display_width (3.1.5)
data/README.md CHANGED
@@ -34,6 +34,7 @@ Do yourself a favor: go grab some ice cubes by installing this refreshing librar
34
34
  - [Transfers](#transfers)
35
35
  - [Transfer Batches](#transfer-batches)
36
36
  - [Recipients](#recipients)
37
+ - [Crossborder](#crossborder)
37
38
  - [Simulate](#simulate)
38
39
  - [Account Verifications](#account-verifications)
39
40
  - [Entity onboardings API Examples](#entity-onboardings-api-examples)
@@ -273,6 +274,9 @@ eligibility = client.v2.payment_intents.check_eligibility(
273
274
  )
274
275
  checkout_session = client.v2.checkout_sessions.create(currency: 'CLP', flow: 'payment', amount: 5000)
275
276
  client.v2.checkout_sessions.expire('checkout_session_id')
277
+ # Charge the card submitted to a `ui_mode: 'fields'` session. Call it again while
278
+ # the session is still `in_progress` (202 Accepted) to get the result.
279
+ checkout_session = client.v2.checkout_sessions.confirm('checkout_session_id')
276
280
  setup_intent = client.v2.setup_intents.get('setup_intent_id')
277
281
 
278
282
  # Products, subscriptions and invoices
@@ -571,6 +575,51 @@ recipient = client.v2.recipients.update('recipient_id', alias: 'Lord Snow')
571
575
  client.v2.recipients.delete('recipient_id')
572
576
  ```
573
577
 
578
+ #### Crossborder
579
+
580
+ Crossborder beneficiaries, quotes and transfers are under the `v2.crossborder` namespace.
581
+ Create a quote to lock the exchange rate, and accept it with a transfer to a beneficiary:
582
+
583
+ ```ruby
584
+ require 'fintoc'
585
+
586
+ client = Fintoc::Client.new('api_key')
587
+
588
+ beneficiary = client.v2.crossborder.beneficiaries.create(
589
+ holder_type: 'business',
590
+ business_name: 'Acme LLC',
591
+ account_identifier: '123456789',
592
+ routing_number: '021000021',
593
+ bank_name: 'JPMorgan Chase Bank, N.A.',
594
+ address: { street_line1: '100 Main St', city: 'New York', state: 'NY', postal_code: '10001' }
595
+ )
596
+ beneficiaries = client.v2.crossborder.beneficiaries.list(limit: 10)
597
+ client.v2.crossborder.beneficiaries.delete(beneficiary.id) # archives the beneficiary
598
+
599
+ wallet = client.v2.crossborder.beneficiaries.create(
600
+ holder_type: 'business',
601
+ business_name: 'Acme LLC',
602
+ account_scheme: 'evm_address',
603
+ network: 'polygon',
604
+ account_identifier: '0x52908400098527886E0F7030069857D2E4169EE7'
605
+ )
606
+
607
+ quote = client.v2.crossborder.quotes.create(direction: 'mx_to_usd', source_amount: 200001)
608
+ quote = client.v2.crossborder.quotes.get(quote.id)
609
+
610
+ transfer = client.v2.crossborder.transfers.create(
611
+ quote_id: quote.id, beneficiary_id: beneficiary.id, reference: 'Factura 123'
612
+ )
613
+ transfer.funding_instructions[:clabe]
614
+ transfers = client.v2.crossborder.transfers.list(status: %w[pending_funds failed], direction: 'mx_to_usd')
615
+ transfer = client.v2.crossborder.transfers.get('crossborder_transfer_id')
616
+
617
+ # usdt_to_mx transfers waiting for their USDT can be canceled
618
+ client.v2.crossborder.transfers.cancel('crossborder_transfer_id')
619
+ # Test mode only: simulates the arrival of the pesos of a usdt_to_mx transfer
620
+ client.v2.crossborder.transfers.simulate_credit('crossborder_transfer_id')
621
+ ```
622
+
574
623
  #### Simulate
575
624
 
576
625
  ```ruby
data/lib/fintoc/errors.rb CHANGED
@@ -88,12 +88,15 @@ module Fintoc
88
88
  class InvalidRutError < FintocError; end
89
89
  class InvalidShareholderStructureError < FintocError; end
90
90
  class InvalidWebhookEventTypeError < FintocError; end
91
+ class QuoteExpiredError < FintocError; end
92
+ class SettlementNotConfiguredError < FintocError; end
91
93
  class MinimumAmountError < FintocError; end
92
94
  class MutuallyExclusiveParamsError < FintocError; end
93
95
  class NotSupportedRefundableResourceTypeError < FintocError; end
94
96
  class SplitFlatNotAllowedInIndexedSubscriptionError < FintocError; end
95
97
  class SplitNotAvailableError < FintocError; end
96
98
  class SplitSumMismatchError < FintocError; end
99
+ class CreditSimulationUnavailableError < FintocError; end
97
100
 
98
101
  # 401 Unauthorized Errors
99
102
  class AuthenticationError < FintocError; end
@@ -115,6 +118,7 @@ module Fintoc
115
118
 
116
119
  # 402 Payment Required Errors
117
120
  class PaymentRequiredError < FintocError; end
121
+ class CardDeclinedError < FintocError; end
118
122
 
119
123
  # 403 Forbidden Errors
120
124
  class InvalidAccountError < FintocError; end
@@ -176,9 +180,20 @@ module Fintoc
176
180
  class PaymentNonCancelableError < FintocError; end
177
181
  class PaymentNonExpirableError < FintocError; end
178
182
  class SubscriptionNotEditableError < FintocError; end
183
+ class BeneficiaryAlreadyExistsError < FintocError; end
184
+ class CardConfirmationExpiredError < FintocError; end
185
+ class ChargeInProgressError < FintocError; end
186
+ class CheckoutSessionNotInProgressError < FintocError; end
187
+ class NoCardSubmittedError < FintocError; end
188
+ class QuoteAlreadyAcceptedError < FintocError; end
189
+ class CreditAlreadySimulatedError < FintocError; end
190
+ class TransferNotCancellableError < FintocError; end
191
+ class UsdtCollectionAlreadyOpenError < FintocError; end
179
192
 
180
193
  # 422 Unprocessable Entity Errors
181
194
  class AccountBlockedForDirectDebitError < FintocError; end
195
+ class AccountCertificateUnavailableError < FintocError; end
196
+ class ProviderRejectedError < FintocError; end
182
197
  class FounderEmailChangeLimitReachedError < FintocError; end
183
198
  class InvalidHolderNameError < FintocError; end
184
199
  class InvalidOtpCodeError < FintocError; end
@@ -220,6 +235,7 @@ module Fintoc
220
235
  class OrganizationWithoutOperationalRootEntityError < FintocError; end
221
236
  class PaymentCancellationNotSupportedError < FintocError; end
222
237
  class PaymentMethodInactiveError < FintocError; end
238
+ class PaymentMethodCanceledError < FintocError; end
223
239
  class PaymentMethodTypeNotAvailableError < FintocError; end
224
240
  class PaymentMethodTypeNotSupportedError < FintocError; end
225
241
  class PaymentMethodUnavailableError < FintocError; end
@@ -245,6 +261,10 @@ module Fintoc
245
261
  # 501 Not Implemented Errors
246
262
  class OperationNotImplementedError < FintocError; end
247
263
 
264
+ # 503 Service Unavailable Errors
265
+ class ProviderOutcomeUnknownError < FintocError; end
266
+ class ProviderUnavailableError < FintocError; end
267
+
248
268
  # Webhook Errors
249
269
  class WebhookSignatureError < FintocError; end
250
270
 
@@ -16,6 +16,7 @@ require 'fintoc/v2/managers/setup_intents_manager'
16
16
  require 'fintoc/v2/managers/events_manager'
17
17
  require 'fintoc/v2/managers/invoices_manager'
18
18
  require 'fintoc/v2/managers/subscriptions_manager'
19
+ require 'fintoc/v2/managers/crossborder_manager'
19
20
 
20
21
  module Fintoc
21
22
  module V2
@@ -87,6 +88,10 @@ module Fintoc
87
88
  def subscriptions
88
89
  @subscriptions ||= Managers::SubscriptionsManager.new(self)
89
90
  end
91
+
92
+ def crossborder
93
+ @crossborder ||= Managers::CrossborderManager.new(self)
94
+ end
90
95
  end
91
96
  end
92
97
  end
@@ -31,6 +31,12 @@ module Fintoc
31
31
  build_checkout_session(data)
32
32
  end
33
33
 
34
+ def confirm(checkout_session_id, idempotency_key: nil)
35
+ data = @client.post(version: :v2, idempotency_key:)
36
+ .call("checkout_sessions/#{checkout_session_id}/confirm")
37
+ build_checkout_session(data)
38
+ end
39
+
34
40
  private
35
41
 
36
42
  def build_checkout_session(data)
@@ -0,0 +1,42 @@
1
+ require 'fintoc/v2/resources/crossborder_beneficiary'
2
+
3
+ module Fintoc
4
+ module V2
5
+ module Managers
6
+ class CrossborderBeneficiariesManager
7
+ def initialize(client)
8
+ @client = client
9
+ end
10
+
11
+ def create(holder_type:, account_identifier:, idempotency_key: nil, **params)
12
+ data = @client.post(version: :v2, idempotency_key:).call(
13
+ 'crossborder/beneficiaries', holder_type:, account_identifier:, **params
14
+ )
15
+ build_beneficiary(data)
16
+ end
17
+
18
+ def list(**params)
19
+ @client.get(version: :v2).call('crossborder/beneficiaries', **params).map do |data|
20
+ build_beneficiary(data)
21
+ end
22
+ end
23
+
24
+ def get(beneficiary_id)
25
+ data = @client.get(version: :v2).call("crossborder/beneficiaries/#{beneficiary_id}")
26
+ build_beneficiary(data)
27
+ end
28
+
29
+ def delete(beneficiary_id)
30
+ data = @client.delete(version: :v2).call("crossborder/beneficiaries/#{beneficiary_id}")
31
+ build_beneficiary(data)
32
+ end
33
+
34
+ private
35
+
36
+ def build_beneficiary(data)
37
+ Fintoc::V2::CrossborderBeneficiary.new(**data)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,27 @@
1
+ require 'fintoc/v2/managers/crossborder_beneficiaries_manager'
2
+ require 'fintoc/v2/managers/crossborder_quotes_manager'
3
+ require 'fintoc/v2/managers/crossborder_transfers_manager'
4
+
5
+ module Fintoc
6
+ module V2
7
+ module Managers
8
+ class CrossborderManager
9
+ def initialize(client)
10
+ @client = client
11
+ end
12
+
13
+ def beneficiaries
14
+ @beneficiaries ||= CrossborderBeneficiariesManager.new(@client)
15
+ end
16
+
17
+ def quotes
18
+ @quotes ||= CrossborderQuotesManager.new(@client)
19
+ end
20
+
21
+ def transfers
22
+ @transfers ||= CrossborderTransfersManager.new(@client)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,30 @@
1
+ require 'fintoc/v2/resources/crossborder_quote'
2
+
3
+ module Fintoc
4
+ module V2
5
+ module Managers
6
+ class CrossborderQuotesManager
7
+ def initialize(client)
8
+ @client = client
9
+ end
10
+
11
+ def create(direction:, source_amount:, idempotency_key: nil)
12
+ data = @client.post(version: :v2, idempotency_key:)
13
+ .call('crossborder/quotes', direction:, source_amount:)
14
+ build_quote(data)
15
+ end
16
+
17
+ def get(quote_id)
18
+ data = @client.get(version: :v2).call("crossborder/quotes/#{quote_id}")
19
+ build_quote(data)
20
+ end
21
+
22
+ private
23
+
24
+ def build_quote(data)
25
+ Fintoc::V2::CrossborderQuote.new(**data)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,51 @@
1
+ require 'fintoc/v2/resources/crossborder_transfer'
2
+
3
+ module Fintoc
4
+ module V2
5
+ module Managers
6
+ class CrossborderTransfersManager
7
+ def initialize(client)
8
+ @client = client
9
+ end
10
+
11
+ def create(quote_id:, idempotency_key: nil, **params)
12
+ data = @client.post(version: :v2, idempotency_key:)
13
+ .call('crossborder/transfers', quote_id:, **params)
14
+ build_transfer(data)
15
+ end
16
+
17
+ # The API expects the status filter as `status[]`; `status:` accepts a string or an array.
18
+ def list(status: nil, **params)
19
+ params[:'status[]'] = Array(status) unless status.nil?
20
+ @client.get(version: :v2).call('crossborder/transfers', **params).map do |data|
21
+ build_transfer(data)
22
+ end
23
+ end
24
+
25
+ def get(transfer_id)
26
+ data = @client.get(version: :v2).call("crossborder/transfers/#{transfer_id}")
27
+ build_transfer(data)
28
+ end
29
+
30
+ def cancel(transfer_id, idempotency_key: nil)
31
+ data = @client.post(version: :v2, idempotency_key:)
32
+ .call("crossborder/transfers/#{transfer_id}/cancel")
33
+ build_transfer(data)
34
+ end
35
+
36
+ # Test mode only.
37
+ def simulate_credit(transfer_id, idempotency_key: nil)
38
+ data = @client.post(version: :v2, idempotency_key:)
39
+ .call("crossborder/transfers/#{transfer_id}/simulate_credit")
40
+ build_transfer(data)
41
+ end
42
+
43
+ private
44
+
45
+ def build_transfer(data)
46
+ Fintoc::V2::CrossborderTransfer.new(**data)
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,59 @@
1
+ module Fintoc
2
+ module V2
3
+ class CrossborderBeneficiary
4
+ attr_reader :id, :object, :mode, :account_scheme, :currency, :network, :holder_type,
5
+ :business_name, :first_name, :last_name, :bank_name, :routing_number,
6
+ :account_identifier, :account_last4, :address, :archived_at, :created_at
7
+
8
+ def initialize( # rubocop:disable Metrics/MethodLength
9
+ id:,
10
+ object:,
11
+ mode: nil,
12
+ account_scheme: nil,
13
+ currency: nil,
14
+ network: nil,
15
+ holder_type: nil,
16
+ business_name: nil,
17
+ first_name: nil,
18
+ last_name: nil,
19
+ bank_name: nil,
20
+ routing_number: nil,
21
+ account_identifier: nil,
22
+ account_last4: nil,
23
+ address: nil,
24
+ archived_at: nil,
25
+ created_at: nil,
26
+ **
27
+ )
28
+ @id = id
29
+ @object = object
30
+ @mode = mode
31
+ @account_scheme = account_scheme
32
+ @currency = currency
33
+ @network = network
34
+ @holder_type = holder_type
35
+ @business_name = business_name
36
+ @first_name = first_name
37
+ @last_name = last_name
38
+ @bank_name = bank_name
39
+ @routing_number = routing_number
40
+ @account_identifier = account_identifier
41
+ @account_last4 = account_last4
42
+ @address = address
43
+ @archived_at = archived_at
44
+ @created_at = created_at
45
+ end
46
+
47
+ def archived?
48
+ !@archived_at.nil?
49
+ end
50
+
51
+ def to_s
52
+ return "Crossborder beneficiary (#{@id}) - #{@network} #{@account_identifier}" if
53
+ @account_scheme == 'evm_address'
54
+
55
+ "Crossborder beneficiary (#{@id}) - #{@bank_name} ****#{@account_last4}"
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,48 @@
1
+ module Fintoc
2
+ module V2
3
+ class CrossborderQuote
4
+ attr_reader :id, :object, :mode, :status, :direction, :source_amount, :source_currency,
5
+ :target_amount, :target_currency, :exchange_rate, :fees, :kind,
6
+ :transfer_id, :expires_at, :created_at
7
+
8
+ def initialize(
9
+ id:,
10
+ object:,
11
+ mode: nil,
12
+ status: nil,
13
+ direction: nil,
14
+ source_amount: nil,
15
+ source_currency: nil,
16
+ target_amount: nil,
17
+ target_currency: nil,
18
+ exchange_rate: nil,
19
+ fees: nil,
20
+ kind: nil,
21
+ transfer_id: nil,
22
+ expires_at: nil,
23
+ created_at: nil,
24
+ **
25
+ )
26
+ @id = id
27
+ @object = object
28
+ @mode = mode
29
+ @status = status
30
+ @direction = direction
31
+ @source_amount = source_amount
32
+ @source_currency = source_currency
33
+ @target_amount = target_amount
34
+ @target_currency = target_currency
35
+ @exchange_rate = exchange_rate
36
+ @fees = fees
37
+ @kind = kind
38
+ @transfer_id = transfer_id
39
+ @expires_at = expires_at
40
+ @created_at = created_at
41
+ end
42
+
43
+ def to_s
44
+ "Crossborder quote (#{@id}) - #{@direction} #{@status}"
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,63 @@
1
+ require 'fintoc/v2/resources/crossborder_beneficiary'
2
+
3
+ module Fintoc
4
+ module V2
5
+ class CrossborderTransfer
6
+ attr_reader :id, :object, :mode, :status, :direction, :quote_id, :source_amount,
7
+ :source_currency, :target_amount, :target_currency, :exchange_rate, :fees,
8
+ :beneficiary, :reference, :funding_instructions, :credit, :funds_received_at,
9
+ :succeeded_at, :canceled_at, :failed_at, :created_at
10
+
11
+ def initialize( # rubocop:disable Metrics/MethodLength
12
+ id:,
13
+ object:,
14
+ mode: nil,
15
+ status: nil,
16
+ direction: nil,
17
+ quote_id: nil,
18
+ source_amount: nil,
19
+ source_currency: nil,
20
+ target_amount: nil,
21
+ target_currency: nil,
22
+ exchange_rate: nil,
23
+ fees: nil,
24
+ beneficiary: nil,
25
+ reference: nil,
26
+ funding_instructions: nil,
27
+ credit: nil,
28
+ funds_received_at: nil,
29
+ succeeded_at: nil,
30
+ canceled_at: nil,
31
+ failed_at: nil,
32
+ created_at: nil,
33
+ **
34
+ )
35
+ @id = id
36
+ @object = object
37
+ @mode = mode
38
+ @status = status
39
+ @direction = direction
40
+ @quote_id = quote_id
41
+ @source_amount = source_amount
42
+ @source_currency = source_currency
43
+ @target_amount = target_amount
44
+ @target_currency = target_currency
45
+ @exchange_rate = exchange_rate
46
+ @fees = fees
47
+ @beneficiary = beneficiary && CrossborderBeneficiary.new(**beneficiary)
48
+ @reference = reference
49
+ @funding_instructions = funding_instructions
50
+ @credit = credit
51
+ @funds_received_at = funds_received_at
52
+ @succeeded_at = succeeded_at
53
+ @canceled_at = canceled_at
54
+ @failed_at = failed_at
55
+ @created_at = created_at
56
+ end
57
+
58
+ def to_s
59
+ "Crossborder transfer (#{@id}) - #{@direction} #{@status}"
60
+ end
61
+ end
62
+ end
63
+ end
@@ -1,3 +1,3 @@
1
1
  module Fintoc
2
- VERSION = '1.12.0'
2
+ VERSION = '1.14.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fintoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Ca Sardin
@@ -132,6 +132,10 @@ files:
132
132
  - lib/fintoc/v2/managers/account_verifications_manager.rb
133
133
  - lib/fintoc/v2/managers/accounts_manager.rb
134
134
  - lib/fintoc/v2/managers/checkout_sessions_manager.rb
135
+ - lib/fintoc/v2/managers/crossborder_beneficiaries_manager.rb
136
+ - lib/fintoc/v2/managers/crossborder_manager.rb
137
+ - lib/fintoc/v2/managers/crossborder_quotes_manager.rb
138
+ - lib/fintoc/v2/managers/crossborder_transfers_manager.rb
135
139
  - lib/fintoc/v2/managers/customers_manager.rb
136
140
  - lib/fintoc/v2/managers/entities_manager.rb
137
141
  - lib/fintoc/v2/managers/events_manager.rb
@@ -155,6 +159,9 @@ files:
155
159
  - lib/fintoc/v2/resources/account_statement.rb
156
160
  - lib/fintoc/v2/resources/account_verification.rb
157
161
  - lib/fintoc/v2/resources/checkout_session.rb
162
+ - lib/fintoc/v2/resources/crossborder_beneficiary.rb
163
+ - lib/fintoc/v2/resources/crossborder_quote.rb
164
+ - lib/fintoc/v2/resources/crossborder_transfer.rb
158
165
  - lib/fintoc/v2/resources/customer.rb
159
166
  - lib/fintoc/v2/resources/entity.rb
160
167
  - lib/fintoc/v2/resources/event.rb