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
@@ -63,8 +63,6 @@ module GoCardlessPro
63
63
  raise IdempotencyConflict, e.error
64
64
  when :fetch
65
65
  return get(e.conflicting_resource_id)
66
- else
67
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
68
66
  end
69
67
  end
70
68
 
@@ -79,7 +77,7 @@ module GoCardlessPro
79
77
  # Fetches a billing request
80
78
  # Example URL: /billing_requests/:identity
81
79
  #
82
- # @param identity # Unique identifier, beginning with "PY".
80
+ # @param identity # Unique identifier, beginning with "BRQ".
83
81
  # @param options [Hash] parameters as a hash, under a params key.
84
82
  def get(identity, options = {})
85
83
  path = sub_url('/billing_requests/:identity', 'identity' => identity)
@@ -105,7 +103,7 @@ module GoCardlessPro
105
103
  # successful.
106
104
  # Example URL: /billing_requests/:identity/actions/collect_customer_details
107
105
  #
108
- # @param identity # Unique identifier, beginning with "PY".
106
+ # @param identity # Unique identifier, beginning with "BRQ".
109
107
  # @param options [Hash] parameters as a hash, under a params key.
110
108
  def collect_customer_details(identity, options = {})
111
109
  path = sub_url('/billing_requests/:identity/actions/collect_customer_details', 'identity' => identity)
@@ -128,8 +126,6 @@ module GoCardlessPro
128
126
  raise IdempotencyConflict, e.error
129
127
  when :fetch
130
128
  return get(e.conflicting_resource_id)
131
- else
132
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
133
129
  end
134
130
  end
135
131
 
@@ -142,18 +138,18 @@ module GoCardlessPro
142
138
  end
143
139
 
144
140
  # If the billing request has a pending
145
- # <code>collect_bank_account_details</code> action, this endpoint can be
141
+ # <code>collect_bank_account</code> action, this endpoint can be
146
142
  # used to collect the details in order to complete it.
147
143
  #
148
144
  # The endpoint takes the same payload as Customer Bank Accounts, but check
149
145
  # the bank account is valid for the billing request scheme before creating
150
146
  # and attaching it.
151
- # Example URL: /billing_requests/:identity/actions/collect_bank_account_details
147
+ # Example URL: /billing_requests/:identity/actions/collect_bank_account
152
148
  #
153
- # @param identity # Unique identifier, beginning with "PY".
149
+ # @param identity # Unique identifier, beginning with "BRQ".
154
150
  # @param options [Hash] parameters as a hash, under a params key.
155
- def collect_bank_account_details(identity, options = {})
156
- path = sub_url('/billing_requests/:identity/actions/collect_bank_account_details', 'identity' => identity)
151
+ def collect_bank_account(identity, options = {})
152
+ path = sub_url('/billing_requests/:identity/actions/collect_bank_account', 'identity' => identity)
157
153
 
158
154
  params = options.delete(:params) || {}
159
155
  options[:params] = {}
@@ -173,8 +169,6 @@ module GoCardlessPro
173
169
  raise IdempotencyConflict, e.error
174
170
  when :fetch
175
171
  return get(e.conflicting_resource_id)
176
- else
177
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
178
172
  end
179
173
  end
180
174
 
@@ -190,7 +184,7 @@ module GoCardlessPro
190
184
  # it to fulfil, executing the payment.
191
185
  # Example URL: /billing_requests/:identity/actions/fulfil
192
186
  #
193
- # @param identity # Unique identifier, beginning with "PY".
187
+ # @param identity # Unique identifier, beginning with "BRQ".
194
188
  # @param options [Hash] parameters as a hash, under a params key.
195
189
  def fulfil(identity, options = {})
196
190
  path = sub_url('/billing_requests/:identity/actions/fulfil', 'identity' => identity)
@@ -213,8 +207,45 @@ module GoCardlessPro
213
207
  raise IdempotencyConflict, e.error
214
208
  when :fetch
215
209
  return get(e.conflicting_resource_id)
216
- else
217
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
210
+ end
211
+ end
212
+
213
+ raise e
214
+ end
215
+
216
+ return if response.body.nil?
217
+
218
+ Resources::BillingRequest.new(unenvelope_body(response.body), response)
219
+ end
220
+
221
+ # This is needed when you have mandate_request. As a scheme compliance rule we
222
+ # are required to
223
+ # allow the payer to crosscheck the details entered by them and confirm it.
224
+ # Example URL: /billing_requests/:identity/actions/confirm_payer_details
225
+ #
226
+ # @param identity # Unique identifier, beginning with "BRQ".
227
+ # @param options [Hash] parameters as a hash, under a params key.
228
+ def confirm_payer_details(identity, options = {})
229
+ path = sub_url('/billing_requests/:identity/actions/confirm_payer_details', 'identity' => identity)
230
+
231
+ params = options.delete(:params) || {}
232
+ options[:params] = {}
233
+ options[:params]['data'] = params
234
+
235
+ options[:retry_failures] = false
236
+
237
+ begin
238
+ response = make_request(:post, path, options)
239
+
240
+ # Response doesn't raise any errors until #body is called
241
+ response.tap(&:body)
242
+ rescue InvalidStateError => e
243
+ if e.idempotent_creation_conflict?
244
+ case @api_service.on_idempotency_conflict
245
+ when :raise
246
+ raise IdempotencyConflict, e.error
247
+ when :fetch
248
+ return get(e.conflicting_resource_id)
218
249
  end
219
250
  end
220
251
 
@@ -230,7 +261,7 @@ module GoCardlessPro
230
261
  # to expire.
231
262
  # Example URL: /billing_requests/:identity/actions/cancel
232
263
  #
233
- # @param identity # Unique identifier, beginning with "PY".
264
+ # @param identity # Unique identifier, beginning with "BRQ".
234
265
  # @param options [Hash] parameters as a hash, under a params key.
235
266
  def cancel(identity, options = {})
236
267
  path = sub_url('/billing_requests/:identity/actions/cancel', 'identity' => identity)
@@ -253,8 +284,6 @@ module GoCardlessPro
253
284
  raise IdempotencyConflict, e.error
254
285
  when :fetch
255
286
  return get(e.conflicting_resource_id)
256
- else
257
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
258
287
  end
259
288
  end
260
289
 
@@ -271,7 +300,7 @@ module GoCardlessPro
271
300
  # Currently, the customer can only be notified by email.
272
301
  # Example URL: /billing_requests/:identity/actions/notify
273
302
  #
274
- # @param identity # Unique identifier, beginning with "PY".
303
+ # @param identity # Unique identifier, beginning with "BRQ".
275
304
  # @param options [Hash] parameters as a hash, under a params key.
276
305
  def notify(identity, options = {})
277
306
  path = sub_url('/billing_requests/:identity/actions/notify', 'identity' => identity)
@@ -294,8 +323,6 @@ module GoCardlessPro
294
323
  raise IdempotencyConflict, e.error
295
324
  when :fetch
296
325
  return get(e.conflicting_resource_id)
297
- else
298
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
299
326
  end
300
327
  end
301
328
 
@@ -34,8 +34,6 @@ module GoCardlessPro
34
34
  raise IdempotencyConflict, e.error
35
35
  when :fetch
36
36
  return get(e.conflicting_resource_id)
37
- else
38
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
39
37
  end
40
38
  end
41
39
 
@@ -126,8 +124,6 @@ module GoCardlessPro
126
124
  raise IdempotencyConflict, e.error
127
125
  when :fetch
128
126
  return get(e.conflicting_resource_id)
129
- else
130
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
131
127
  end
132
128
  end
133
129
 
@@ -34,8 +34,6 @@ module GoCardlessPro
34
34
  raise IdempotencyConflict, e.error
35
35
  when :fetch
36
36
  return get(e.conflicting_resource_id)
37
- else
38
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
39
37
  end
40
38
  end
41
39
 
@@ -46,8 +46,6 @@ module GoCardlessPro
46
46
  raise IdempotencyConflict, e.error
47
47
  when :fetch
48
48
  return get(e.conflicting_resource_id)
49
- else
50
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
51
49
  end
52
50
  end
53
51
 
@@ -159,8 +157,6 @@ module GoCardlessPro
159
157
  raise IdempotencyConflict, e.error
160
158
  when :fetch
161
159
  return get(e.conflicting_resource_id)
162
- else
163
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
164
160
  end
165
161
  end
166
162
 
@@ -34,8 +34,6 @@ module GoCardlessPro
34
34
  raise IdempotencyConflict, e.error
35
35
  when :fetch
36
36
  return get(e.conflicting_resource_id)
37
- else
38
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
39
37
  end
40
38
  end
41
39
 
@@ -52,8 +52,6 @@ module GoCardlessPro
52
52
  raise IdempotencyConflict, e.error
53
53
  when :fetch
54
54
  return get(e.conflicting_resource_id)
55
- else
56
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
57
55
  end
58
56
  end
59
57
 
@@ -102,8 +100,6 @@ module GoCardlessPro
102
100
  raise IdempotencyConflict, e.error
103
101
  when :fetch
104
102
  return get(e.conflicting_resource_id)
105
- else
106
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
107
103
  end
108
104
  end
109
105
 
@@ -212,8 +208,6 @@ module GoCardlessPro
212
208
  raise IdempotencyConflict, e.error
213
209
  when :fetch
214
210
  return get(e.conflicting_resource_id)
215
- else
216
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
217
211
  end
218
212
  end
219
213
 
@@ -38,8 +38,6 @@ module GoCardlessPro
38
38
  raise IdempotencyConflict, e.error
39
39
  when :fetch
40
40
  return get(e.conflicting_resource_id)
41
- else
42
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
43
41
  end
44
42
  end
45
43
 
@@ -104,8 +102,6 @@ module GoCardlessPro
104
102
  raise IdempotencyConflict, e.error
105
103
  when :fetch
106
104
  return get(e.conflicting_resource_id)
107
- else
108
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
109
105
  end
110
106
  end
111
107
 
@@ -149,8 +145,6 @@ module GoCardlessPro
149
145
  raise IdempotencyConflict, e.error
150
146
  when :fetch
151
147
  return get(e.conflicting_resource_id)
152
- else
153
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
154
148
  end
155
149
  end
156
150
 
@@ -34,8 +34,6 @@ module GoCardlessPro
34
34
  raise IdempotencyConflict, e.error
35
35
  when :fetch
36
36
  return get(e.conflicting_resource_id)
37
- else
38
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
39
37
  end
40
38
  end
41
39
 
@@ -148,8 +146,6 @@ module GoCardlessPro
148
146
  raise IdempotencyConflict, e.error
149
147
  when :fetch
150
148
  return get(e.conflicting_resource_id)
151
- else
152
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
153
149
  end
154
150
  end
155
151
 
@@ -198,8 +194,6 @@ module GoCardlessPro
198
194
  raise IdempotencyConflict, e.error
199
195
  when :fetch
200
196
  return get(e.conflicting_resource_id)
201
- else
202
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
203
197
  end
204
198
  end
205
199
 
@@ -57,8 +57,6 @@ module GoCardlessPro
57
57
  raise IdempotencyConflict, e.error
58
58
  when :fetch
59
59
  return get(e.conflicting_resource_id)
60
- else
61
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
62
60
  end
63
61
  end
64
62
 
@@ -128,8 +126,6 @@ module GoCardlessPro
128
126
  raise IdempotencyConflict, e.error
129
127
  when :fetch
130
128
  return get(e.conflicting_resource_id)
131
- else
132
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
133
129
  end
134
130
  end
135
131
 
@@ -177,8 +173,6 @@ module GoCardlessPro
177
173
  raise IdempotencyConflict, e.error
178
174
  when :fetch
179
175
  return get(e.conflicting_resource_id)
180
- else
181
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
182
176
  end
183
177
  end
184
178
 
@@ -39,8 +39,6 @@ module GoCardlessPro
39
39
  raise IdempotencyConflict, e.error
40
40
  when :fetch
41
41
  return get(e.conflicting_resource_id)
42
- else
43
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
44
42
  end
45
43
  end
46
44
 
@@ -150,8 +148,6 @@ module GoCardlessPro
150
148
  raise IdempotencyConflict, e.error
151
149
  when :fetch
152
150
  return get(e.conflicting_resource_id)
153
- else
154
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
155
151
  end
156
152
  end
157
153
 
@@ -198,8 +194,6 @@ module GoCardlessPro
198
194
  raise IdempotencyConflict, e.error
199
195
  when :fetch
200
196
  return get(e.conflicting_resource_id)
201
- else
202
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
203
197
  end
204
198
  end
205
199
 
@@ -35,8 +35,6 @@ module GoCardlessPro
35
35
  raise IdempotencyConflict, e.error
36
36
  when :fetch
37
37
  return get(e.conflicting_resource_id)
38
- else
39
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
40
38
  end
41
39
  end
42
40
 
@@ -100,8 +98,6 @@ module GoCardlessPro
100
98
  raise IdempotencyConflict, e.error
101
99
  when :fetch
102
100
  return get(e.conflicting_resource_id)
103
- else
104
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
105
101
  end
106
102
  end
107
103
 
@@ -50,8 +50,6 @@ module GoCardlessPro
50
50
  raise IdempotencyConflict, e.error
51
51
  when :fetch
52
52
  return get(e.conflicting_resource_id)
53
- else
54
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
55
53
  end
56
54
  end
57
55
 
@@ -27,6 +27,11 @@ module GoCardlessPro
27
27
  # <li>`creditor_verification_status_successful`: Sets a creditor's
28
28
  # `verification status` to `successful`, meaning that the creditor is
29
29
  # fully verified and can receive payouts.</li>
30
+ # <li>`payment_confirmed`: Transitions a payment through to `confirmed`.
31
+ # It must start in the `pending_submission` state, and its mandate must be
32
+ # in the `activated` state (unless it is a payment for ACH, BECS, BECS_NZ
33
+ # or SEPA, in which cases the mandate may be `pending_submission`, since
34
+ # their mandates are submitted with their first payment).</li>
30
35
  # <li>`payment_paid_out`: Transitions a payment through to `paid_out`,
31
36
  # having been collected successfully and paid out to you. It must start in
32
37
  # the `pending_submission` state, and its mandate must be in the
@@ -82,8 +87,8 @@ module GoCardlessPro
82
87
  # <li>`mandate_failed`: Transitions a mandate through to `failed`, having
83
88
  # been submitted to the banks but found to be invalid (for example due to
84
89
  # invalid bank details). It must start in the `pending_submission` or
85
- # `submitted` states. Not compatible with ACH, BECS, BECS_NZ and SEPA
86
- # mandates, which are submitted with their first payment.</li>
90
+ # `submitted` states. Not compatible with SEPA mandates, which are
91
+ # submitted with their first payment.</li>
87
92
  # <li>`mandate_expired`: Transitions a mandate through to `expired`,
88
93
  # having been submitted to the banks, set up successfully and then expired
89
94
  # because no collection attempts were made against it for longer than the
@@ -104,14 +109,31 @@ module GoCardlessPro
104
109
  # mandates.</li>
105
110
  # <li>`refund_paid`: Transitions a refund to `paid`. It must start in
106
111
  # either the `pending_submission` or `submitted` state.</li>
112
+ # <li>`refund_settled`: Transitions a refund to `paid`, if it's not
113
+ # already, then generates a payout that includes the refund, thereby
114
+ # settling the funds. It must start in one of `pending_submission`,
115
+ # `submitted` or `paid` states.</li>
107
116
  # <li>`refund_bounced`: Transitions a refund to `bounced`. It must start
108
117
  # in either the `pending_submission`, `submitted`, or `paid` state.</li>
118
+ # <li>`refund_returned`: Transitions a refund to `refund_returned`. The
119
+ # refund must start in `pending_submission`.</li>
109
120
  # <li>`payout_bounced`: Transitions a payout to `bounced`. It must start
110
121
  # in the `paid` state.</li>
111
- # <li>`payout_create`: Creates a payout containing payments in
112
- # `confirmed`, `failed` & `charged_back` states; refunds in `submitted` &
113
- # `bounced`; and all related fees. Can only be used with a positive total
114
- # payout balance and when some eligible items exist.</li>
122
+ # <li>`billing_request_fulfilled`: Authorises the billing request, fulfils
123
+ # it, and moves the associated payment to `failed`. The billing request
124
+ # must be in the `pending` state, with all actions completed except for
125
+ # `bank_authorisation`. Only billing requests with a `payment_request` are
126
+ # supported.</li>
127
+ # <li>`billing_request_fulfilled_and_payment_failed`: Authorises the
128
+ # billing request, fulfils it, and moves the associated payment to
129
+ # `failed`. The billing request must be in the `pending` state, with all
130
+ # actions completed except for `bank_authorisation`. Only billing requests
131
+ # with a `payment_request` are supported.</li>
132
+ # <li>`billing_request_fulfilled_and_payment_paid_out`: Authorises the
133
+ # billing request, fulfils it, and moves the associated payment to
134
+ # `paid_out`. The billing request must be in the `pending` state, with all
135
+ # actions completed except for `bank_authorisation`. Only billing requests
136
+ # with a `payment_request` are supported.</li>
115
137
  # </ul>
116
138
  # @param options [Hash] parameters as a hash, under a params key.
117
139
  def run(identity, options = {})
@@ -34,8 +34,6 @@ module GoCardlessPro
34
34
  raise IdempotencyConflict, e.error
35
35
  when :fetch
36
36
  return get(e.conflicting_resource_id)
37
- else
38
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
39
37
  end
40
38
  end
41
39
 
@@ -140,10 +138,10 @@ module GoCardlessPro
140
138
  # Pause a subscription object.
141
139
  # No payments will be created until it is resumed.
142
140
  #
143
- # This can only be used when a subscription collecting a fixed number of
141
+ # This can only be used when a subscription is collecting a fixed number of
144
142
  # payments (created using `count`),
145
143
  # when they continue forever (created without `count` or `end_date`) or
146
- # the subscription is paused for a number of cycles.
144
+ # the subscription is already paused for a number of cycles.
147
145
  #
148
146
  # When `pause_cycles` is omitted the subscription is paused until the [resume
149
147
  # endpoint](#subscriptions-resume-a-subscription) is called.
@@ -203,8 +201,6 @@ module GoCardlessPro
203
201
  raise IdempotencyConflict, e.error
204
202
  when :fetch
205
203
  return get(e.conflicting_resource_id)
206
- else
207
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
208
204
  end
209
205
  end
210
206
 
@@ -258,8 +254,6 @@ module GoCardlessPro
258
254
  raise IdempotencyConflict, e.error
259
255
  when :fetch
260
256
  return get(e.conflicting_resource_id)
261
- else
262
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
263
257
  end
264
258
  end
265
259
 
@@ -302,8 +296,6 @@ module GoCardlessPro
302
296
  raise IdempotencyConflict, e.error
303
297
  when :fetch
304
298
  return get(e.conflicting_resource_id)
305
- else
306
- raise ArgumentError, 'Unknown mode for :on_idempotency_conflict'
307
299
  end
308
300
  end
309
301