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 +4 -4
- data/lib/gocardless_pro/client.rb +1 -1
- data/lib/gocardless_pro/services/bank_details_lookups_service.rb +25 -6
- data/lib/gocardless_pro/services/billing_requests_service.rb +27 -6
- data/lib/gocardless_pro/services/customers_service.rb +66 -0
- data/lib/gocardless_pro/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b38ad3be6fbc6bbf4f7c1107d78fe30986b17e5d6c7568a963c3d8ff11b8a12
|
|
4
|
+
data.tar.gz: 5ce26c1cf8cc55853e400f744b8882a5b61018146712e67e9a4e41bf0b542479
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
|
17
|
-
# provided
|
|
18
|
-
# (and an account number, a sort code or an IBAN are already present), we
|
|
19
|
-
#
|
|
20
|
-
# the account holder name
|
|
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
|
-
#
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
#
|
|
121
|
-
#
|
|
122
|
-
#
|
|
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`
|
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.
|
|
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.
|
|
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.
|
|
87
|
+
version: 1.92.3
|
|
88
88
|
- !ruby/object:Gem::Dependency
|
|
89
89
|
name: yard
|
|
90
90
|
requirement: !ruby/object:Gem::Requirement
|