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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d791f2eeb81b30aef86b926cefc80928702fbbeb01f8d36b719963bf0bad44cc
4
- data.tar.gz: b19fdc5e8f05a792ba812ab43ba552e2e01628badee044a13fffbd58efaa86a0
3
+ metadata.gz: ee4ecd7894fdbca337c3cbdcb4e5ac42be6ab8dd1b16ed0532ffb0d44dc0e862
4
+ data.tar.gz: 8ce67a34b7c40190723d7fcb8a210876470cfb0e7d5d0060b8f49851714df095
5
5
  SHA512:
6
- metadata.gz: b83d81e62a2d8923db706b9144d7a5a4a971415bd6f87ee036a31ead050460c1a1d84dc52df49932c9da8db3f1523f76b58a499e6a45ff8de8d321bd1b6971df
7
- data.tar.gz: 19d324de1240f7e64f7f691c2dd6dd31f79f582ab6175e08874fd1f15dd0d021b1fd202826f77529032f7d0ef3f91babc31791771c059aa299edbb05c4026b00
6
+ metadata.gz: 299aa3b8035fd8103ab4e34bc9005e80fccd084ec1da6cc2e68880350e350caf24e3d86d6b93cef0412b1b7cc5d952fbaed3b55c3f50eedd05936dc687254c59
7
+ data.tar.gz: '081c03bab4ea6167ef9b2d86fb56e731f0c9a26b838d45559597d8315ab3e55f0be6d967c0a155dfe5f96379bb630d3e8784785c6752530be46e8d067dcea402'
@@ -20,7 +20,7 @@ jobs:
20
20
  - name: Set up Ruby
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
23
- ruby-version: '3.2.2'
23
+ ruby-version: '3.2'
24
24
  bundler-cache: true
25
25
 
26
26
  - name: Run RuboCop
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fintoc (1.15.0)
4
+ fintoc (1.16.0)
5
5
  http
6
6
  money-rails
7
7
  tabulate
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
@@ -1,3 +1,3 @@
1
1
  module Fintoc
2
- VERSION = '1.15.0'
2
+ VERSION = '1.16.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.15.0
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Ca Sardin