fintoc 1.14.0 → 1.16.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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/lib/fintoc/errors.rb +2 -0
- data/lib/fintoc/v2/managers/customers_manager.rb +6 -0
- data/lib/fintoc/v2/managers/payment_methods_manager.rb +5 -0
- data/lib/fintoc/v2/resources/transfer.rb +4 -1
- data/lib/fintoc/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: ee4ecd7894fdbca337c3cbdcb4e5ac42be6ab8dd1b16ed0532ffb0d44dc0e862
|
|
4
|
+
data.tar.gz: 8ce67a34b7c40190723d7fcb8a210876470cfb0e7d5d0060b8f49851714df095
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 299aa3b8035fd8103ab4e34bc9005e80fccd084ec1da6cc2e68880350e350caf24e3d86d6b93cef0412b1b7cc5d952fbaed3b55c3f50eedd05936dc687254c59
|
|
7
|
+
data.tar.gz: '081c03bab4ea6167ef9b2d86fb56e731f0c9a26b838d45559597d8315ab3e55f0be6d967c0a155dfe5f96379bb630d3e8784785c6752530be46e8d067dcea402'
|
data/.github/workflows/ci.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -245,9 +245,13 @@ receipt = client.v2.transfers.receipt('transfer_id') # => { download_url: '...',
|
|
|
245
245
|
|
|
246
246
|
# Customers and payment methods
|
|
247
247
|
customer = client.v2.customers.create(email: 'customer@example.com', name: 'Jon Snow')
|
|
248
|
+
# Replaces the customer's metadata; omitted keys are removed
|
|
249
|
+
customer = client.v2.customers.update('customer_id', metadata: { channel: 'digital' })
|
|
248
250
|
payment_methods = client.v2.payment_methods.list(customer: 'customer_id')
|
|
249
251
|
client.v2.payment_methods.cancel('payment_method_id')
|
|
250
252
|
mandate = client.v2.payment_methods.mandate_document('payment_method_id')
|
|
253
|
+
installments = client.v2.payment_methods.installments('payment_method_id', amount: 1000, currency: 'CLP')
|
|
254
|
+
# => { available_installments: [3, 6, 12] }
|
|
251
255
|
# Mexican direct debit mandates are sent as multipart. Nested fields are sent in
|
|
252
256
|
# bracket notation and consent documents accept a path or an IO.
|
|
253
257
|
payment_method = client.v2.payment_methods.create(
|
data/lib/fintoc/errors.rb
CHANGED
|
@@ -83,6 +83,7 @@ module Fintoc
|
|
|
83
83
|
class InvalidInvoiceStatusError < FintocError; end
|
|
84
84
|
class InvalidMetadataError < FintocError; end
|
|
85
85
|
class InvalidPeriodError < FintocError; end
|
|
86
|
+
class InvalidPhoneNumberError < FintocError; end
|
|
86
87
|
class InvalidReferenceIdFormatError < FintocError; end
|
|
87
88
|
class InvalidRefundToGetVoucherError < FintocError; end
|
|
88
89
|
class InvalidRutError < FintocError; end
|
|
@@ -214,6 +215,7 @@ module Fintoc
|
|
|
214
215
|
class RejectedRefreshIntentError < FintocError; end
|
|
215
216
|
class SenderBlockedAccountError < FintocError; end
|
|
216
217
|
class AmountOutOfRangeError < FintocError; end
|
|
218
|
+
class ChargeProcessingFeeNotAllowedError < FintocError; end
|
|
217
219
|
class CountryNotSupportedError < FintocError; end
|
|
218
220
|
class DirectDebitSuspendedError < FintocError; end
|
|
219
221
|
class FileTooLargeError < FintocError; end
|
|
@@ -25,6 +25,12 @@ module Fintoc
|
|
|
25
25
|
build_customer(data)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
def update(customer_id, metadata:, idempotency_key: nil)
|
|
29
|
+
data = @client.patch(version: :v2, idempotency_key:)
|
|
30
|
+
.call("customers/#{customer_id}", metadata:)
|
|
31
|
+
build_customer(data)
|
|
32
|
+
end
|
|
33
|
+
|
|
28
34
|
private
|
|
29
35
|
|
|
30
36
|
def build_customer(data)
|
|
@@ -36,6 +36,11 @@ module Fintoc
|
|
|
36
36
|
@client.get(version: :v2).call("payment_methods/#{payment_method_id}/mandate_document")
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
def installments(payment_method_id, amount:, currency:)
|
|
40
|
+
@client.get(version: :v2)
|
|
41
|
+
.call("payment_methods/#{payment_method_id}/installments", amount:, currency:)
|
|
42
|
+
end
|
|
43
|
+
|
|
39
44
|
private
|
|
40
45
|
|
|
41
46
|
def flatten_form(fields, prefix = nil)
|
|
@@ -5,7 +5,7 @@ module Fintoc
|
|
|
5
5
|
class Transfer
|
|
6
6
|
attr_reader :id, :object, :amount, :currency, :direction, :status, :mode,
|
|
7
7
|
:post_date, :transaction_date, :comment, :reference_id, :receipt_url,
|
|
8
|
-
:tracking_key, :return_reason, :counterparty, :account_number,
|
|
8
|
+
:tracking_key, :return_reason, :error_reason, :counterparty, :account_number,
|
|
9
9
|
:metadata, :created_at
|
|
10
10
|
|
|
11
11
|
def initialize( # rubocop:disable Metrics/MethodLength
|
|
@@ -24,6 +24,7 @@ module Fintoc
|
|
|
24
24
|
receipt_url: nil,
|
|
25
25
|
tracking_key: nil,
|
|
26
26
|
return_reason: nil,
|
|
27
|
+
error_reason: nil,
|
|
27
28
|
account_number: nil,
|
|
28
29
|
metadata: {},
|
|
29
30
|
created_at: nil,
|
|
@@ -44,6 +45,7 @@ module Fintoc
|
|
|
44
45
|
@receipt_url = receipt_url
|
|
45
46
|
@tracking_key = tracking_key
|
|
46
47
|
@return_reason = return_reason
|
|
48
|
+
@error_reason = error_reason
|
|
47
49
|
@counterparty = counterparty
|
|
48
50
|
@account_number = account_number
|
|
49
51
|
@metadata = metadata || {}
|
|
@@ -119,6 +121,7 @@ module Fintoc
|
|
|
119
121
|
@receipt_url = transfer.receipt_url
|
|
120
122
|
@tracking_key = transfer.tracking_key
|
|
121
123
|
@return_reason = transfer.return_reason
|
|
124
|
+
@error_reason = transfer.error_reason
|
|
122
125
|
@counterparty = transfer.counterparty
|
|
123
126
|
@account_number = transfer.account_number
|
|
124
127
|
@metadata = transfer.metadata
|
data/lib/fintoc/version.rb
CHANGED