gocardless_pro 2.27.0 → 2.28.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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +20 -1
  3. data/lib/gocardless_pro.rb +6 -0
  4. data/lib/gocardless_pro/api_service.rb +4 -0
  5. data/lib/gocardless_pro/client.rb +6 -1
  6. data/lib/gocardless_pro/error/authentication_error.rb +4 -0
  7. data/lib/gocardless_pro/error/permission_error.rb +4 -0
  8. data/lib/gocardless_pro/error/rate_limit_error.rb +4 -0
  9. data/lib/gocardless_pro/middlewares/raise_gocardless_errors.rb +12 -1
  10. data/lib/gocardless_pro/resources/bank_authorisation.rb +3 -5
  11. data/lib/gocardless_pro/resources/billing_request.rb +29 -7
  12. data/lib/gocardless_pro/resources/billing_request_flow.rb +10 -0
  13. data/lib/gocardless_pro/resources/billing_request_template.rb +68 -0
  14. data/lib/gocardless_pro/resources/payer_authorisation.rb +9 -0
  15. data/lib/gocardless_pro/services/bank_authorisations_service.rb +0 -2
  16. data/lib/gocardless_pro/services/billing_request_flows_service.rb +23 -0
  17. data/lib/gocardless_pro/services/billing_request_templates_service.rb +131 -0
  18. data/lib/gocardless_pro/services/billing_requests_service.rb +49 -22
  19. data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +0 -4
  20. data/lib/gocardless_pro/services/creditors_service.rb +0 -2
  21. data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +0 -4
  22. data/lib/gocardless_pro/services/customers_service.rb +0 -2
  23. data/lib/gocardless_pro/services/instalment_schedules_service.rb +0 -6
  24. data/lib/gocardless_pro/services/mandate_imports_service.rb +0 -6
  25. data/lib/gocardless_pro/services/mandates_service.rb +0 -6
  26. data/lib/gocardless_pro/services/payer_authorisations_service.rb +0 -6
  27. data/lib/gocardless_pro/services/payments_service.rb +0 -6
  28. data/lib/gocardless_pro/services/redirect_flows_service.rb +0 -4
  29. data/lib/gocardless_pro/services/refunds_service.rb +0 -2
  30. data/lib/gocardless_pro/services/scenario_simulators_service.rb +28 -6
  31. data/lib/gocardless_pro/services/subscriptions_service.rb +2 -10
  32. data/lib/gocardless_pro/services/webhooks_service.rb +0 -2
  33. data/lib/gocardless_pro/version.rb +1 -1
  34. data/spec/api_service_spec.rb +12 -1
  35. data/spec/middlewares/raise_gocardless_errors_spec.rb +30 -0
  36. data/spec/resources/bank_authorisation_spec.rb +7 -7
  37. data/spec/resources/billing_request_flow_spec.rb +90 -0
  38. data/spec/resources/billing_request_spec.rb +75 -29
  39. data/spec/resources/billing_request_template_spec.rb +502 -0
  40. data/spec/services/bank_authorisations_service_spec.rb +7 -20
  41. data/spec/services/billing_request_flows_service_spec.rb +101 -0
  42. data/spec/services/billing_request_templates_service_spec.rb +789 -0
  43. data/spec/services/billing_requests_service_spec.rb +87 -47
  44. data/spec/services/creditor_bank_accounts_service_spec.rb +0 -13
  45. data/spec/services/creditors_service_spec.rb +0 -13
  46. data/spec/services/customer_bank_accounts_service_spec.rb +0 -13
  47. data/spec/services/customers_service_spec.rb +0 -13
  48. data/spec/services/instalment_schedules_service_spec.rb +0 -26
  49. data/spec/services/mandate_imports_service_spec.rb +0 -13
  50. data/spec/services/mandates_service_spec.rb +0 -13
  51. data/spec/services/payer_authorisations_service_spec.rb +0 -13
  52. data/spec/services/payments_service_spec.rb +0 -13
  53. data/spec/services/redirect_flows_service_spec.rb +0 -13
  54. data/spec/services/refunds_service_spec.rb +0 -13
  55. data/spec/services/subscriptions_service_spec.rb +0 -13
  56. metadata +16 -7
@@ -177,19 +177,6 @@ describe GoCardlessPro::Services::MandateImportsService do
177
177
  to raise_error(GoCardlessPro::IdempotencyConflict)
178
178
  end
179
179
  end
180
-
181
- context 'with on_idempotency_conflict: :unknown' do
182
- let(:client) do
183
- GoCardlessPro::Client.new(
184
- access_token: 'SECRET_TOKEN',
185
- on_idempotency_conflict: :unknown
186
- )
187
- end
188
-
189
- it 'raises an ArgumentError' do
190
- expect { post_create_response }.to raise_error(ArgumentError)
191
- end
192
- end
193
180
  end
194
181
  end
195
182
 
@@ -202,19 +202,6 @@ describe GoCardlessPro::Services::MandatesService do
202
202
  to raise_error(GoCardlessPro::IdempotencyConflict)
203
203
  end
204
204
  end
205
-
206
- context 'with on_idempotency_conflict: :unknown' do
207
- let(:client) do
208
- GoCardlessPro::Client.new(
209
- access_token: 'SECRET_TOKEN',
210
- on_idempotency_conflict: :unknown
211
- )
212
- end
213
-
214
- it 'raises an ArgumentError' do
215
- expect { post_create_response }.to raise_error(ArgumentError)
216
- end
217
- end
218
205
  end
219
206
  end
220
207
 
@@ -341,19 +341,6 @@ describe GoCardlessPro::Services::PayerAuthorisationsService do
341
341
  to raise_error(GoCardlessPro::IdempotencyConflict)
342
342
  end
343
343
  end
344
-
345
- context 'with on_idempotency_conflict: :unknown' do
346
- let(:client) do
347
- GoCardlessPro::Client.new(
348
- access_token: 'SECRET_TOKEN',
349
- on_idempotency_conflict: :unknown
350
- )
351
- end
352
-
353
- it 'raises an ArgumentError' do
354
- expect { post_create_response }.to raise_error(ArgumentError)
355
- end
356
- end
357
344
  end
358
345
  end
359
346
 
@@ -222,19 +222,6 @@ describe GoCardlessPro::Services::PaymentsService do
222
222
  to raise_error(GoCardlessPro::IdempotencyConflict)
223
223
  end
224
224
  end
225
-
226
- context 'with on_idempotency_conflict: :unknown' do
227
- let(:client) do
228
- GoCardlessPro::Client.new(
229
- access_token: 'SECRET_TOKEN',
230
- on_idempotency_conflict: :unknown
231
- )
232
- end
233
-
234
- it 'raises an ArgumentError' do
235
- expect { post_create_response }.to raise_error(ArgumentError)
236
- end
237
- end
238
225
  end
239
226
  end
240
227
 
@@ -207,19 +207,6 @@ describe GoCardlessPro::Services::RedirectFlowsService do
207
207
  to raise_error(GoCardlessPro::IdempotencyConflict)
208
208
  end
209
209
  end
210
-
211
- context 'with on_idempotency_conflict: :unknown' do
212
- let(:client) do
213
- GoCardlessPro::Client.new(
214
- access_token: 'SECRET_TOKEN',
215
- on_idempotency_conflict: :unknown
216
- )
217
- end
218
-
219
- it 'raises an ArgumentError' do
220
- expect { post_create_response }.to raise_error(ArgumentError)
221
- end
222
- end
223
210
  end
224
211
  end
225
212
 
@@ -202,19 +202,6 @@ describe GoCardlessPro::Services::RefundsService do
202
202
  to raise_error(GoCardlessPro::IdempotencyConflict)
203
203
  end
204
204
  end
205
-
206
- context 'with on_idempotency_conflict: :unknown' do
207
- let(:client) do
208
- GoCardlessPro::Client.new(
209
- access_token: 'SECRET_TOKEN',
210
- on_idempotency_conflict: :unknown
211
- )
212
- end
213
-
214
- it 'raises an ArgumentError' do
215
- expect { post_create_response }.to raise_error(ArgumentError)
216
- end
217
- end
218
205
  end
219
206
  end
220
207
 
@@ -257,19 +257,6 @@ describe GoCardlessPro::Services::SubscriptionsService do
257
257
  to raise_error(GoCardlessPro::IdempotencyConflict)
258
258
  end
259
259
  end
260
-
261
- context 'with on_idempotency_conflict: :unknown' do
262
- let(:client) do
263
- GoCardlessPro::Client.new(
264
- access_token: 'SECRET_TOKEN',
265
- on_idempotency_conflict: :unknown
266
- )
267
- end
268
-
269
- it 'raises an ArgumentError' do
270
- expect { post_create_response }.to raise_error(ArgumentError)
271
- end
272
- end
273
260
  end
274
261
  end
275
262
 
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.27.0
4
+ version: 2.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-22 00:00:00.000000000 Z
11
+ date: 2021-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -128,7 +128,7 @@ dependencies:
128
128
  - - "<"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '13'
131
- description:
131
+ description:
132
132
  email:
133
133
  - engineering@gocardless.com
134
134
  executables: []
@@ -151,9 +151,12 @@ files:
151
151
  - lib/gocardless_pro/client.rb
152
152
  - lib/gocardless_pro/error.rb
153
153
  - lib/gocardless_pro/error/api_error.rb
154
+ - lib/gocardless_pro/error/authentication_error.rb
154
155
  - lib/gocardless_pro/error/gocardless_error.rb
155
156
  - lib/gocardless_pro/error/invalid_api_usage_error.rb
156
157
  - lib/gocardless_pro/error/invalid_state_error.rb
158
+ - lib/gocardless_pro/error/permission_error.rb
159
+ - lib/gocardless_pro/error/rate_limit_error.rb
157
160
  - lib/gocardless_pro/error/validation_error.rb
158
161
  - lib/gocardless_pro/list_response.rb
159
162
  - lib/gocardless_pro/middlewares/raise_gocardless_errors.rb
@@ -163,6 +166,7 @@ files:
163
166
  - lib/gocardless_pro/resources/bank_details_lookup.rb
164
167
  - lib/gocardless_pro/resources/billing_request.rb
165
168
  - lib/gocardless_pro/resources/billing_request_flow.rb
169
+ - lib/gocardless_pro/resources/billing_request_template.rb
166
170
  - lib/gocardless_pro/resources/creditor.rb
167
171
  - lib/gocardless_pro/resources/creditor_bank_account.rb
168
172
  - lib/gocardless_pro/resources/currency_exchange_rate.rb
@@ -191,6 +195,7 @@ files:
191
195
  - lib/gocardless_pro/services/bank_details_lookups_service.rb
192
196
  - lib/gocardless_pro/services/base_service.rb
193
197
  - lib/gocardless_pro/services/billing_request_flows_service.rb
198
+ - lib/gocardless_pro/services/billing_request_templates_service.rb
194
199
  - lib/gocardless_pro/services/billing_requests_service.rb
195
200
  - lib/gocardless_pro/services/creditor_bank_accounts_service.rb
196
201
  - lib/gocardless_pro/services/creditors_service.rb
@@ -226,6 +231,7 @@ files:
226
231
  - spec/resources/bank_details_lookup_spec.rb
227
232
  - spec/resources/billing_request_flow_spec.rb
228
233
  - spec/resources/billing_request_spec.rb
234
+ - spec/resources/billing_request_template_spec.rb
229
235
  - spec/resources/creditor_bank_account_spec.rb
230
236
  - spec/resources/creditor_spec.rb
231
237
  - spec/resources/currency_exchange_rate_spec.rb
@@ -253,6 +259,7 @@ files:
253
259
  - spec/services/bank_authorisations_service_spec.rb
254
260
  - spec/services/bank_details_lookups_service_spec.rb
255
261
  - spec/services/billing_request_flows_service_spec.rb
262
+ - spec/services/billing_request_templates_service_spec.rb
256
263
  - spec/services/billing_requests_service_spec.rb
257
264
  - spec/services/creditor_bank_accounts_service_spec.rb
258
265
  - spec/services/creditors_service_spec.rb
@@ -283,7 +290,7 @@ homepage: https://github.com/gocardless/gocardless-pro-ruby
283
290
  licenses:
284
291
  - MIT
285
292
  metadata: {}
286
- post_install_message:
293
+ post_install_message:
287
294
  rdoc_options: []
288
295
  require_paths:
289
296
  - lib
@@ -298,8 +305,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
305
  - !ruby/object:Gem::Version
299
306
  version: '0'
300
307
  requirements: []
301
- rubygems_version: 3.0.3
302
- signing_key:
308
+ rubygems_version: 3.2.3
309
+ signing_key:
303
310
  specification_version: 4
304
311
  summary: A gem for calling the GoCardless Pro API
305
312
  test_files:
@@ -312,6 +319,7 @@ test_files:
312
319
  - spec/resources/bank_details_lookup_spec.rb
313
320
  - spec/resources/billing_request_flow_spec.rb
314
321
  - spec/resources/billing_request_spec.rb
322
+ - spec/resources/billing_request_template_spec.rb
315
323
  - spec/resources/creditor_bank_account_spec.rb
316
324
  - spec/resources/creditor_spec.rb
317
325
  - spec/resources/currency_exchange_rate_spec.rb
@@ -339,6 +347,7 @@ test_files:
339
347
  - spec/services/bank_authorisations_service_spec.rb
340
348
  - spec/services/bank_details_lookups_service_spec.rb
341
349
  - spec/services/billing_request_flows_service_spec.rb
350
+ - spec/services/billing_request_templates_service_spec.rb
342
351
  - spec/services/billing_requests_service_spec.rb
343
352
  - spec/services/creditor_bank_accounts_service_spec.rb
344
353
  - spec/services/creditors_service_spec.rb