gocardless_pro 2.43.0 → 2.44.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gocardless_pro/client.rb +1 -1
- data/lib/gocardless_pro/resources/billing_request_flow.rb +2 -0
- data/lib/gocardless_pro/resources/event.rb +4 -0
- data/lib/gocardless_pro/resources/payout_item.rb +5 -1
- data/lib/gocardless_pro/resources/redirect_flow.rb +6 -0
- data/lib/gocardless_pro/resources/verification_detail.rb +11 -1
- data/lib/gocardless_pro/services/bank_authorisations_service.rb +19 -19
- data/lib/gocardless_pro/services/billing_requests_service.rb +122 -80
- data/lib/gocardless_pro/services/institutions_service.rb +30 -0
- data/lib/gocardless_pro/services/payout_items_service.rb +3 -5
- data/lib/gocardless_pro/services/scheme_identifiers_service.rb +30 -4
- data/lib/gocardless_pro/services/verification_details_service.rb +19 -23
- data/lib/gocardless_pro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f18c023fdf2776637fc1228dbd79184ac6f669be1733e9d45a8b0d83fd75811f
|
4
|
+
data.tar.gz: f38f5cffffeefd3fde896538c9767c89c4e4b9075d8f2b153223ed6a6b235942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b400be69bb579451995ccaa792e3b25429858ba4ea32aa6d26105c5a767bbefb587a3537a6cb9740469ee7c1628d390cab66073aa5d66b0b21dc52428e5774b5
|
7
|
+
data.tar.gz: 1e8552a627d5bf46361e3871442341d6a464b49065d91c2034535cffad18a6e6476fa4dfc86c85118d532982373de62c5f1d9421ee5239d02813246c5d0bcc94
|
@@ -208,7 +208,7 @@ module GoCardlessPro
|
|
208
208
|
'User-Agent' => "#{user_agent}",
|
209
209
|
'Content-Type' => 'application/json',
|
210
210
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
211
|
-
'GoCardless-Client-Version' => '2.
|
211
|
+
'GoCardless-Client-Version' => '2.44.0',
|
212
212
|
},
|
213
213
|
}
|
214
214
|
end
|
@@ -29,6 +29,7 @@ module GoCardlessPro
|
|
29
29
|
attr_reader :redirect_uri
|
30
30
|
attr_reader :session_token
|
31
31
|
attr_reader :show_redirect_buttons
|
32
|
+
attr_reader :show_success_redirect_button
|
32
33
|
|
33
34
|
# Initialize a billing_request_flow resource instance
|
34
35
|
# @param object [Hash] an object returned from the API
|
@@ -51,6 +52,7 @@ module GoCardlessPro
|
|
51
52
|
@redirect_uri = object['redirect_uri']
|
52
53
|
@session_token = object['session_token']
|
53
54
|
@show_redirect_buttons = object['show_redirect_buttons']
|
55
|
+
@show_success_redirect_button = object['show_success_redirect_button']
|
54
56
|
@response = response
|
55
57
|
end
|
56
58
|
|
@@ -26,7 +26,11 @@ module GoCardlessPro
|
|
26
26
|
#
|
27
27
|
# The Payout Items API allows you to view, on a per-payout basis, the credit
|
28
28
|
# and debit
|
29
|
-
# items that make up that payout's amount.
|
29
|
+
# items that make up that payout's amount. Payout items can only be
|
30
|
+
# retrieved for payouts
|
31
|
+
# created in the last 6 months. Requests for older payouts will return an
|
32
|
+
# HTTP status
|
33
|
+
# <code>410 Gone</code>.
|
30
34
|
#
|
31
35
|
class PayoutItem
|
32
36
|
attr_reader :amount
|
@@ -10,6 +10,12 @@ module GoCardlessPro
|
|
10
10
|
module Resources
|
11
11
|
# Represents an instance of a redirect_flow resource returned from the API
|
12
12
|
|
13
|
+
# <p class="deprecated-notice"><strong>Deprecated</strong>: Redirect Flows
|
14
|
+
# are our legacy APIs for setting up
|
15
|
+
# mandates and will no longer be supported in the future. We strongly
|
16
|
+
# recommend using the
|
17
|
+
# [Billing Request flow](#billing-requests) instead.</p>
|
18
|
+
#
|
13
19
|
# Redirect flows enable you to use GoCardless' [hosted payment
|
14
20
|
# pages](https://pay-sandbox.gocardless.com/AL000000AKFPFF) to set up
|
15
21
|
# mandates with your customers. These pages are fully compliant and have
|
@@ -10,7 +10,17 @@ module GoCardlessPro
|
|
10
10
|
module Resources
|
11
11
|
# Represents an instance of a verification_detail resource returned from the API
|
12
12
|
|
13
|
-
#
|
13
|
+
# Verification details represent any information needed by GoCardless to
|
14
|
+
# verify a creditor.
|
15
|
+
#
|
16
|
+
# <p class="restricted-notice"><strong>Restricted</strong>:
|
17
|
+
# These endpoints are restricted to customers who want to collect their
|
18
|
+
# merchant's
|
19
|
+
# verification details and pass them to GoCardless via our API. Please
|
20
|
+
# [get in
|
21
|
+
# touch](mailto:help@gocardless.com) if you wish to enable this feature on
|
22
|
+
# your
|
23
|
+
# account.</p>
|
14
24
|
class VerificationDetail
|
15
25
|
attr_reader :address_line1
|
16
26
|
attr_reader :address_line2
|
@@ -10,25 +10,6 @@ module GoCardlessPro
|
|
10
10
|
module Services
|
11
11
|
# Service for making requests to the BankAuthorisation endpoints
|
12
12
|
class BankAuthorisationsService < BaseService
|
13
|
-
# Fetches a bank authorisation
|
14
|
-
# Example URL: /bank_authorisations/:identity
|
15
|
-
#
|
16
|
-
# @param identity # Unique identifier, beginning with "BAU".
|
17
|
-
# @param options [Hash] parameters as a hash, under a params key.
|
18
|
-
def get(identity, options = {})
|
19
|
-
path = sub_url('/bank_authorisations/:identity', {
|
20
|
-
'identity' => identity,
|
21
|
-
})
|
22
|
-
|
23
|
-
options[:retry_failures] = true
|
24
|
-
|
25
|
-
response = make_request(:get, path, options)
|
26
|
-
|
27
|
-
return if response.body.nil?
|
28
|
-
|
29
|
-
Resources::BankAuthorisation.new(unenvelope_body(response.body), response)
|
30
|
-
end
|
31
|
-
|
32
13
|
# Create a Bank Authorisation.
|
33
14
|
# Example URL: /bank_authorisations
|
34
15
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -64,6 +45,25 @@ module GoCardlessPro
|
|
64
45
|
Resources::BankAuthorisation.new(unenvelope_body(response.body), response)
|
65
46
|
end
|
66
47
|
|
48
|
+
# Get a single bank authorisation.
|
49
|
+
# Example URL: /bank_authorisations/:identity
|
50
|
+
#
|
51
|
+
# @param identity # Unique identifier, beginning with "BAU".
|
52
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
53
|
+
def get(identity, options = {})
|
54
|
+
path = sub_url('/bank_authorisations/:identity', {
|
55
|
+
'identity' => identity,
|
56
|
+
})
|
57
|
+
|
58
|
+
options[:retry_failures] = true
|
59
|
+
|
60
|
+
response = make_request(:get, path, options)
|
61
|
+
|
62
|
+
return if response.body.nil?
|
63
|
+
|
64
|
+
Resources::BankAuthorisation.new(unenvelope_body(response.body), response)
|
65
|
+
end
|
66
|
+
|
67
67
|
private
|
68
68
|
|
69
69
|
# Unenvelope the response of the body using the service's `envelope_key`
|
@@ -10,35 +10,6 @@ module GoCardlessPro
|
|
10
10
|
module Services
|
11
11
|
# Service for making requests to the BillingRequest endpoints
|
12
12
|
class BillingRequestsService < BaseService
|
13
|
-
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
14
|
-
# billing requests.
|
15
|
-
# Example URL: /billing_requests
|
16
|
-
# @param options [Hash] parameters as a hash, under a params key.
|
17
|
-
def list(options = {})
|
18
|
-
path = '/billing_requests'
|
19
|
-
|
20
|
-
options[:retry_failures] = true
|
21
|
-
|
22
|
-
response = make_request(:get, path, options)
|
23
|
-
|
24
|
-
ListResponse.new(
|
25
|
-
response: response,
|
26
|
-
unenveloped_body: unenvelope_body(response.body),
|
27
|
-
resource_class: Resources::BillingRequest
|
28
|
-
)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Get a lazily enumerated list of all the items returned. This is similar to the `list` method but will paginate for you automatically.
|
32
|
-
#
|
33
|
-
# @param options [Hash] parameters as a hash. If the request is a GET, these will be converted to query parameters.
|
34
|
-
# Otherwise they will be the body of the request.
|
35
|
-
def all(options = {})
|
36
|
-
Paginator.new(
|
37
|
-
service: self,
|
38
|
-
options: options
|
39
|
-
).enumerator
|
40
|
-
end
|
41
|
-
|
42
13
|
#
|
43
14
|
# Example URL: /billing_requests
|
44
15
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -74,25 +45,6 @@ module GoCardlessPro
|
|
74
45
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
75
46
|
end
|
76
47
|
|
77
|
-
# Fetches a billing request
|
78
|
-
# Example URL: /billing_requests/:identity
|
79
|
-
#
|
80
|
-
# @param identity # Unique identifier, beginning with "BRQ".
|
81
|
-
# @param options [Hash] parameters as a hash, under a params key.
|
82
|
-
def get(identity, options = {})
|
83
|
-
path = sub_url('/billing_requests/:identity', {
|
84
|
-
'identity' => identity,
|
85
|
-
})
|
86
|
-
|
87
|
-
options[:retry_failures] = true
|
88
|
-
|
89
|
-
response = make_request(:get, path, options)
|
90
|
-
|
91
|
-
return if response.body.nil?
|
92
|
-
|
93
|
-
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
94
|
-
end
|
95
|
-
|
96
48
|
# If the billing request has a pending <code>collect_customer_details</code>
|
97
49
|
# action, this endpoint can be used to collect the details in order to
|
98
50
|
# complete it.
|
@@ -192,6 +144,47 @@ module GoCardlessPro
|
|
192
144
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
193
145
|
end
|
194
146
|
|
147
|
+
# This is needed when you have a mandate request. As a scheme compliance rule we
|
148
|
+
# are required to
|
149
|
+
# allow the payer to crosscheck the details entered by them and confirm it.
|
150
|
+
# Example URL: /billing_requests/:identity/actions/confirm_payer_details
|
151
|
+
#
|
152
|
+
# @param identity # Unique identifier, beginning with "BRQ".
|
153
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
154
|
+
def confirm_payer_details(identity, options = {})
|
155
|
+
path = sub_url('/billing_requests/:identity/actions/confirm_payer_details', {
|
156
|
+
'identity' => identity,
|
157
|
+
})
|
158
|
+
|
159
|
+
params = options.delete(:params) || {}
|
160
|
+
options[:params] = {}
|
161
|
+
options[:params]['data'] = params
|
162
|
+
|
163
|
+
options[:retry_failures] = false
|
164
|
+
|
165
|
+
begin
|
166
|
+
response = make_request(:post, path, options)
|
167
|
+
|
168
|
+
# Response doesn't raise any errors until #body is called
|
169
|
+
response.tap(&:body)
|
170
|
+
rescue InvalidStateError => e
|
171
|
+
if e.idempotent_creation_conflict?
|
172
|
+
case @api_service.on_idempotency_conflict
|
173
|
+
when :raise
|
174
|
+
raise IdempotencyConflict, e.error
|
175
|
+
when :fetch
|
176
|
+
return get(e.conflicting_resource_id)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
raise e
|
181
|
+
end
|
182
|
+
|
183
|
+
return if response.body.nil?
|
184
|
+
|
185
|
+
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
186
|
+
end
|
187
|
+
|
195
188
|
# If a billing request is ready to be fulfilled, call this endpoint to cause
|
196
189
|
# it to fulfil, executing the payment.
|
197
190
|
# Example URL: /billing_requests/:identity/actions/fulfil
|
@@ -232,19 +225,14 @@ module GoCardlessPro
|
|
232
225
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
233
226
|
end
|
234
227
|
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
# flows
|
239
|
-
# which do not have the lock_currency flag set to true on the Billing Request
|
240
|
-
# Flow. It
|
241
|
-
# will also not support any request which has a payments request.
|
242
|
-
# Example URL: /billing_requests/:identity/actions/choose_currency
|
228
|
+
# Immediately cancels a billing request, causing all billing request flows
|
229
|
+
# to expire.
|
230
|
+
# Example URL: /billing_requests/:identity/actions/cancel
|
243
231
|
#
|
244
232
|
# @param identity # Unique identifier, beginning with "BRQ".
|
245
233
|
# @param options [Hash] parameters as a hash, under a params key.
|
246
|
-
def
|
247
|
-
path = sub_url('/billing_requests/:identity/actions/
|
234
|
+
def cancel(identity, options = {})
|
235
|
+
path = sub_url('/billing_requests/:identity/actions/cancel', {
|
248
236
|
'identity' => identity,
|
249
237
|
})
|
250
238
|
|
@@ -277,15 +265,66 @@ module GoCardlessPro
|
|
277
265
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
278
266
|
end
|
279
267
|
|
280
|
-
#
|
281
|
-
#
|
282
|
-
#
|
283
|
-
#
|
268
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
269
|
+
# billing requests.
|
270
|
+
# Example URL: /billing_requests
|
271
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
272
|
+
def list(options = {})
|
273
|
+
path = '/billing_requests'
|
274
|
+
|
275
|
+
options[:retry_failures] = true
|
276
|
+
|
277
|
+
response = make_request(:get, path, options)
|
278
|
+
|
279
|
+
ListResponse.new(
|
280
|
+
response: response,
|
281
|
+
unenveloped_body: unenvelope_body(response.body),
|
282
|
+
resource_class: Resources::BillingRequest
|
283
|
+
)
|
284
|
+
end
|
285
|
+
|
286
|
+
# Get a lazily enumerated list of all the items returned. This is similar to the `list` method but will paginate for you automatically.
|
287
|
+
#
|
288
|
+
# @param options [Hash] parameters as a hash. If the request is a GET, these will be converted to query parameters.
|
289
|
+
# Otherwise they will be the body of the request.
|
290
|
+
def all(options = {})
|
291
|
+
Paginator.new(
|
292
|
+
service: self,
|
293
|
+
options: options
|
294
|
+
).enumerator
|
295
|
+
end
|
296
|
+
|
297
|
+
# Fetches a billing request
|
298
|
+
# Example URL: /billing_requests/:identity
|
284
299
|
#
|
285
300
|
# @param identity # Unique identifier, beginning with "BRQ".
|
286
301
|
# @param options [Hash] parameters as a hash, under a params key.
|
287
|
-
def
|
288
|
-
path = sub_url('/billing_requests/:identity
|
302
|
+
def get(identity, options = {})
|
303
|
+
path = sub_url('/billing_requests/:identity', {
|
304
|
+
'identity' => identity,
|
305
|
+
})
|
306
|
+
|
307
|
+
options[:retry_failures] = true
|
308
|
+
|
309
|
+
response = make_request(:get, path, options)
|
310
|
+
|
311
|
+
return if response.body.nil?
|
312
|
+
|
313
|
+
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
314
|
+
end
|
315
|
+
|
316
|
+
# Notifies the customer linked to the billing request, asking them to authorise
|
317
|
+
# it.
|
318
|
+
# Currently, the customer can only be notified by email.
|
319
|
+
#
|
320
|
+
# This endpoint is currently supported only for Instant Bank Pay Billing
|
321
|
+
# Requests.
|
322
|
+
# Example URL: /billing_requests/:identity/actions/notify
|
323
|
+
#
|
324
|
+
# @param identity # Unique identifier, beginning with "BRQ".
|
325
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
326
|
+
def notify(identity, options = {})
|
327
|
+
path = sub_url('/billing_requests/:identity/actions/notify', {
|
289
328
|
'identity' => identity,
|
290
329
|
})
|
291
330
|
|
@@ -318,14 +357,14 @@ module GoCardlessPro
|
|
318
357
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
319
358
|
end
|
320
359
|
|
321
|
-
#
|
322
|
-
#
|
323
|
-
# Example URL: /billing_requests/:identity/actions/
|
360
|
+
# Triggers a fallback from the open-banking flow to direct debit. Note, the
|
361
|
+
# billing request must have fallback enabled.
|
362
|
+
# Example URL: /billing_requests/:identity/actions/fallback
|
324
363
|
#
|
325
364
|
# @param identity # Unique identifier, beginning with "BRQ".
|
326
365
|
# @param options [Hash] parameters as a hash, under a params key.
|
327
|
-
def
|
328
|
-
path = sub_url('/billing_requests/:identity/actions/
|
366
|
+
def fallback(identity, options = {})
|
367
|
+
path = sub_url('/billing_requests/:identity/actions/fallback', {
|
329
368
|
'identity' => identity,
|
330
369
|
})
|
331
370
|
|
@@ -358,15 +397,19 @@ module GoCardlessPro
|
|
358
397
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
359
398
|
end
|
360
399
|
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
400
|
+
# This will allow for the updating of the currency and subsequently the scheme
|
401
|
+
# if
|
402
|
+
# needed for a Billing Request. This will only be available for mandate only
|
403
|
+
# flows
|
404
|
+
# which do not have the lock_currency flag set to true on the Billing Request
|
405
|
+
# Flow. It
|
406
|
+
# will also not support any request which has a payments request.
|
407
|
+
# Example URL: /billing_requests/:identity/actions/choose_currency
|
365
408
|
#
|
366
409
|
# @param identity # Unique identifier, beginning with "BRQ".
|
367
410
|
# @param options [Hash] parameters as a hash, under a params key.
|
368
|
-
def
|
369
|
-
path = sub_url('/billing_requests/:identity/actions/
|
411
|
+
def choose_currency(identity, options = {})
|
412
|
+
path = sub_url('/billing_requests/:identity/actions/choose_currency', {
|
370
413
|
'identity' => identity,
|
371
414
|
})
|
372
415
|
|
@@ -399,14 +442,13 @@ module GoCardlessPro
|
|
399
442
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
400
443
|
end
|
401
444
|
|
402
|
-
#
|
403
|
-
#
|
404
|
-
# Example URL: /billing_requests/:identity/actions/fallback
|
445
|
+
# Creates an Institution object and attaches it to the Billing Request
|
446
|
+
# Example URL: /billing_requests/:identity/actions/select_institution
|
405
447
|
#
|
406
448
|
# @param identity # Unique identifier, beginning with "BRQ".
|
407
449
|
# @param options [Hash] parameters as a hash, under a params key.
|
408
|
-
def
|
409
|
-
path = sub_url('/billing_requests/:identity/actions/
|
450
|
+
def select_institution(identity, options = {})
|
451
|
+
path = sub_url('/billing_requests/:identity/actions/select_institution', {
|
410
452
|
'identity' => identity,
|
411
453
|
})
|
412
454
|
|
@@ -11,6 +11,13 @@ module GoCardlessPro
|
|
11
11
|
# Service for making requests to the Institution endpoints
|
12
12
|
class InstitutionsService < BaseService
|
13
13
|
# Returns a list of supported institutions.
|
14
|
+
#
|
15
|
+
# <p class="deprecated-notice"><strong>Deprecated</strong>: This list
|
16
|
+
# institutions endpoint
|
17
|
+
# is no longer supported. We strongly recommend using the
|
18
|
+
# [List Institutions For Billing
|
19
|
+
# Request](#institutions-list-institutions-for-billing-request)
|
20
|
+
# instead.</p>
|
14
21
|
# Example URL: /institutions
|
15
22
|
# @param options [Hash] parameters as a hash, under a params key.
|
16
23
|
def list(options = {})
|
@@ -38,6 +45,29 @@ module GoCardlessPro
|
|
38
45
|
).enumerator
|
39
46
|
end
|
40
47
|
|
48
|
+
# Returns all institutions valid for a Billing Request.
|
49
|
+
#
|
50
|
+
# This endpoint is currently supported only for FasterPayments.
|
51
|
+
# Example URL: /billing_requests/:identity/institutions
|
52
|
+
#
|
53
|
+
# @param identity # Unique identifier, beginning with "BRQ".
|
54
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
55
|
+
def list_for_billing_request(identity, options = {})
|
56
|
+
path = sub_url('/billing_requests/:identity/institutions', {
|
57
|
+
'identity' => identity,
|
58
|
+
})
|
59
|
+
|
60
|
+
options[:retry_failures] = false
|
61
|
+
|
62
|
+
response = make_request(:get, path, options)
|
63
|
+
|
64
|
+
ListResponse.new(
|
65
|
+
response: response,
|
66
|
+
unenveloped_body: unenvelope_body(response.body),
|
67
|
+
resource_class: Resources::Institution
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
41
71
|
private
|
42
72
|
|
43
73
|
# Unenvelope the response of the body using the service's `envelope_key`
|
@@ -13,11 +13,9 @@ module GoCardlessPro
|
|
13
13
|
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of items in
|
14
14
|
# the payout.
|
15
15
|
#
|
16
|
-
# <
|
17
|
-
#
|
18
|
-
#
|
19
|
-
# payouts will return an HTTP status <code>410 Gone</code>.
|
20
|
-
# </div>
|
16
|
+
# <strong>This endpoint only serves requests for payouts created in the last 6
|
17
|
+
# months. Requests for older payouts will return an HTTP status <code>410
|
18
|
+
# Gone</code>.</strong>
|
21
19
|
#
|
22
20
|
# Example URL: /payout_items
|
23
21
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -10,11 +10,37 @@ module GoCardlessPro
|
|
10
10
|
module Services
|
11
11
|
# Service for making requests to the SchemeIdentifier endpoints
|
12
12
|
class SchemeIdentifiersService < BaseService
|
13
|
-
# Creates a new scheme identifier. The scheme identifier must be
|
14
|
-
# creditor](#creditors-apply-a-scheme-identifier) before payments
|
13
|
+
# Creates a new scheme identifier. The scheme identifier must be
|
14
|
+
# [applied to a creditor](#creditors-apply-a-scheme-identifier) before payments
|
15
|
+
# are taken
|
15
16
|
# using it. The scheme identifier must also have the `status` of active before
|
16
|
-
# it can be
|
17
|
-
#
|
17
|
+
# it can be
|
18
|
+
# used. For some schemes e.g. faster_payments this will happen instantly. For
|
19
|
+
# other schemes
|
20
|
+
# e.g. bacs this can take several days.
|
21
|
+
#
|
22
|
+
# ### Scheme identifier name validations
|
23
|
+
#
|
24
|
+
# Each scheme has different rules for the length and permitted characters in the
|
25
|
+
# scheme identifier
|
26
|
+
# name field. The rules are:
|
27
|
+
#
|
28
|
+
# | __scheme__ | __maximum length__ | __allowed characters__ | __spaces__
|
29
|
+
# |
|
30
|
+
# | :-------------- | :----------------- | :----------------------- | :---------
|
31
|
+
# |
|
32
|
+
# | bacs | 18 characters | `a-zA-Z0-9/.&-` | yes
|
33
|
+
# |
|
34
|
+
# | sepa_core | 70 characters | `a-zA-Z0-9/?:().,+&<>'"` | yes
|
35
|
+
# |
|
36
|
+
# | ach | 16 characters | `a-zA-Z0-9/?:().,'+-` | yes
|
37
|
+
# |
|
38
|
+
# | faster_payments | 18 characters | `a-zA-Z0-9/?:().,'+-` | yes
|
39
|
+
# |
|
40
|
+
#
|
41
|
+
# The validation error that gets returned for an invalid name will contain a
|
42
|
+
# suggested name
|
43
|
+
# in the metadata that is guaranteed to pass name validations.
|
18
44
|
#
|
19
45
|
# Example URL: /scheme_identifiers
|
20
46
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -10,6 +10,25 @@ module GoCardlessPro
|
|
10
10
|
module Services
|
11
11
|
# Service for making requests to the VerificationDetail endpoints
|
12
12
|
class VerificationDetailsService < BaseService
|
13
|
+
# Creates a new verification detail
|
14
|
+
# Example URL: /verification_details
|
15
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
16
|
+
def create(options = {})
|
17
|
+
path = '/verification_details'
|
18
|
+
|
19
|
+
params = options.delete(:params) || {}
|
20
|
+
options[:params] = {}
|
21
|
+
options[:params][envelope_key] = params
|
22
|
+
|
23
|
+
options[:retry_failures] = true
|
24
|
+
|
25
|
+
response = make_request(:post, path, options)
|
26
|
+
|
27
|
+
return if response.body.nil?
|
28
|
+
|
29
|
+
Resources::VerificationDetail.new(unenvelope_body(response.body), response)
|
30
|
+
end
|
31
|
+
|
13
32
|
# Returns a list of verification details belonging to a creditor.
|
14
33
|
# Example URL: /verification_details
|
15
34
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -38,29 +57,6 @@ module GoCardlessPro
|
|
38
57
|
).enumerator
|
39
58
|
end
|
40
59
|
|
41
|
-
# Verification details represent any information needed by GoCardless to verify
|
42
|
-
# a creditor.
|
43
|
-
# Currently, only UK-based companies are supported.
|
44
|
-
# In other words, to submit verification details for a creditor, their
|
45
|
-
# creditor_type must be company and their country_code must be GB.
|
46
|
-
# Example URL: /verification_details
|
47
|
-
# @param options [Hash] parameters as a hash, under a params key.
|
48
|
-
def create(options = {})
|
49
|
-
path = '/verification_details'
|
50
|
-
|
51
|
-
params = options.delete(:params) || {}
|
52
|
-
options[:params] = {}
|
53
|
-
options[:params][envelope_key] = params
|
54
|
-
|
55
|
-
options[:retry_failures] = true
|
56
|
-
|
57
|
-
response = make_request(:post, path, options)
|
58
|
-
|
59
|
-
return if response.body.nil?
|
60
|
-
|
61
|
-
Resources::VerificationDetail.new(unenvelope_body(response.body), response)
|
62
|
-
end
|
63
|
-
|
64
60
|
private
|
65
61
|
|
66
62
|
# Unenvelope the response of the body using the service's `envelope_key`
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocardless_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.44.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|