gocardless_pro 4.26.0 → 4.27.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: ec07337d5881342ba9371a2101ffe10e3709376f03672cb005ca86b374edfd41
4
- data.tar.gz: 72a02f344e422ee63011e2b60cebe041f78e954228c13c09d5d9b71bedc5bb7b
3
+ metadata.gz: 5b38ad3be6fbc6bbf4f7c1107d78fe30986b17e5d6c7568a963c3d8ff11b8a12
4
+ data.tar.gz: 5ce26c1cf8cc55853e400f744b8882a5b61018146712e67e9a4e41bf0b542479
5
5
  SHA512:
6
- metadata.gz: 26739836b0a69de01ac5b1e434785ebea9c326f1ffd267f678871fe7b55ae97efcb3e96924818f34381d5f84aeb9058bb0c1f910067ff7e57323feec30534178
7
- data.tar.gz: b8a1befad594ecb5a21ab6958cf151bec431dc1b40f20b6f3a0558c98b318958ad98f0a37b287e385968d53742193bdfe48d9d9d3fd7efa77a0f6a6fd5696da8
6
+ metadata.gz: 6611b30c71a48d85c966ed651b17589f7821cade59f4b0d59b00f70e1b9f0ec428e0681a884ebe3762713833a0530f8ae126c5a7c40a3a6359b0cad9434cc1cd
7
+ data.tar.gz: 8e8ac4d022373be86821ced23c2ae3378a6e8bc94d7de420d6a5d1a258ca19034930e1438a9e1767f2594d573db326c21988217ac1d12f330ce4aa1794e2ac8f
@@ -283,7 +283,7 @@ module GoCardlessPro
283
283
  'User-Agent' => "#{user_agent}",
284
284
  'Content-Type' => 'application/json',
285
285
  'GoCardless-Client-Library' => 'gocardless-pro-ruby',
286
- 'GoCardless-Client-Version' => '4.26.0',
286
+ 'GoCardless-Client-Version' => '4.27.0',
287
287
  },
288
288
  }
289
289
  end
@@ -13,16 +13,35 @@ module GoCardlessPro
13
13
  # Performs a bank details lookup. As part of the lookup, a modulus check and
14
14
  # reachability check are performed.
15
15
  #
16
- # For UK or Eurozone-based bank accounts, where an account holder name is
17
- # provided
18
- # (and an account number, a sort code or an IBAN are already present), we verify
19
- # that
20
- # the account holder name and bank account number match the details held by the
21
- # relevant bank.
16
+ # For UK (Bacs) and Eurozone (SEPA) bank accounts, where an account holder name
17
+ # is provided
18
+ # (and an account number, a sort code or an IBAN are already present), we run
19
+ # Payer Name Verification
20
+ # to check that the account holder name matches the bank account details held by
21
+ # the relevant bank.
22
22
  # If there is no match, the endpoint will return a 422 - validation error on
23
23
  # account_holder_name:
24
24
  # "Account holder name does not match bank account details provided".
25
25
  #
26
+ # Otherwise, the result is returned in `payer_name_verification_result`:
27
+ #
28
+ # - `full`: the name matches the name held by the bank.
29
+ # - `close`: the name is a close but not exact match. Whether a name counts as
30
+ # close is decided by the payer's bank, so it can vary from bank to bank.
31
+ # - `cannot_perform_verification`: the check was attempted but could not be
32
+ # completed, for example because the bank does not support it or did not respond
33
+ # in time.
34
+ # - `null`: no check was performed, because the scheme does not support Payer
35
+ # Name Verification or no account holder name was provided.
36
+ #
37
+ # Sandbox: Payer Name Verification is simulated in sandbox rather than run
38
+ # against the bank. To trigger each result, use the test bank details from the
39
+ # testing instructions
40
+ # (https://docs.gocardless.com/docs/developer-resources/scenario-simulators#payer-name-verification)
41
+ # and set `account_holder_name` to `full match`, `close match`, `no match` or
42
+ # `cannot perform verification` (not case sensitive). With any other name, no
43
+ # check is performed.
44
+ #
26
45
  # If your request returns an error
27
46
  # (https://docs.gocardless.com/docs/api-reference/responses-and-errors) or the
28
47
  # `available_debit_schemes`
@@ -114,13 +114,34 @@ module GoCardlessPro
114
114
  #
115
115
  # BACS and SEPA schemes Payer Name Verification
116
116
  # (https://hub.gocardless.com/s/article/Introduction-to-Payer-Name-Verification?language=en_GB)
117
- # is enabled by default for UK and Eurozone based bank accounts, meaning we
118
- # verify the account holder name and bank account number/IBAN match
119
- # the details held by the relevant bank. If there is no match, the endpoint will
120
- # return a 422 - validation error on account_holder_name:
121
- # "Account holder name does not match bank account details provided". Testing
122
- # instructions are here
117
+ # checks that the account holder name matches the bank account number/IBAN held
118
+ # by the relevant bank.
119
+ #
120
+ # - Bacs (UK): enabled by default. To opt out, contact support or your account
121
+ # manager.
122
+ # - SEPA (Eurozone): not enabled by default. To turn it on, contact support or
123
+ # your account manager. Until then, the check runs in the background and never
124
+ # affects the request.
125
+ #
126
+ # If there is no match, the endpoint will return a 422 - validation error on
127
+ # account_holder_name:
128
+ # "Account holder name does not match bank account details provided". A close
129
+ # match, or a check that cannot be completed, does not block the request.
130
+ # Whether a name counts as a close match is decided by the payer's bank, so it
131
+ # can vary from bank to bank.
132
+ #
133
+ # Where a check was performed during the request, the result is returned in
134
+ # `payer_name_verification_result` on `resources.customer_bank_account`, as
135
+ # `full`, `close` or `cannot_perform_verification`. The field is omitted if no
136
+ # check was performed.
137
+ #
138
+ # Sandbox: Payer Name Verification is simulated in sandbox rather than run
139
+ # against the bank. To trigger each result, use the test bank details from the
140
+ # testing instructions
123
141
  # (https://docs.gocardless.com/docs/developer-resources/scenario-simulators#payer-name-verification)
142
+ # and set `account_holder_name` to `full match`, `close match`, `no match` or
143
+ # `cannot perform verification` (not case sensitive). With any other name, no
144
+ # check is performed.
124
145
  # Example URL: /billing_requests/:identity/actions/collect_bank_account
125
146
  #
126
147
  # @param identity # Unique identifier, beginning with "BRQ".
@@ -143,6 +143,72 @@ module GoCardlessPro
143
143
  Resources::Customer.new(unenvelope_body(response.body), response)
144
144
  end
145
145
 
146
+ # Submits the date of birth of a customer, in response to a
147
+ # `request_for_information_required`
148
+ # event. Only available to organisations enabled for this by GoCardless, and
149
+ # only with an API key.
150
+ # Returns the customer. Submitting again when a date of birth is already held
151
+ # for the
152
+ # customer also returns 200 and changes nothing, so the event can be handled
153
+ # idempotently.
154
+ #
155
+ # This fails with:
156
+ #
157
+ # -
158
+ # `date_of_birth_not_requested` if no date of birth has been requested for the
159
+ # customer, or
160
+ # the organisation is not enabled.
161
+ # -
162
+ # `date_of_birth_request_closed` if the request has finished (answered, expired
163
+ # or cancelled).
164
+ # -
165
+ # `validation_failed` if the date is in the future or before 1900-01-01.
166
+ # -
167
+ # an `invalid_api_usage` error (422) on `date_of_birth` if the date is not a
168
+ # valid ISO 8601
169
+ # calendar date (YYYY-MM-DD).
170
+ # -
171
+ # an `invalid_api_usage` error (400, invalid document structure) if the request
172
+ # contains any
173
+ # field other than `date_of_birth`.
174
+ # Example URL: /customers/:identity/date_of_birth
175
+ #
176
+ # @param identity # Unique identifier, beginning with "CU".
177
+ # @param options [Hash] parameters as a hash, under a params key.
178
+ def submit_date_of_birth(identity, options = {})
179
+ path = sub_url('/customers/:identity/date_of_birth', {
180
+ 'identity' => identity,
181
+ })
182
+
183
+ params = options.delete(:params) || {}
184
+ options[:params] = {}
185
+ options[:params]['data'] = params
186
+
187
+ options[:retry_failures] = false
188
+
189
+ begin
190
+ response = make_request(:post, path, options)
191
+
192
+ # Response doesn't raise any errors until #body is called
193
+ response.tap(&:body)
194
+ rescue InvalidStateError => e
195
+ if e.idempotent_creation_conflict?
196
+ case @api_service.on_idempotency_conflict
197
+ when :raise
198
+ raise IdempotencyConflict.new(e.error)
199
+ when :fetch
200
+ return get(e.conflicting_resource_id)
201
+ end
202
+ end
203
+
204
+ raise e
205
+ end
206
+
207
+ return if response.body.nil?
208
+
209
+ Resources::Customer.new(unenvelope_body(response.body), response)
210
+ end
211
+
146
212
  private
147
213
 
148
214
  # Unenvelope the response of the body using the service's `envelope_key`
@@ -3,5 +3,5 @@ end
3
3
 
4
4
  module GoCardlessPro
5
5
  # Current version of the GC gem
6
- VERSION = '4.26.0'
6
+ VERSION = '4.27.0'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gocardless_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.26.0
4
+ version: 4.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
@@ -77,14 +77,14 @@ dependencies:
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: 1.92.2
80
+ version: 1.92.3
81
81
  type: :development
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 1.92.2
87
+ version: 1.92.3
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: yard
90
90
  requirement: !ruby/object:Gem::Requirement