gocardless_pro 2.40.0 → 2.41.1
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/Gemfile +2 -1
- data/lib/gocardless_pro/api_service.rb +4 -5
- data/lib/gocardless_pro/client.rb +13 -3
- data/lib/gocardless_pro/error/invalid_state_error.rb +1 -0
- data/lib/gocardless_pro/error.rb +1 -0
- data/lib/gocardless_pro/middlewares/raise_gocardless_errors.rb +7 -9
- data/lib/gocardless_pro/request.rb +5 -7
- data/lib/gocardless_pro/resources/bank_authorisation.rb +0 -2
- data/lib/gocardless_pro/resources/bank_details_lookup.rb +0 -2
- data/lib/gocardless_pro/resources/billing_request.rb +0 -2
- data/lib/gocardless_pro/resources/billing_request_flow.rb +0 -2
- data/lib/gocardless_pro/resources/billing_request_template.rb +0 -2
- data/lib/gocardless_pro/resources/block.rb +0 -2
- data/lib/gocardless_pro/resources/creditor.rb +0 -2
- data/lib/gocardless_pro/resources/creditor_bank_account.rb +0 -2
- data/lib/gocardless_pro/resources/currency_exchange_rate.rb +0 -2
- data/lib/gocardless_pro/resources/customer.rb +0 -2
- data/lib/gocardless_pro/resources/customer_bank_account.rb +0 -2
- data/lib/gocardless_pro/resources/customer_notification.rb +0 -2
- data/lib/gocardless_pro/resources/event.rb +0 -2
- data/lib/gocardless_pro/resources/instalment_schedule.rb +0 -2
- data/lib/gocardless_pro/resources/institution.rb +0 -2
- data/lib/gocardless_pro/resources/mandate.rb +2 -2
- data/lib/gocardless_pro/resources/mandate_import.rb +0 -2
- data/lib/gocardless_pro/resources/mandate_import_entry.rb +0 -2
- data/lib/gocardless_pro/resources/mandate_pdf.rb +0 -2
- data/lib/gocardless_pro/resources/payer_authorisation.rb +0 -2
- data/lib/gocardless_pro/resources/payment.rb +0 -2
- data/lib/gocardless_pro/resources/payout.rb +0 -2
- data/lib/gocardless_pro/resources/payout_item.rb +0 -2
- data/lib/gocardless_pro/resources/redirect_flow.rb +0 -2
- data/lib/gocardless_pro/resources/refund.rb +0 -2
- data/lib/gocardless_pro/resources/scenario_simulator.rb +0 -2
- data/lib/gocardless_pro/resources/scheme_identifier.rb +73 -0
- data/lib/gocardless_pro/resources/subscription.rb +0 -2
- data/lib/gocardless_pro/resources/tax_rate.rb +0 -2
- data/lib/gocardless_pro/resources/verification_detail.rb +66 -0
- data/lib/gocardless_pro/resources/webhook.rb +0 -2
- data/lib/gocardless_pro/services/bank_authorisations_service.rb +3 -1
- data/lib/gocardless_pro/services/billing_request_flows_service.rb +3 -1
- data/lib/gocardless_pro/services/billing_request_templates_service.rb +6 -2
- data/lib/gocardless_pro/services/billing_requests_service.rb +27 -9
- data/lib/gocardless_pro/services/blocks_service.rb +9 -3
- data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +6 -2
- data/lib/gocardless_pro/services/creditors_service.rb +52 -2
- data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +9 -3
- data/lib/gocardless_pro/services/customer_notifications_service.rb +3 -1
- data/lib/gocardless_pro/services/customers_service.rb +9 -3
- data/lib/gocardless_pro/services/events_service.rb +3 -1
- data/lib/gocardless_pro/services/instalment_schedules_service.rb +9 -3
- data/lib/gocardless_pro/services/mandate_imports_service.rb +9 -3
- data/lib/gocardless_pro/services/mandates_service.rb +12 -4
- data/lib/gocardless_pro/services/payer_authorisations_service.rb +12 -4
- data/lib/gocardless_pro/services/payments_service.rb +12 -4
- data/lib/gocardless_pro/services/payouts_service.rb +6 -2
- data/lib/gocardless_pro/services/redirect_flows_service.rb +6 -2
- data/lib/gocardless_pro/services/refunds_service.rb +6 -2
- data/lib/gocardless_pro/services/scenario_simulators_service.rb +3 -1
- data/lib/gocardless_pro/services/scheme_identifiers_service.rb +116 -0
- data/lib/gocardless_pro/services/subscriptions_service.rb +15 -5
- data/lib/gocardless_pro/services/tax_rates_service.rb +3 -1
- data/lib/gocardless_pro/services/verification_details_service.rb +51 -0
- data/lib/gocardless_pro/services/webhooks_service.rb +6 -2
- data/lib/gocardless_pro/version.rb +1 -2
- data/lib/gocardless_pro/webhook.rb +5 -4
- data/lib/gocardless_pro.rb +8 -4
- metadata +10 -188
- data/.github/workflows/tests.yml +0 -42
- data/.gitignore +0 -1
- data/.rspec +0 -2
- data/.rubocop.yml +0 -5
- data/.travis.yml +0 -10
- data/LICENSE.txt +0 -22
- data/demo.rb +0 -9
- data/gocardless_pro.gemspec +0 -39
- data/spec/api_response_spec.rb +0 -28
- data/spec/api_service_spec.rb +0 -188
- data/spec/client_spec.rb +0 -19
- data/spec/error_spec.rb +0 -53
- data/spec/middlewares/raise_gocardless_errors_spec.rb +0 -127
- data/spec/resources/bank_authorisation_spec.rb +0 -259
- data/spec/resources/bank_details_lookup_spec.rb +0 -121
- data/spec/resources/billing_request_flow_spec.rb +0 -257
- data/spec/resources/billing_request_spec.rb +0 -962
- data/spec/resources/billing_request_template_spec.rb +0 -515
- data/spec/resources/block_spec.rb +0 -577
- data/spec/resources/creditor_bank_account_spec.rb +0 -472
- data/spec/resources/creditor_spec.rb +0 -565
- data/spec/resources/currency_exchange_rate_spec.rb +0 -103
- data/spec/resources/customer_bank_account_spec.rb +0 -509
- data/spec/resources/customer_notification_spec.rb +0 -75
- data/spec/resources/customer_spec.rb +0 -616
- data/spec/resources/event_spec.rb +0 -210
- data/spec/resources/instalment_schedule_spec.rb +0 -636
- data/spec/resources/institution_spec.rb +0 -113
- data/spec/resources/mandate_import_entry_spec.rb +0 -206
- data/spec/resources/mandate_import_spec.rb +0 -344
- data/spec/resources/mandate_pdf_spec.rb +0 -117
- data/spec/resources/mandate_spec.rb +0 -583
- data/spec/resources/payer_authorisation_spec.rb +0 -422
- data/spec/resources/payment_spec.rb +0 -617
- data/spec/resources/payout_item_spec.rb +0 -101
- data/spec/resources/payout_spec.rb +0 -284
- data/spec/resources/redirect_flow_spec.rb +0 -347
- data/spec/resources/refund_spec.rb +0 -409
- data/spec/resources/scenario_simulator_spec.rb +0 -65
- data/spec/resources/subscription_spec.rb +0 -828
- data/spec/resources/tax_rate_spec.rb +0 -198
- data/spec/resources/webhook_spec.rb +0 -325
- data/spec/response_spec.rb +0 -34
- data/spec/services/bank_authorisations_service_spec.rb +0 -353
- data/spec/services/bank_details_lookups_service_spec.rb +0 -144
- data/spec/services/billing_request_flows_service_spec.rb +0 -291
- data/spec/services/billing_request_templates_service_spec.rb +0 -806
- data/spec/services/billing_requests_service_spec.rb +0 -1288
- data/spec/services/blocks_service_spec.rb +0 -840
- data/spec/services/creditor_bank_accounts_service_spec.rb +0 -725
- data/spec/services/creditors_service_spec.rb +0 -872
- data/spec/services/currency_exchange_rates_service_spec.rb +0 -223
- data/spec/services/customer_bank_accounts_service_spec.rb +0 -787
- data/spec/services/customer_notifications_service_spec.rb +0 -86
- data/spec/services/customers_service_spec.rb +0 -922
- data/spec/services/events_service_spec.rb +0 -401
- data/spec/services/instalment_schedules_service_spec.rb +0 -945
- data/spec/services/institutions_service_spec.rb +0 -241
- data/spec/services/mandate_import_entries_service_spec.rb +0 -345
- data/spec/services/mandate_imports_service_spec.rb +0 -460
- data/spec/services/mandate_pdfs_service_spec.rb +0 -140
- data/spec/services/mandates_service_spec.rb +0 -872
- data/spec/services/payer_authorisations_service_spec.rb +0 -563
- data/spec/services/payments_service_spec.rb +0 -914
- data/spec/services/payout_items_service_spec.rb +0 -221
- data/spec/services/payouts_service_spec.rb +0 -520
- data/spec/services/redirect_flows_service_spec.rb +0 -452
- data/spec/services/refunds_service_spec.rb +0 -668
- data/spec/services/scenario_simulators_service_spec.rb +0 -76
- data/spec/services/subscriptions_service_spec.rb +0 -1164
- data/spec/services/tax_rates_service_spec.rb +0 -381
- data/spec/services/webhooks_service_spec.rb +0 -547
- data/spec/spec_helper.rb +0 -90
- data/spec/webhook_spec.rb +0 -122
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e9725480d2dc2fc482dae8257c5f426aed030db8f58f51d074e9ddcdbe862de
|
|
4
|
+
data.tar.gz: a5811ee88da9fc7ef0e05c22978d4a47b85c25ec99c85bacb03f61deaa1363e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd894ee1d6988315558c652f2f9bc7cb91f81cb2ffa12c3f379be7e6737f303d329e0056d8b1bc6f2e2f50688623cdfa23499bf5ceec4417b1ab16d33b9a5b6c
|
|
7
|
+
data.tar.gz: 05f5e838a611c7ba37d406ccb66e2df50b6f1a30cae552c7fcdbf9b62b59c4b579609008e94b158197a46fd0b3a5fa9dcffd45971d79fb4d040b87989ba49aa9
|
data/Gemfile
CHANGED
|
@@ -3,7 +3,8 @@ gemspec
|
|
|
3
3
|
|
|
4
4
|
# We support both pre-1.x and post-1.x Faraday versions, but to ensure compatibility we
|
|
5
5
|
# pin this gem against each in separate runs of CI, using the FARADAY_VERSION env var. For
|
|
6
|
-
# more details on the values, see .
|
|
6
|
+
# more details on the values, see .github/workflows/tests.yml in the gocardless-pro-ruby
|
|
7
|
+
# repository.
|
|
7
8
|
if ENV.key?("FARADAY_VERSION")
|
|
8
9
|
gem 'faraday', "~> #{ENV["FARADAY_VERSION"]}"
|
|
9
10
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
1
|
#
|
|
4
2
|
# This client is automatically generated from a template and JSON schema definition.
|
|
5
3
|
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
|
@@ -35,9 +33,9 @@ module GoCardlessPro
|
|
|
35
33
|
@headers['Authorization'] = "Bearer #{token}"
|
|
36
34
|
@on_idempotency_conflict = options[:on_idempotency_conflict] || :fetch
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
return if %i[fetch raise].include?(@on_idempotency_conflict)
|
|
37
|
+
|
|
38
|
+
raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
|
|
41
39
|
end
|
|
42
40
|
|
|
43
41
|
# Make a request to the API
|
|
@@ -47,6 +45,7 @@ module GoCardlessPro
|
|
|
47
45
|
# @param options [Hash] the options hash
|
|
48
46
|
def make_request(method, path, options = {})
|
|
49
47
|
raise ArgumentError, 'options must be a hash' unless options.is_a?(Hash)
|
|
48
|
+
|
|
50
49
|
options[:headers] ||= {}
|
|
51
50
|
options[:headers] = @headers.merge(options[:headers])
|
|
52
51
|
Request.new(@connection, method, @path_prefix + path, options).request
|
|
@@ -133,6 +133,11 @@ module GoCardlessPro
|
|
|
133
133
|
@scenario_simulators ||= Services::ScenarioSimulatorsService.new(@api_service)
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
+
# Access to the service for scheme_identifier to make API calls
|
|
137
|
+
def scheme_identifiers
|
|
138
|
+
@scheme_identifiers ||= Services::SchemeIdentifiersService.new(@api_service)
|
|
139
|
+
end
|
|
140
|
+
|
|
136
141
|
# Access to the service for subscription to make API calls
|
|
137
142
|
def subscriptions
|
|
138
143
|
@subscriptions ||= Services::SubscriptionsService.new(@api_service)
|
|
@@ -143,6 +148,11 @@ module GoCardlessPro
|
|
|
143
148
|
@tax_rates ||= Services::TaxRatesService.new(@api_service)
|
|
144
149
|
end
|
|
145
150
|
|
|
151
|
+
# Access to the service for verification_detail to make API calls
|
|
152
|
+
def verification_details
|
|
153
|
+
@verification_details ||= Services::VerificationDetailsService.new(@api_service)
|
|
154
|
+
end
|
|
155
|
+
|
|
146
156
|
# Access to the service for webhook to make API calls
|
|
147
157
|
def webhooks
|
|
148
158
|
@webhooks ||= Services::WebhooksService.new(@api_service)
|
|
@@ -195,10 +205,10 @@ module GoCardlessPro
|
|
|
195
205
|
{
|
|
196
206
|
default_headers: {
|
|
197
207
|
'GoCardless-Version' => '2015-07-06',
|
|
198
|
-
'User-Agent' => user_agent
|
|
208
|
+
'User-Agent' => "#{user_agent}",
|
|
199
209
|
'Content-Type' => 'application/json',
|
|
200
210
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
|
201
|
-
'GoCardless-Client-Version' => '2.
|
|
211
|
+
'GoCardless-Client-Version' => '2.41.1',
|
|
202
212
|
},
|
|
203
213
|
}
|
|
204
214
|
end
|
|
@@ -219,7 +229,7 @@ module GoCardlessPro
|
|
|
219
229
|
comment = [
|
|
220
230
|
"#{ruby_engine}/#{ruby_version}",
|
|
221
231
|
"#{RUBY_ENGINE}/#{interpreter_version}",
|
|
222
|
-
RUBY_PLATFORM
|
|
232
|
+
"#{RUBY_PLATFORM}",
|
|
223
233
|
]
|
|
224
234
|
comment << "faraday/#{Faraday::VERSION}"
|
|
225
235
|
"#{gem_info} #{comment.join(' ')}"
|
data/lib/gocardless_pro/error.rb
CHANGED
|
@@ -5,18 +5,16 @@ module GoCardlessPro
|
|
|
5
5
|
CLIENT_ERROR_STATUSES = 400..500
|
|
6
6
|
|
|
7
7
|
def on_complete(env)
|
|
8
|
-
if !json?(env) || API_ERROR_STATUSES.include?(env.status)
|
|
9
|
-
raise ApiError, generate_error_data(env)
|
|
10
|
-
end
|
|
8
|
+
raise ApiError, generate_error_data(env) if !json?(env) || API_ERROR_STATUSES.include?(env.status)
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
json_body ||= JSON.parse(env.body) unless env.body.empty?
|
|
14
|
-
error_type = json_body['error']['type']
|
|
10
|
+
return unless CLIENT_ERROR_STATUSES.include?(env.status)
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
json_body ||= JSON.parse(env.body) unless env.body.empty?
|
|
13
|
+
error_type = json_body['error']['type']
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
error_class = error_class_for_status(env.status) || error_class_for_type(error_type)
|
|
16
|
+
|
|
17
|
+
raise(error_class, json_body['error'])
|
|
20
18
|
end
|
|
21
19
|
|
|
22
20
|
private
|
|
@@ -52,15 +52,13 @@ module GoCardlessPro
|
|
|
52
52
|
|
|
53
53
|
begin
|
|
54
54
|
yield
|
|
55
|
-
rescue =>
|
|
55
|
+
rescue StandardError => e
|
|
56
56
|
requests_attempted += 1
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
raise exception
|
|
63
|
-
end
|
|
58
|
+
raise e unless requests_attempted < total_requests_allowed && should_retry?(e)
|
|
59
|
+
|
|
60
|
+
sleep(RETRY_DELAY)
|
|
61
|
+
retry
|
|
64
62
|
end
|
|
65
63
|
end
|
|
66
64
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
1
|
#
|
|
4
2
|
# This client is automatically generated from a template and JSON schema definition.
|
|
5
3
|
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
|
@@ -28,6 +26,7 @@ module GoCardlessPro
|
|
|
28
26
|
attr_reader :reference
|
|
29
27
|
attr_reader :scheme
|
|
30
28
|
attr_reader :status
|
|
29
|
+
attr_reader :verified_at
|
|
31
30
|
|
|
32
31
|
# Initialize a mandate resource instance
|
|
33
32
|
# @param object [Hash] an object returned from the API
|
|
@@ -45,6 +44,7 @@ module GoCardlessPro
|
|
|
45
44
|
@reference = object['reference']
|
|
46
45
|
@scheme = object['scheme']
|
|
47
46
|
@status = object['status']
|
|
47
|
+
@verified_at = object['verified_at']
|
|
48
48
|
@response = response
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This client is automatically generated from a template and JSON schema definition.
|
|
3
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
require 'uri'
|
|
7
|
+
|
|
8
|
+
module GoCardlessPro
|
|
9
|
+
# A module containing classes for each of the resources in the GC Api
|
|
10
|
+
module Resources
|
|
11
|
+
# Represents an instance of a scheme_identifier resource returned from the API
|
|
12
|
+
|
|
13
|
+
# This represents a scheme identifier (e.g. a SUN in Bacs or a CID in SEPA).
|
|
14
|
+
# Scheme identifiers are used to specify the beneficiary name that appears
|
|
15
|
+
# on customers' bank statements.
|
|
16
|
+
#
|
|
17
|
+
class SchemeIdentifier
|
|
18
|
+
attr_reader :address_line1
|
|
19
|
+
attr_reader :address_line2
|
|
20
|
+
attr_reader :address_line3
|
|
21
|
+
attr_reader :can_specify_mandate_reference
|
|
22
|
+
attr_reader :city
|
|
23
|
+
attr_reader :country_code
|
|
24
|
+
attr_reader :created_at
|
|
25
|
+
attr_reader :currency
|
|
26
|
+
attr_reader :email
|
|
27
|
+
attr_reader :id
|
|
28
|
+
attr_reader :minimum_advance_notice
|
|
29
|
+
attr_reader :name
|
|
30
|
+
attr_reader :phone_number
|
|
31
|
+
attr_reader :postal_code
|
|
32
|
+
attr_reader :reference
|
|
33
|
+
attr_reader :region
|
|
34
|
+
attr_reader :scheme
|
|
35
|
+
attr_reader :status
|
|
36
|
+
|
|
37
|
+
# Initialize a scheme_identifier resource instance
|
|
38
|
+
# @param object [Hash] an object returned from the API
|
|
39
|
+
def initialize(object, response = nil)
|
|
40
|
+
@object = object
|
|
41
|
+
|
|
42
|
+
@address_line1 = object['address_line1']
|
|
43
|
+
@address_line2 = object['address_line2']
|
|
44
|
+
@address_line3 = object['address_line3']
|
|
45
|
+
@can_specify_mandate_reference = object['can_specify_mandate_reference']
|
|
46
|
+
@city = object['city']
|
|
47
|
+
@country_code = object['country_code']
|
|
48
|
+
@created_at = object['created_at']
|
|
49
|
+
@currency = object['currency']
|
|
50
|
+
@email = object['email']
|
|
51
|
+
@id = object['id']
|
|
52
|
+
@minimum_advance_notice = object['minimum_advance_notice']
|
|
53
|
+
@name = object['name']
|
|
54
|
+
@phone_number = object['phone_number']
|
|
55
|
+
@postal_code = object['postal_code']
|
|
56
|
+
@reference = object['reference']
|
|
57
|
+
@region = object['region']
|
|
58
|
+
@scheme = object['scheme']
|
|
59
|
+
@status = object['status']
|
|
60
|
+
@response = response
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def api_response
|
|
64
|
+
ApiResponse.new(@response)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Provides the scheme_identifier resource as a hash of all its readable attributes
|
|
68
|
+
def to_h
|
|
69
|
+
@object
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This client is automatically generated from a template and JSON schema definition.
|
|
3
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
require 'uri'
|
|
7
|
+
|
|
8
|
+
module GoCardlessPro
|
|
9
|
+
# A module containing classes for each of the resources in the GC Api
|
|
10
|
+
module Resources
|
|
11
|
+
# Represents an instance of a verification_detail resource returned from the API
|
|
12
|
+
|
|
13
|
+
# Details of a creditor that are required for verification
|
|
14
|
+
class VerificationDetail
|
|
15
|
+
attr_reader :address_line1
|
|
16
|
+
attr_reader :address_line2
|
|
17
|
+
attr_reader :address_line3
|
|
18
|
+
attr_reader :city
|
|
19
|
+
attr_reader :company_number
|
|
20
|
+
attr_reader :description
|
|
21
|
+
attr_reader :directors
|
|
22
|
+
attr_reader :postal_code
|
|
23
|
+
|
|
24
|
+
# Initialize a verification_detail resource instance
|
|
25
|
+
# @param object [Hash] an object returned from the API
|
|
26
|
+
def initialize(object, response = nil)
|
|
27
|
+
@object = object
|
|
28
|
+
|
|
29
|
+
@address_line1 = object['address_line1']
|
|
30
|
+
@address_line2 = object['address_line2']
|
|
31
|
+
@address_line3 = object['address_line3']
|
|
32
|
+
@city = object['city']
|
|
33
|
+
@company_number = object['company_number']
|
|
34
|
+
@description = object['description']
|
|
35
|
+
@directors = object['directors']
|
|
36
|
+
@links = object['links']
|
|
37
|
+
@postal_code = object['postal_code']
|
|
38
|
+
@response = response
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def api_response
|
|
42
|
+
ApiResponse.new(@response)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Return the links that the resource has
|
|
46
|
+
def links
|
|
47
|
+
@verification_detail_links ||= Links.new(@links)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Provides the verification_detail resource as a hash of all its readable attributes
|
|
51
|
+
def to_h
|
|
52
|
+
@object
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
class Links
|
|
56
|
+
def initialize(links)
|
|
57
|
+
@links = links || {}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def creditor
|
|
61
|
+
@links['creditor']
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -16,7 +16,9 @@ module GoCardlessPro
|
|
|
16
16
|
# @param identity # Unique identifier, beginning with "BAU".
|
|
17
17
|
# @param options [Hash] parameters as a hash, under a params key.
|
|
18
18
|
def get(identity, options = {})
|
|
19
|
-
path = sub_url('/bank_authorisations/:identity',
|
|
19
|
+
path = sub_url('/bank_authorisations/:identity', {
|
|
20
|
+
'identity' => identity,
|
|
21
|
+
})
|
|
20
22
|
|
|
21
23
|
options[:retry_failures] = true
|
|
22
24
|
|
|
@@ -37,7 +37,9 @@ module GoCardlessPro
|
|
|
37
37
|
# @param identity # Unique identifier, beginning with "BRF".
|
|
38
38
|
# @param options [Hash] parameters as a hash, under a params key.
|
|
39
39
|
def initialise(identity, options = {})
|
|
40
|
-
path = sub_url('/billing_request_flows/:identity/actions/initialise',
|
|
40
|
+
path = sub_url('/billing_request_flows/:identity/actions/initialise', {
|
|
41
|
+
'identity' => identity,
|
|
42
|
+
})
|
|
41
43
|
|
|
42
44
|
params = options.delete(:params) || {}
|
|
43
45
|
options[:params] = {}
|
|
@@ -45,7 +45,9 @@ module GoCardlessPro
|
|
|
45
45
|
# @param identity # Unique identifier, beginning with "BRT".
|
|
46
46
|
# @param options [Hash] parameters as a hash, under a params key.
|
|
47
47
|
def get(identity, options = {})
|
|
48
|
-
path = sub_url('/billing_request_templates/:identity',
|
|
48
|
+
path = sub_url('/billing_request_templates/:identity', {
|
|
49
|
+
'identity' => identity,
|
|
50
|
+
})
|
|
49
51
|
|
|
50
52
|
options[:retry_failures] = true
|
|
51
53
|
|
|
@@ -98,7 +100,9 @@ module GoCardlessPro
|
|
|
98
100
|
# @param identity # Unique identifier, beginning with "BRQ".
|
|
99
101
|
# @param options [Hash] parameters as a hash, under a params key.
|
|
100
102
|
def update(identity, options = {})
|
|
101
|
-
path = sub_url('/billing_request_templates/:identity',
|
|
103
|
+
path = sub_url('/billing_request_templates/:identity', {
|
|
104
|
+
'identity' => identity,
|
|
105
|
+
})
|
|
102
106
|
|
|
103
107
|
params = options.delete(:params) || {}
|
|
104
108
|
options[:params] = {}
|