gocardless_pro 2.40.0 → 2.41.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/gocardless_pro/api_service.rb +4 -5
  4. data/lib/gocardless_pro/client.rb +13 -3
  5. data/lib/gocardless_pro/error/invalid_state_error.rb +1 -0
  6. data/lib/gocardless_pro/error.rb +1 -0
  7. data/lib/gocardless_pro/middlewares/raise_gocardless_errors.rb +7 -9
  8. data/lib/gocardless_pro/request.rb +5 -7
  9. data/lib/gocardless_pro/resources/bank_authorisation.rb +0 -2
  10. data/lib/gocardless_pro/resources/bank_details_lookup.rb +0 -2
  11. data/lib/gocardless_pro/resources/billing_request.rb +0 -2
  12. data/lib/gocardless_pro/resources/billing_request_flow.rb +0 -2
  13. data/lib/gocardless_pro/resources/billing_request_template.rb +0 -2
  14. data/lib/gocardless_pro/resources/block.rb +0 -2
  15. data/lib/gocardless_pro/resources/creditor.rb +0 -2
  16. data/lib/gocardless_pro/resources/creditor_bank_account.rb +0 -2
  17. data/lib/gocardless_pro/resources/currency_exchange_rate.rb +0 -2
  18. data/lib/gocardless_pro/resources/customer.rb +0 -2
  19. data/lib/gocardless_pro/resources/customer_bank_account.rb +0 -2
  20. data/lib/gocardless_pro/resources/customer_notification.rb +0 -2
  21. data/lib/gocardless_pro/resources/event.rb +0 -2
  22. data/lib/gocardless_pro/resources/instalment_schedule.rb +0 -2
  23. data/lib/gocardless_pro/resources/institution.rb +0 -2
  24. data/lib/gocardless_pro/resources/mandate.rb +2 -2
  25. data/lib/gocardless_pro/resources/mandate_import.rb +0 -2
  26. data/lib/gocardless_pro/resources/mandate_import_entry.rb +0 -2
  27. data/lib/gocardless_pro/resources/mandate_pdf.rb +0 -2
  28. data/lib/gocardless_pro/resources/payer_authorisation.rb +0 -2
  29. data/lib/gocardless_pro/resources/payment.rb +0 -2
  30. data/lib/gocardless_pro/resources/payout.rb +0 -2
  31. data/lib/gocardless_pro/resources/payout_item.rb +0 -2
  32. data/lib/gocardless_pro/resources/redirect_flow.rb +0 -2
  33. data/lib/gocardless_pro/resources/refund.rb +0 -2
  34. data/lib/gocardless_pro/resources/scenario_simulator.rb +0 -2
  35. data/lib/gocardless_pro/resources/scheme_identifier.rb +73 -0
  36. data/lib/gocardless_pro/resources/subscription.rb +0 -2
  37. data/lib/gocardless_pro/resources/tax_rate.rb +0 -2
  38. data/lib/gocardless_pro/resources/verification_detail.rb +66 -0
  39. data/lib/gocardless_pro/resources/webhook.rb +0 -2
  40. data/lib/gocardless_pro/services/bank_authorisations_service.rb +3 -1
  41. data/lib/gocardless_pro/services/billing_request_flows_service.rb +3 -1
  42. data/lib/gocardless_pro/services/billing_request_templates_service.rb +6 -2
  43. data/lib/gocardless_pro/services/billing_requests_service.rb +27 -9
  44. data/lib/gocardless_pro/services/blocks_service.rb +9 -3
  45. data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +6 -2
  46. data/lib/gocardless_pro/services/creditors_service.rb +52 -2
  47. data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +9 -3
  48. data/lib/gocardless_pro/services/customer_notifications_service.rb +3 -1
  49. data/lib/gocardless_pro/services/customers_service.rb +9 -3
  50. data/lib/gocardless_pro/services/events_service.rb +3 -1
  51. data/lib/gocardless_pro/services/instalment_schedules_service.rb +9 -3
  52. data/lib/gocardless_pro/services/mandate_imports_service.rb +9 -3
  53. data/lib/gocardless_pro/services/mandates_service.rb +12 -4
  54. data/lib/gocardless_pro/services/payer_authorisations_service.rb +12 -4
  55. data/lib/gocardless_pro/services/payments_service.rb +12 -4
  56. data/lib/gocardless_pro/services/payouts_service.rb +6 -2
  57. data/lib/gocardless_pro/services/redirect_flows_service.rb +6 -2
  58. data/lib/gocardless_pro/services/refunds_service.rb +6 -2
  59. data/lib/gocardless_pro/services/scenario_simulators_service.rb +3 -1
  60. data/lib/gocardless_pro/services/scheme_identifiers_service.rb +116 -0
  61. data/lib/gocardless_pro/services/subscriptions_service.rb +15 -5
  62. data/lib/gocardless_pro/services/tax_rates_service.rb +3 -1
  63. data/lib/gocardless_pro/services/verification_details_service.rb +51 -0
  64. data/lib/gocardless_pro/services/webhooks_service.rb +6 -2
  65. data/lib/gocardless_pro/version.rb +1 -2
  66. data/lib/gocardless_pro/webhook.rb +5 -4
  67. data/lib/gocardless_pro.rb +8 -4
  68. metadata +10 -188
  69. data/.github/workflows/tests.yml +0 -42
  70. data/.gitignore +0 -1
  71. data/.rspec +0 -2
  72. data/.rubocop.yml +0 -5
  73. data/.travis.yml +0 -10
  74. data/LICENSE.txt +0 -22
  75. data/demo.rb +0 -9
  76. data/gocardless_pro.gemspec +0 -39
  77. data/spec/api_response_spec.rb +0 -28
  78. data/spec/api_service_spec.rb +0 -188
  79. data/spec/client_spec.rb +0 -19
  80. data/spec/error_spec.rb +0 -53
  81. data/spec/middlewares/raise_gocardless_errors_spec.rb +0 -127
  82. data/spec/resources/bank_authorisation_spec.rb +0 -259
  83. data/spec/resources/bank_details_lookup_spec.rb +0 -121
  84. data/spec/resources/billing_request_flow_spec.rb +0 -257
  85. data/spec/resources/billing_request_spec.rb +0 -962
  86. data/spec/resources/billing_request_template_spec.rb +0 -515
  87. data/spec/resources/block_spec.rb +0 -577
  88. data/spec/resources/creditor_bank_account_spec.rb +0 -472
  89. data/spec/resources/creditor_spec.rb +0 -565
  90. data/spec/resources/currency_exchange_rate_spec.rb +0 -103
  91. data/spec/resources/customer_bank_account_spec.rb +0 -509
  92. data/spec/resources/customer_notification_spec.rb +0 -75
  93. data/spec/resources/customer_spec.rb +0 -616
  94. data/spec/resources/event_spec.rb +0 -210
  95. data/spec/resources/instalment_schedule_spec.rb +0 -636
  96. data/spec/resources/institution_spec.rb +0 -113
  97. data/spec/resources/mandate_import_entry_spec.rb +0 -206
  98. data/spec/resources/mandate_import_spec.rb +0 -344
  99. data/spec/resources/mandate_pdf_spec.rb +0 -117
  100. data/spec/resources/mandate_spec.rb +0 -583
  101. data/spec/resources/payer_authorisation_spec.rb +0 -422
  102. data/spec/resources/payment_spec.rb +0 -617
  103. data/spec/resources/payout_item_spec.rb +0 -101
  104. data/spec/resources/payout_spec.rb +0 -284
  105. data/spec/resources/redirect_flow_spec.rb +0 -347
  106. data/spec/resources/refund_spec.rb +0 -409
  107. data/spec/resources/scenario_simulator_spec.rb +0 -65
  108. data/spec/resources/subscription_spec.rb +0 -828
  109. data/spec/resources/tax_rate_spec.rb +0 -198
  110. data/spec/resources/webhook_spec.rb +0 -325
  111. data/spec/response_spec.rb +0 -34
  112. data/spec/services/bank_authorisations_service_spec.rb +0 -353
  113. data/spec/services/bank_details_lookups_service_spec.rb +0 -144
  114. data/spec/services/billing_request_flows_service_spec.rb +0 -291
  115. data/spec/services/billing_request_templates_service_spec.rb +0 -806
  116. data/spec/services/billing_requests_service_spec.rb +0 -1288
  117. data/spec/services/blocks_service_spec.rb +0 -840
  118. data/spec/services/creditor_bank_accounts_service_spec.rb +0 -725
  119. data/spec/services/creditors_service_spec.rb +0 -872
  120. data/spec/services/currency_exchange_rates_service_spec.rb +0 -223
  121. data/spec/services/customer_bank_accounts_service_spec.rb +0 -787
  122. data/spec/services/customer_notifications_service_spec.rb +0 -86
  123. data/spec/services/customers_service_spec.rb +0 -922
  124. data/spec/services/events_service_spec.rb +0 -401
  125. data/spec/services/instalment_schedules_service_spec.rb +0 -945
  126. data/spec/services/institutions_service_spec.rb +0 -241
  127. data/spec/services/mandate_import_entries_service_spec.rb +0 -345
  128. data/spec/services/mandate_imports_service_spec.rb +0 -460
  129. data/spec/services/mandate_pdfs_service_spec.rb +0 -140
  130. data/spec/services/mandates_service_spec.rb +0 -872
  131. data/spec/services/payer_authorisations_service_spec.rb +0 -563
  132. data/spec/services/payments_service_spec.rb +0 -914
  133. data/spec/services/payout_items_service_spec.rb +0 -221
  134. data/spec/services/payouts_service_spec.rb +0 -520
  135. data/spec/services/redirect_flows_service_spec.rb +0 -452
  136. data/spec/services/refunds_service_spec.rb +0 -668
  137. data/spec/services/scenario_simulators_service_spec.rb +0 -76
  138. data/spec/services/subscriptions_service_spec.rb +0 -1164
  139. data/spec/services/tax_rates_service_spec.rb +0 -381
  140. data/spec/services/webhooks_service_spec.rb +0 -547
  141. data/spec/spec_helper.rb +0 -90
  142. data/spec/webhook_spec.rb +0 -122
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e651254dd1b8ee279f19b5c698c1cc0d71412186c7ffc472cd92d403c694d41f
4
- data.tar.gz: 493fc00fae5258c12b24d6a13fff0d2c76db9948b3898a782a6cf4eb59b281c8
3
+ metadata.gz: 8e9725480d2dc2fc482dae8257c5f426aed030db8f58f51d074e9ddcdbe862de
4
+ data.tar.gz: a5811ee88da9fc7ef0e05c22978d4a47b85c25ec99c85bacb03f61deaa1363e6
5
5
  SHA512:
6
- metadata.gz: 907c66f3f805bca23f58fea3c35893b1dd7623e6003d293f04fc8afeb667268a28f0dae259bed2255b97acd8c970cacaebedfc6e8b8d49365a23def27f544aa4
7
- data.tar.gz: 5f242c38777b4b9747fdca04e4dc335a9ffb740cc82b2af16dd21558a603786bc7cb5f80ad355423522ca2300a0bfc7664b41af20e0630bdff298d3d730ae821
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 .circleci/config.yml.
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
- unless %i[fetch raise].include?(@on_idempotency_conflict)
39
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
40
- end
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.to_s,
208
+ 'User-Agent' => "#{user_agent}",
199
209
  'Content-Type' => 'application/json',
200
210
  'GoCardless-Client-Library' => 'gocardless-pro-ruby',
201
- 'GoCardless-Client-Version' => '2.40.0',
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.to_s,
232
+ "#{RUBY_PLATFORM}",
223
233
  ]
224
234
  comment << "faraday/#{Faraday::VERSION}"
225
235
  "#{gem_info} #{comment.join(' ')}"
@@ -10,6 +10,7 @@ module GoCardlessPro
10
10
 
11
11
  def conflicting_resource_id
12
12
  return unless idempotent_creation_conflict?
13
+
13
14
  idempotent_creation_conflict_error['links'][CONFLICTING_RESOURCE_ID]
14
15
  end
15
16
 
@@ -7,6 +7,7 @@ module GoCardlessPro
7
7
  #  @param error the error from the API
8
8
  def initialize(error)
9
9
  raise ArgumentError, 'GoCardless errors expect a hash' unless error.is_a?(Hash)
10
+
10
11
  @error = error
11
12
  end
12
13
 
@@ -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
- if CLIENT_ERROR_STATUSES.include?(env.status)
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
- error_class = error_class_for_status(env.status) || error_class_for_type(error_type)
12
+ json_body ||= JSON.parse(env.body) unless env.body.empty?
13
+ error_type = json_body['error']['type']
17
14
 
18
- raise(error_class, json_body['error'])
19
- end
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 => exception
55
+ rescue StandardError => e
56
56
  requests_attempted += 1
57
57
 
58
- if requests_attempted < total_requests_allowed && should_retry?(exception)
59
- sleep(RETRY_DELAY)
60
- retry
61
- else
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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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
 
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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
@@ -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.
@@ -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.
@@ -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
@@ -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.
@@ -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', 'identity' => 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', 'identity' => identity)
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', 'identity' => 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', 'identity' => 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] = {}