fintoc 1.15.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 +2 -0
- data/lib/fintoc/errors.rb +1 -0
- data/lib/fintoc/v2/managers/customers_manager.rb +6 -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,6 +245,8 @@ 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')
|
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
|
|
@@ -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)
|
|
@@ -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