gocardless_pro 2.1.0 → 2.2.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/circle.yml +11 -3
- data/demo.rb +3 -3
- data/gocardless_pro.gemspec +6 -6
- data/lib/gocardless_pro.rb +2 -1
- data/lib/gocardless_pro/api_service.rb +3 -2
- data/lib/gocardless_pro/client.rb +6 -6
- data/lib/gocardless_pro/error.rb +4 -4
- data/lib/gocardless_pro/middlewares/raise_gocardless_errors.rb +4 -4
- data/lib/gocardless_pro/request.rb +2 -2
- data/lib/gocardless_pro/resources/bank_details_lookup.rb +1 -0
- data/lib/gocardless_pro/resources/creditor.rb +1 -0
- data/lib/gocardless_pro/resources/creditor_bank_account.rb +1 -0
- data/lib/gocardless_pro/resources/customer.rb +1 -0
- data/lib/gocardless_pro/resources/customer_bank_account.rb +1 -0
- data/lib/gocardless_pro/resources/event.rb +1 -0
- data/lib/gocardless_pro/resources/mandate.rb +1 -0
- data/lib/gocardless_pro/resources/mandate_pdf.rb +1 -0
- data/lib/gocardless_pro/resources/payment.rb +1 -0
- data/lib/gocardless_pro/resources/payout.rb +1 -0
- data/lib/gocardless_pro/resources/redirect_flow.rb +1 -0
- data/lib/gocardless_pro/resources/refund.rb +1 -0
- data/lib/gocardless_pro/resources/subscription.rb +1 -0
- data/lib/gocardless_pro/services/base_service.rb +1 -1
- data/lib/gocardless_pro/version.rb +1 -1
- data/spec/api_service_spec.rb +49 -49
- data/spec/client_spec.rb +1 -1
- data/spec/error_spec.rb +13 -13
- data/spec/middlewares/raise_gocardless_errors_spec.rb +15 -16
- data/spec/resources/bank_details_lookup_spec.rb +18 -18
- data/spec/resources/creditor_bank_account_spec.rb +46 -46
- data/spec/resources/creditor_spec.rb +42 -42
- data/spec/resources/customer_bank_account_spec.rb +48 -48
- data/spec/resources/customer_spec.rb +42 -42
- data/spec/resources/event_spec.rb +18 -18
- data/spec/resources/mandate_pdf_spec.rb +18 -18
- data/spec/resources/mandate_spec.rb +54 -54
- data/spec/resources/payment_spec.rb +54 -54
- data/spec/resources/payout_spec.rb +18 -18
- data/spec/resources/redirect_flow_spec.rb +36 -36
- data/spec/resources/refund_spec.rb +42 -42
- data/spec/resources/subscription_spec.rb +48 -48
- data/spec/response_spec.rb +1 -2
- data/spec/services/bank_details_lookups_service_spec.rb +25 -25
- data/spec/services/creditor_bank_accounts_service_spec.rb +86 -86
- data/spec/services/creditors_service_spec.rb +87 -87
- data/spec/services/customer_bank_accounts_service_spec.rb +95 -95
- data/spec/services/customers_service_spec.rb +87 -87
- data/spec/services/events_service_spec.rb +49 -49
- data/spec/services/mandate_pdfs_service_spec.rb +25 -25
- data/spec/services/mandates_service_spec.rb +103 -103
- data/spec/services/payments_service_spec.rb +103 -103
- data/spec/services/payouts_service_spec.rb +49 -49
- data/spec/services/redirect_flows_service_spec.rb +52 -52
- data/spec/services/refunds_service_spec.rb +87 -87
- data/spec/services/subscriptions_service_spec.rb +95 -95
- metadata +10 -10
@@ -24,13 +24,13 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
24
24
|
'enabled' => 'enabled-input',
|
25
25
|
'id' => 'id-input',
|
26
26
|
'links' => 'links-input',
|
27
|
-
'metadata' => 'metadata-input'
|
27
|
+
'metadata' => 'metadata-input',
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
31
31
|
before do
|
32
|
-
stub_request(:post, %r{.*api.gocardless.com/customer_bank_accounts})
|
33
|
-
|
32
|
+
stub_request(:post, %r{.*api.gocardless.com/customer_bank_accounts}).
|
33
|
+
with(
|
34
34
|
body: {
|
35
35
|
'customer_bank_accounts' => {
|
36
36
|
|
@@ -43,11 +43,11 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
43
43
|
'enabled' => 'enabled-input',
|
44
44
|
'id' => 'id-input',
|
45
45
|
'links' => 'links-input',
|
46
|
-
'metadata' => 'metadata-input'
|
47
|
-
}
|
46
|
+
'metadata' => 'metadata-input',
|
47
|
+
},
|
48
48
|
}
|
49
|
-
)
|
50
|
-
|
49
|
+
).
|
50
|
+
to_return(
|
51
51
|
body: {
|
52
52
|
'customer_bank_accounts' =>
|
53
53
|
|
@@ -62,8 +62,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
62
62
|
'enabled' => 'enabled-input',
|
63
63
|
'id' => 'id-input',
|
64
64
|
'links' => 'links-input',
|
65
|
-
'metadata' => 'metadata-input'
|
66
|
-
}
|
65
|
+
'metadata' => 'metadata-input',
|
66
|
+
},
|
67
67
|
|
68
68
|
}.to_json,
|
69
69
|
headers: response_headers
|
@@ -85,9 +85,9 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
85
85
|
type: 'validation_failed',
|
86
86
|
code: 422,
|
87
87
|
errors: [
|
88
|
-
{ message: 'test error message', field: 'test_field' }
|
89
|
-
]
|
90
|
-
}
|
88
|
+
{ message: 'test error message', field: 'test_field' },
|
89
|
+
],
|
90
|
+
},
|
91
91
|
}.to_json,
|
92
92
|
headers: response_headers,
|
93
93
|
status: 422
|
@@ -114,7 +114,7 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
114
114
|
'enabled' => 'enabled-input',
|
115
115
|
'id' => 'id-input',
|
116
116
|
'links' => 'links-input',
|
117
|
-
'metadata' => 'metadata-input'
|
117
|
+
'metadata' => 'metadata-input',
|
118
118
|
}
|
119
119
|
end
|
120
120
|
|
@@ -129,11 +129,11 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
129
129
|
message: 'A resource has already been created with this idempotency key',
|
130
130
|
reason: 'idempotent_creation_conflict',
|
131
131
|
links: {
|
132
|
-
conflicting_resource_id: id
|
133
|
-
}
|
134
|
-
}
|
135
|
-
]
|
136
|
-
}
|
132
|
+
conflicting_resource_id: id,
|
133
|
+
},
|
134
|
+
},
|
135
|
+
],
|
136
|
+
},
|
137
137
|
}.to_json,
|
138
138
|
headers: response_headers,
|
139
139
|
status: 409
|
@@ -142,8 +142,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
142
142
|
|
143
143
|
let!(:get_stub) do
|
144
144
|
stub_url = "/customer_bank_accounts/#{id}"
|
145
|
-
stub_request(:get, /.*api.gocardless.com#{stub_url}/)
|
146
|
-
|
145
|
+
stub_request(:get, /.*api.gocardless.com#{stub_url}/).
|
146
|
+
to_return(
|
147
147
|
body: {
|
148
148
|
'customer_bank_accounts' => {
|
149
149
|
|
@@ -156,8 +156,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
156
156
|
'enabled' => 'enabled-input',
|
157
157
|
'id' => 'id-input',
|
158
158
|
'links' => 'links-input',
|
159
|
-
'metadata' => 'metadata-input'
|
160
|
-
}
|
159
|
+
'metadata' => 'metadata-input',
|
160
|
+
},
|
161
161
|
}.to_json,
|
162
162
|
headers: response_headers
|
163
163
|
)
|
@@ -189,14 +189,14 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
189
189
|
'enabled' => 'enabled-input',
|
190
190
|
'id' => 'id-input',
|
191
191
|
'links' => 'links-input',
|
192
|
-
'metadata' => 'metadata-input'
|
192
|
+
'metadata' => 'metadata-input',
|
193
193
|
}],
|
194
194
|
meta: {
|
195
195
|
cursors: {
|
196
196
|
before: nil,
|
197
|
-
after: 'ABC123'
|
198
|
-
}
|
199
|
-
}
|
197
|
+
after: 'ABC123',
|
198
|
+
},
|
199
|
+
},
|
200
200
|
}.to_json,
|
201
201
|
headers: response_headers
|
202
202
|
)
|
@@ -248,12 +248,12 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
248
248
|
'enabled' => 'enabled-input',
|
249
249
|
'id' => 'id-input',
|
250
250
|
'links' => 'links-input',
|
251
|
-
'metadata' => 'metadata-input'
|
251
|
+
'metadata' => 'metadata-input',
|
252
252
|
}],
|
253
253
|
meta: {
|
254
254
|
cursors: { after: 'AB345' },
|
255
|
-
limit: 1
|
256
|
-
}
|
255
|
+
limit: 1,
|
256
|
+
},
|
257
257
|
}.to_json,
|
258
258
|
headers: response_headers
|
259
259
|
)
|
@@ -273,12 +273,12 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
273
273
|
'enabled' => 'enabled-input',
|
274
274
|
'id' => 'id-input',
|
275
275
|
'links' => 'links-input',
|
276
|
-
'metadata' => 'metadata-input'
|
276
|
+
'metadata' => 'metadata-input',
|
277
277
|
}],
|
278
278
|
meta: {
|
279
279
|
limit: 2,
|
280
|
-
cursors: {}
|
281
|
-
}
|
280
|
+
cursors: {},
|
281
|
+
},
|
282
282
|
}.to_json,
|
283
283
|
headers: response_headers
|
284
284
|
)
|
@@ -299,9 +299,9 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
299
299
|
context 'passing in a custom header' do
|
300
300
|
let!(:stub) do
|
301
301
|
stub_url = '/customer_bank_accounts/:identity'.gsub(':identity', id)
|
302
|
-
stub_request(:get, /.*api.gocardless.com#{stub_url}/)
|
303
|
-
|
304
|
-
|
302
|
+
stub_request(:get, /.*api.gocardless.com#{stub_url}/).
|
303
|
+
with(headers: { 'Foo' => 'Bar' }).
|
304
|
+
to_return(
|
305
305
|
body: {
|
306
306
|
'customer_bank_accounts' => {
|
307
307
|
|
@@ -314,8 +314,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
314
314
|
'enabled' => 'enabled-input',
|
315
315
|
'id' => 'id-input',
|
316
316
|
'links' => 'links-input',
|
317
|
-
'metadata' => 'metadata-input'
|
318
|
-
}
|
317
|
+
'metadata' => 'metadata-input',
|
318
|
+
},
|
319
319
|
}.to_json,
|
320
320
|
headers: response_headers
|
321
321
|
)
|
@@ -323,7 +323,7 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
323
323
|
|
324
324
|
subject(:get_response) do
|
325
325
|
client.customer_bank_accounts.get(id, headers: {
|
326
|
-
'Foo' => 'Bar'
|
326
|
+
'Foo' => 'Bar',
|
327
327
|
})
|
328
328
|
end
|
329
329
|
|
@@ -349,8 +349,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
349
349
|
'enabled' => 'enabled-input',
|
350
350
|
'id' => 'id-input',
|
351
351
|
'links' => 'links-input',
|
352
|
-
'metadata' => 'metadata-input'
|
353
|
-
}
|
352
|
+
'metadata' => 'metadata-input',
|
353
|
+
},
|
354
354
|
}.to_json,
|
355
355
|
headers: response_headers
|
356
356
|
)
|
@@ -406,8 +406,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
406
406
|
'enabled' => 'enabled-input',
|
407
407
|
'id' => 'id-input',
|
408
408
|
'links' => 'links-input',
|
409
|
-
'metadata' => 'metadata-input'
|
410
|
-
}
|
409
|
+
'metadata' => 'metadata-input',
|
410
|
+
},
|
411
411
|
}.to_json,
|
412
412
|
headers: response_headers
|
413
413
|
)
|
@@ -441,8 +441,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
441
441
|
'enabled' => 'enabled-input',
|
442
442
|
'id' => 'id-input',
|
443
443
|
'links' => 'links-input',
|
444
|
-
'metadata' => 'metadata-input'
|
445
|
-
}
|
444
|
+
'metadata' => 'metadata-input',
|
445
|
+
},
|
446
446
|
}.to_json,
|
447
447
|
headers: response_headers
|
448
448
|
)
|
@@ -464,8 +464,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
464
464
|
let!(:stub) do
|
465
465
|
# /customer_bank_accounts/%v/actions/disable
|
466
466
|
stub_url = '/customer_bank_accounts/:identity/actions/disable'.gsub(':identity', resource_id)
|
467
|
-
stub_request(:post, /.*api.gocardless.com#{stub_url}/)
|
468
|
-
|
467
|
+
stub_request(:post, /.*api.gocardless.com#{stub_url}/).
|
468
|
+
with(
|
469
469
|
body: { foo: 'bar' },
|
470
470
|
headers: { 'Foo' => 'Bar' }
|
471
471
|
).to_return(
|
@@ -481,8 +481,8 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
481
481
|
'enabled' => 'enabled-input',
|
482
482
|
'id' => 'id-input',
|
483
483
|
'links' => 'links-input',
|
484
|
-
'metadata' => 'metadata-input'
|
485
|
-
}
|
484
|
+
'metadata' => 'metadata-input',
|
485
|
+
},
|
486
486
|
}.to_json,
|
487
487
|
headers: response_headers
|
488
488
|
)
|
@@ -30,13 +30,13 @@ describe GoCardlessPro::Resources::Customer do
|
|
30
30
|
'metadata' => 'metadata-input',
|
31
31
|
'postal_code' => 'postal_code-input',
|
32
32
|
'region' => 'region-input',
|
33
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
33
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
37
37
|
before do
|
38
|
-
stub_request(:post, %r{.*api.gocardless.com/customers})
|
39
|
-
|
38
|
+
stub_request(:post, %r{.*api.gocardless.com/customers}).
|
39
|
+
with(
|
40
40
|
body: {
|
41
41
|
'customers' => {
|
42
42
|
|
@@ -55,11 +55,11 @@ describe GoCardlessPro::Resources::Customer do
|
|
55
55
|
'metadata' => 'metadata-input',
|
56
56
|
'postal_code' => 'postal_code-input',
|
57
57
|
'region' => 'region-input',
|
58
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
59
|
-
}
|
58
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
59
|
+
},
|
60
60
|
}
|
61
|
-
)
|
62
|
-
|
61
|
+
).
|
62
|
+
to_return(
|
63
63
|
body: {
|
64
64
|
'customers' =>
|
65
65
|
|
@@ -80,8 +80,8 @@ describe GoCardlessPro::Resources::Customer do
|
|
80
80
|
'metadata' => 'metadata-input',
|
81
81
|
'postal_code' => 'postal_code-input',
|
82
82
|
'region' => 'region-input',
|
83
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
84
|
-
}
|
83
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
84
|
+
},
|
85
85
|
|
86
86
|
}.to_json,
|
87
87
|
headers: response_headers
|
@@ -103,9 +103,9 @@ describe GoCardlessPro::Resources::Customer do
|
|
103
103
|
type: 'validation_failed',
|
104
104
|
code: 422,
|
105
105
|
errors: [
|
106
|
-
{ message: 'test error message', field: 'test_field' }
|
107
|
-
]
|
108
|
-
}
|
106
|
+
{ message: 'test error message', field: 'test_field' },
|
107
|
+
],
|
108
|
+
},
|
109
109
|
}.to_json,
|
110
110
|
headers: response_headers,
|
111
111
|
status: 422
|
@@ -138,7 +138,7 @@ describe GoCardlessPro::Resources::Customer do
|
|
138
138
|
'metadata' => 'metadata-input',
|
139
139
|
'postal_code' => 'postal_code-input',
|
140
140
|
'region' => 'region-input',
|
141
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
141
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
142
142
|
}
|
143
143
|
end
|
144
144
|
|
@@ -153,11 +153,11 @@ describe GoCardlessPro::Resources::Customer do
|
|
153
153
|
message: 'A resource has already been created with this idempotency key',
|
154
154
|
reason: 'idempotent_creation_conflict',
|
155
155
|
links: {
|
156
|
-
conflicting_resource_id: id
|
157
|
-
}
|
158
|
-
}
|
159
|
-
]
|
160
|
-
}
|
156
|
+
conflicting_resource_id: id,
|
157
|
+
},
|
158
|
+
},
|
159
|
+
],
|
160
|
+
},
|
161
161
|
}.to_json,
|
162
162
|
headers: response_headers,
|
163
163
|
status: 409
|
@@ -166,8 +166,8 @@ describe GoCardlessPro::Resources::Customer do
|
|
166
166
|
|
167
167
|
let!(:get_stub) do
|
168
168
|
stub_url = "/customers/#{id}"
|
169
|
-
stub_request(:get, /.*api.gocardless.com#{stub_url}/)
|
170
|
-
|
169
|
+
stub_request(:get, /.*api.gocardless.com#{stub_url}/).
|
170
|
+
to_return(
|
171
171
|
body: {
|
172
172
|
'customers' => {
|
173
173
|
|
@@ -186,8 +186,8 @@ describe GoCardlessPro::Resources::Customer do
|
|
186
186
|
'metadata' => 'metadata-input',
|
187
187
|
'postal_code' => 'postal_code-input',
|
188
188
|
'region' => 'region-input',
|
189
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
190
|
-
}
|
189
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
190
|
+
},
|
191
191
|
}.to_json,
|
192
192
|
headers: response_headers
|
193
193
|
)
|
@@ -225,14 +225,14 @@ describe GoCardlessPro::Resources::Customer do
|
|
225
225
|
'metadata' => 'metadata-input',
|
226
226
|
'postal_code' => 'postal_code-input',
|
227
227
|
'region' => 'region-input',
|
228
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
228
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
229
229
|
}],
|
230
230
|
meta: {
|
231
231
|
cursors: {
|
232
232
|
before: nil,
|
233
|
-
after: 'ABC123'
|
234
|
-
}
|
235
|
-
}
|
233
|
+
after: 'ABC123',
|
234
|
+
},
|
235
|
+
},
|
236
236
|
}.to_json,
|
237
237
|
headers: response_headers
|
238
238
|
)
|
@@ -304,12 +304,12 @@ describe GoCardlessPro::Resources::Customer do
|
|
304
304
|
'metadata' => 'metadata-input',
|
305
305
|
'postal_code' => 'postal_code-input',
|
306
306
|
'region' => 'region-input',
|
307
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
307
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
308
308
|
}],
|
309
309
|
meta: {
|
310
310
|
cursors: { after: 'AB345' },
|
311
|
-
limit: 1
|
312
|
-
}
|
311
|
+
limit: 1,
|
312
|
+
},
|
313
313
|
}.to_json,
|
314
314
|
headers: response_headers
|
315
315
|
)
|
@@ -335,12 +335,12 @@ describe GoCardlessPro::Resources::Customer do
|
|
335
335
|
'metadata' => 'metadata-input',
|
336
336
|
'postal_code' => 'postal_code-input',
|
337
337
|
'region' => 'region-input',
|
338
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
338
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
339
339
|
}],
|
340
340
|
meta: {
|
341
341
|
limit: 2,
|
342
|
-
cursors: {}
|
343
|
-
}
|
342
|
+
cursors: {},
|
343
|
+
},
|
344
344
|
}.to_json,
|
345
345
|
headers: response_headers
|
346
346
|
)
|
@@ -361,9 +361,9 @@ describe GoCardlessPro::Resources::Customer do
|
|
361
361
|
context 'passing in a custom header' do
|
362
362
|
let!(:stub) do
|
363
363
|
stub_url = '/customers/:identity'.gsub(':identity', id)
|
364
|
-
stub_request(:get, /.*api.gocardless.com#{stub_url}/)
|
365
|
-
|
366
|
-
|
364
|
+
stub_request(:get, /.*api.gocardless.com#{stub_url}/).
|
365
|
+
with(headers: { 'Foo' => 'Bar' }).
|
366
|
+
to_return(
|
367
367
|
body: {
|
368
368
|
'customers' => {
|
369
369
|
|
@@ -382,8 +382,8 @@ describe GoCardlessPro::Resources::Customer do
|
|
382
382
|
'metadata' => 'metadata-input',
|
383
383
|
'postal_code' => 'postal_code-input',
|
384
384
|
'region' => 'region-input',
|
385
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
386
|
-
}
|
385
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
386
|
+
},
|
387
387
|
}.to_json,
|
388
388
|
headers: response_headers
|
389
389
|
)
|
@@ -391,7 +391,7 @@ describe GoCardlessPro::Resources::Customer do
|
|
391
391
|
|
392
392
|
subject(:get_response) do
|
393
393
|
client.customers.get(id, headers: {
|
394
|
-
'Foo' => 'Bar'
|
394
|
+
'Foo' => 'Bar',
|
395
395
|
})
|
396
396
|
end
|
397
397
|
|
@@ -423,8 +423,8 @@ describe GoCardlessPro::Resources::Customer do
|
|
423
423
|
'metadata' => 'metadata-input',
|
424
424
|
'postal_code' => 'postal_code-input',
|
425
425
|
'region' => 'region-input',
|
426
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
427
|
-
}
|
426
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
427
|
+
},
|
428
428
|
}.to_json,
|
429
429
|
headers: response_headers
|
430
430
|
)
|
@@ -486,8 +486,8 @@ describe GoCardlessPro::Resources::Customer do
|
|
486
486
|
'metadata' => 'metadata-input',
|
487
487
|
'postal_code' => 'postal_code-input',
|
488
488
|
'region' => 'region-input',
|
489
|
-
'swedish_identity_number' => 'swedish_identity_number-input'
|
490
|
-
}
|
489
|
+
'swedish_identity_number' => 'swedish_identity_number-input',
|
490
|
+
},
|
491
491
|
}.to_json,
|
492
492
|
headers: response_headers
|
493
493
|
)
|
@@ -24,14 +24,14 @@ describe GoCardlessPro::Resources::Event do
|
|
24
24
|
'id' => 'id-input',
|
25
25
|
'links' => 'links-input',
|
26
26
|
'metadata' => 'metadata-input',
|
27
|
-
'resource_type' => 'resource_type-input'
|
27
|
+
'resource_type' => 'resource_type-input',
|
28
28
|
}],
|
29
29
|
meta: {
|
30
30
|
cursors: {
|
31
31
|
before: nil,
|
32
|
-
after: 'ABC123'
|
33
|
-
}
|
34
|
-
}
|
32
|
+
after: 'ABC123',
|
33
|
+
},
|
34
|
+
},
|
35
35
|
}.to_json,
|
36
36
|
headers: response_headers
|
37
37
|
)
|
@@ -74,12 +74,12 @@ describe GoCardlessPro::Resources::Event do
|
|
74
74
|
'id' => 'id-input',
|
75
75
|
'links' => 'links-input',
|
76
76
|
'metadata' => 'metadata-input',
|
77
|
-
'resource_type' => 'resource_type-input'
|
77
|
+
'resource_type' => 'resource_type-input',
|
78
78
|
}],
|
79
79
|
meta: {
|
80
80
|
cursors: { after: 'AB345' },
|
81
|
-
limit: 1
|
82
|
-
}
|
81
|
+
limit: 1,
|
82
|
+
},
|
83
83
|
}.to_json,
|
84
84
|
headers: response_headers
|
85
85
|
)
|
@@ -96,12 +96,12 @@ describe GoCardlessPro::Resources::Event do
|
|
96
96
|
'id' => 'id-input',
|
97
97
|
'links' => 'links-input',
|
98
98
|
'metadata' => 'metadata-input',
|
99
|
-
'resource_type' => 'resource_type-input'
|
99
|
+
'resource_type' => 'resource_type-input',
|
100
100
|
}],
|
101
101
|
meta: {
|
102
102
|
limit: 2,
|
103
|
-
cursors: {}
|
104
|
-
}
|
103
|
+
cursors: {},
|
104
|
+
},
|
105
105
|
}.to_json,
|
106
106
|
headers: response_headers
|
107
107
|
)
|
@@ -122,9 +122,9 @@ describe GoCardlessPro::Resources::Event do
|
|
122
122
|
context 'passing in a custom header' do
|
123
123
|
let!(:stub) do
|
124
124
|
stub_url = '/events/:identity'.gsub(':identity', id)
|
125
|
-
stub_request(:get, /.*api.gocardless.com#{stub_url}/)
|
126
|
-
|
127
|
-
|
125
|
+
stub_request(:get, /.*api.gocardless.com#{stub_url}/).
|
126
|
+
with(headers: { 'Foo' => 'Bar' }).
|
127
|
+
to_return(
|
128
128
|
body: {
|
129
129
|
'events' => {
|
130
130
|
|
@@ -134,8 +134,8 @@ describe GoCardlessPro::Resources::Event do
|
|
134
134
|
'id' => 'id-input',
|
135
135
|
'links' => 'links-input',
|
136
136
|
'metadata' => 'metadata-input',
|
137
|
-
'resource_type' => 'resource_type-input'
|
138
|
-
}
|
137
|
+
'resource_type' => 'resource_type-input',
|
138
|
+
},
|
139
139
|
}.to_json,
|
140
140
|
headers: response_headers
|
141
141
|
)
|
@@ -143,7 +143,7 @@ describe GoCardlessPro::Resources::Event do
|
|
143
143
|
|
144
144
|
subject(:get_response) do
|
145
145
|
client.events.get(id, headers: {
|
146
|
-
'Foo' => 'Bar'
|
146
|
+
'Foo' => 'Bar',
|
147
147
|
})
|
148
148
|
end
|
149
149
|
|
@@ -166,8 +166,8 @@ describe GoCardlessPro::Resources::Event do
|
|
166
166
|
'id' => 'id-input',
|
167
167
|
'links' => 'links-input',
|
168
168
|
'metadata' => 'metadata-input',
|
169
|
-
'resource_type' => 'resource_type-input'
|
170
|
-
}
|
169
|
+
'resource_type' => 'resource_type-input',
|
170
|
+
},
|
171
171
|
}.to_json,
|
172
172
|
headers: response_headers
|
173
173
|
)
|