gocardless_pro 2.29.0 → 2.30.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/lib/gocardless_pro/client.rb +1 -1
- data/lib/gocardless_pro/resources/billing_request.rb +2 -0
- data/lib/gocardless_pro/resources/billing_request_flow.rb +4 -0
- data/lib/gocardless_pro/resources/block.rb +19 -9
- data/lib/gocardless_pro/resources/institution.rb +5 -1
- data/lib/gocardless_pro/resources/payer_authorisation.rb +4 -4
- data/lib/gocardless_pro/resources/redirect_flow.rb +4 -0
- data/lib/gocardless_pro/services/billing_request_flows_service.rb +1 -1
- data/lib/gocardless_pro/services/billing_requests_service.rb +40 -2
- data/lib/gocardless_pro/services/institutions_service.rb +1 -1
- data/lib/gocardless_pro/version.rb +1 -1
- data/spec/resources/billing_request_flow_spec.rb +14 -0
- data/spec/resources/billing_request_spec.rb +108 -0
- data/spec/resources/block_spec.rb +18 -1
- data/spec/resources/creditor_bank_account_spec.rb +2 -0
- data/spec/resources/customer_bank_account_spec.rb +2 -0
- data/spec/resources/customer_notification_spec.rb +2 -0
- data/spec/resources/customer_spec.rb +2 -0
- data/spec/resources/instalment_schedule_spec.rb +2 -0
- data/spec/resources/mandate_import_spec.rb +4 -0
- data/spec/resources/mandate_spec.rb +4 -0
- data/spec/resources/payer_authorisation_spec.rb +4 -0
- data/spec/resources/payment_spec.rb +4 -0
- data/spec/resources/redirect_flow_spec.rb +2 -0
- data/spec/resources/scenario_simulator_spec.rb +2 -0
- data/spec/resources/subscription_spec.rb +6 -0
- data/spec/resources/webhook_spec.rb +2 -0
- data/spec/services/billing_request_flows_service_spec.rb +14 -0
- data/spec/services/billing_requests_service_spec.rb +123 -0
- data/spec/services/blocks_service_spec.rb +18 -1
- data/spec/services/creditor_bank_accounts_service_spec.rb +2 -0
- data/spec/services/customer_bank_accounts_service_spec.rb +2 -0
- data/spec/services/customer_notifications_service_spec.rb +2 -0
- data/spec/services/customers_service_spec.rb +2 -0
- data/spec/services/instalment_schedules_service_spec.rb +2 -0
- data/spec/services/mandate_imports_service_spec.rb +4 -0
- data/spec/services/mandates_service_spec.rb +4 -0
- data/spec/services/payer_authorisations_service_spec.rb +4 -0
- data/spec/services/payments_service_spec.rb +4 -0
- data/spec/services/redirect_flows_service_spec.rb +2 -0
- data/spec/services/scenario_simulators_service_spec.rb +2 -0
- data/spec/services/subscriptions_service_spec.rb +6 -0
- data/spec/services/webhooks_service_spec.rb +2 -0
- metadata +7 -7
@@ -20,6 +20,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
20
20
|
|
21
21
|
'actions' => 'actions-input',
|
22
22
|
'created_at' => 'created_at-input',
|
23
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
23
24
|
'id' => 'id-input',
|
24
25
|
'links' => 'links-input',
|
25
26
|
'mandate_request' => 'mandate_request-input',
|
@@ -46,6 +47,8 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
46
47
|
|
47
48
|
expect(get_list_response.records.first.created_at).to eq('created_at-input')
|
48
49
|
|
50
|
+
expect(get_list_response.records.first.fallback_enabled).to eq('fallback_enabled-input')
|
51
|
+
|
49
52
|
expect(get_list_response.records.first.id).to eq('id-input')
|
50
53
|
|
51
54
|
expect(get_list_response.records.first.mandate_request).to eq('mandate_request-input')
|
@@ -76,6 +79,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
76
79
|
|
77
80
|
'actions' => 'actions-input',
|
78
81
|
'created_at' => 'created_at-input',
|
82
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
79
83
|
'id' => 'id-input',
|
80
84
|
'links' => 'links-input',
|
81
85
|
'mandate_request' => 'mandate_request-input',
|
@@ -100,6 +104,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
100
104
|
|
101
105
|
'actions' => 'actions-input',
|
102
106
|
'created_at' => 'created_at-input',
|
107
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
103
108
|
'id' => 'id-input',
|
104
109
|
'links' => 'links-input',
|
105
110
|
'mandate_request' => 'mandate_request-input',
|
@@ -132,6 +137,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
132
137
|
|
133
138
|
'actions' => 'actions-input',
|
134
139
|
'created_at' => 'created_at-input',
|
140
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
135
141
|
'id' => 'id-input',
|
136
142
|
'links' => 'links-input',
|
137
143
|
'mandate_request' => 'mandate_request-input',
|
@@ -150,6 +156,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
150
156
|
|
151
157
|
'actions' => 'actions-input',
|
152
158
|
'created_at' => 'created_at-input',
|
159
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
153
160
|
'id' => 'id-input',
|
154
161
|
'links' => 'links-input',
|
155
162
|
'mandate_request' => 'mandate_request-input',
|
@@ -168,6 +175,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
168
175
|
|
169
176
|
'actions' => 'actions-input',
|
170
177
|
'created_at' => 'created_at-input',
|
178
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
171
179
|
'id' => 'id-input',
|
172
180
|
'links' => 'links-input',
|
173
181
|
'mandate_request' => 'mandate_request-input',
|
@@ -219,6 +227,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
219
227
|
|
220
228
|
'actions' => 'actions-input',
|
221
229
|
'created_at' => 'created_at-input',
|
230
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
222
231
|
'id' => 'id-input',
|
223
232
|
'links' => 'links-input',
|
224
233
|
'mandate_request' => 'mandate_request-input',
|
@@ -260,6 +269,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
260
269
|
|
261
270
|
'actions' => 'actions-input',
|
262
271
|
'created_at' => 'created_at-input',
|
272
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
263
273
|
'id' => 'id-input',
|
264
274
|
'links' => 'links-input',
|
265
275
|
'mandate_request' => 'mandate_request-input',
|
@@ -297,6 +307,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
297
307
|
|
298
308
|
'actions' => 'actions-input',
|
299
309
|
'created_at' => 'created_at-input',
|
310
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
300
311
|
'id' => 'id-input',
|
301
312
|
'links' => 'links-input',
|
302
313
|
'mandate_request' => 'mandate_request-input',
|
@@ -331,6 +342,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
331
342
|
|
332
343
|
'actions' => 'actions-input',
|
333
344
|
'created_at' => 'created_at-input',
|
345
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
334
346
|
'id' => 'id-input',
|
335
347
|
'links' => 'links-input',
|
336
348
|
'mandate_request' => 'mandate_request-input',
|
@@ -381,11 +393,13 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
381
393
|
# /billing_requests/%v/actions/collect_customer_details
|
382
394
|
stub_url = '/billing_requests/:identity/actions/collect_customer_details'.gsub(':identity', resource_id)
|
383
395
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
396
|
+
|
384
397
|
body: {
|
385
398
|
'billing_requests' => {
|
386
399
|
|
387
400
|
'actions' => 'actions-input',
|
388
401
|
'created_at' => 'created_at-input',
|
402
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
389
403
|
'id' => 'id-input',
|
390
404
|
'links' => 'links-input',
|
391
405
|
'mandate_request' => 'mandate_request-input',
|
@@ -395,6 +409,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
395
409
|
'status' => 'status-input',
|
396
410
|
},
|
397
411
|
}.to_json,
|
412
|
+
|
398
413
|
headers: response_headers
|
399
414
|
)
|
400
415
|
end
|
@@ -425,6 +440,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
425
440
|
|
426
441
|
'actions' => 'actions-input',
|
427
442
|
'created_at' => 'created_at-input',
|
443
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
428
444
|
'id' => 'id-input',
|
429
445
|
'links' => 'links-input',
|
430
446
|
'mandate_request' => 'mandate_request-input',
|
@@ -449,11 +465,13 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
449
465
|
# /billing_requests/%v/actions/collect_bank_account
|
450
466
|
stub_url = '/billing_requests/:identity/actions/collect_bank_account'.gsub(':identity', resource_id)
|
451
467
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
468
|
+
|
452
469
|
body: {
|
453
470
|
'billing_requests' => {
|
454
471
|
|
455
472
|
'actions' => 'actions-input',
|
456
473
|
'created_at' => 'created_at-input',
|
474
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
457
475
|
'id' => 'id-input',
|
458
476
|
'links' => 'links-input',
|
459
477
|
'mandate_request' => 'mandate_request-input',
|
@@ -463,6 +481,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
463
481
|
'status' => 'status-input',
|
464
482
|
},
|
465
483
|
}.to_json,
|
484
|
+
|
466
485
|
headers: response_headers
|
467
486
|
)
|
468
487
|
end
|
@@ -493,6 +512,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
493
512
|
|
494
513
|
'actions' => 'actions-input',
|
495
514
|
'created_at' => 'created_at-input',
|
515
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
496
516
|
'id' => 'id-input',
|
497
517
|
'links' => 'links-input',
|
498
518
|
'mandate_request' => 'mandate_request-input',
|
@@ -517,11 +537,13 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
517
537
|
# /billing_requests/%v/actions/fulfil
|
518
538
|
stub_url = '/billing_requests/:identity/actions/fulfil'.gsub(':identity', resource_id)
|
519
539
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
540
|
+
|
520
541
|
body: {
|
521
542
|
'billing_requests' => {
|
522
543
|
|
523
544
|
'actions' => 'actions-input',
|
524
545
|
'created_at' => 'created_at-input',
|
546
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
525
547
|
'id' => 'id-input',
|
526
548
|
'links' => 'links-input',
|
527
549
|
'mandate_request' => 'mandate_request-input',
|
@@ -531,6 +553,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
531
553
|
'status' => 'status-input',
|
532
554
|
},
|
533
555
|
}.to_json,
|
556
|
+
|
534
557
|
headers: response_headers
|
535
558
|
)
|
536
559
|
end
|
@@ -561,6 +584,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
561
584
|
|
562
585
|
'actions' => 'actions-input',
|
563
586
|
'created_at' => 'created_at-input',
|
587
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
564
588
|
'id' => 'id-input',
|
565
589
|
'links' => 'links-input',
|
566
590
|
'mandate_request' => 'mandate_request-input',
|
@@ -585,11 +609,13 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
585
609
|
# /billing_requests/%v/actions/confirm_payer_details
|
586
610
|
stub_url = '/billing_requests/:identity/actions/confirm_payer_details'.gsub(':identity', resource_id)
|
587
611
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
612
|
+
|
588
613
|
body: {
|
589
614
|
'billing_requests' => {
|
590
615
|
|
591
616
|
'actions' => 'actions-input',
|
592
617
|
'created_at' => 'created_at-input',
|
618
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
593
619
|
'id' => 'id-input',
|
594
620
|
'links' => 'links-input',
|
595
621
|
'mandate_request' => 'mandate_request-input',
|
@@ -599,6 +625,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
599
625
|
'status' => 'status-input',
|
600
626
|
},
|
601
627
|
}.to_json,
|
628
|
+
|
602
629
|
headers: response_headers
|
603
630
|
)
|
604
631
|
end
|
@@ -629,6 +656,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
629
656
|
|
630
657
|
'actions' => 'actions-input',
|
631
658
|
'created_at' => 'created_at-input',
|
659
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
632
660
|
'id' => 'id-input',
|
633
661
|
'links' => 'links-input',
|
634
662
|
'mandate_request' => 'mandate_request-input',
|
@@ -653,11 +681,13 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
653
681
|
# /billing_requests/%v/actions/cancel
|
654
682
|
stub_url = '/billing_requests/:identity/actions/cancel'.gsub(':identity', resource_id)
|
655
683
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
684
|
+
|
656
685
|
body: {
|
657
686
|
'billing_requests' => {
|
658
687
|
|
659
688
|
'actions' => 'actions-input',
|
660
689
|
'created_at' => 'created_at-input',
|
690
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
661
691
|
'id' => 'id-input',
|
662
692
|
'links' => 'links-input',
|
663
693
|
'mandate_request' => 'mandate_request-input',
|
@@ -667,6 +697,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
667
697
|
'status' => 'status-input',
|
668
698
|
},
|
669
699
|
}.to_json,
|
700
|
+
|
670
701
|
headers: response_headers
|
671
702
|
)
|
672
703
|
end
|
@@ -697,6 +728,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
697
728
|
|
698
729
|
'actions' => 'actions-input',
|
699
730
|
'created_at' => 'created_at-input',
|
731
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
700
732
|
'id' => 'id-input',
|
701
733
|
'links' => 'links-input',
|
702
734
|
'mandate_request' => 'mandate_request-input',
|
@@ -721,11 +753,13 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
721
753
|
# /billing_requests/%v/actions/notify
|
722
754
|
stub_url = '/billing_requests/:identity/actions/notify'.gsub(':identity', resource_id)
|
723
755
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
756
|
+
|
724
757
|
body: {
|
725
758
|
'billing_requests' => {
|
726
759
|
|
727
760
|
'actions' => 'actions-input',
|
728
761
|
'created_at' => 'created_at-input',
|
762
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
729
763
|
'id' => 'id-input',
|
730
764
|
'links' => 'links-input',
|
731
765
|
'mandate_request' => 'mandate_request-input',
|
@@ -735,6 +769,7 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
735
769
|
'status' => 'status-input',
|
736
770
|
},
|
737
771
|
}.to_json,
|
772
|
+
|
738
773
|
headers: response_headers
|
739
774
|
)
|
740
775
|
end
|
@@ -765,6 +800,79 @@ describe GoCardlessPro::Resources::BillingRequest do
|
|
765
800
|
|
766
801
|
'actions' => 'actions-input',
|
767
802
|
'created_at' => 'created_at-input',
|
803
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
804
|
+
'id' => 'id-input',
|
805
|
+
'links' => 'links-input',
|
806
|
+
'mandate_request' => 'mandate_request-input',
|
807
|
+
'metadata' => 'metadata-input',
|
808
|
+
'payment_request' => 'payment_request-input',
|
809
|
+
'resources' => 'resources-input',
|
810
|
+
'status' => 'status-input',
|
811
|
+
},
|
812
|
+
}.to_json,
|
813
|
+
headers: response_headers
|
814
|
+
)
|
815
|
+
end
|
816
|
+
end
|
817
|
+
end
|
818
|
+
|
819
|
+
describe '#fallback' do
|
820
|
+
subject(:post_response) { client.billing_requests.fallback(resource_id) }
|
821
|
+
|
822
|
+
let(:resource_id) { 'ABC123' }
|
823
|
+
|
824
|
+
let!(:stub) do
|
825
|
+
# /billing_requests/%v/actions/fallback
|
826
|
+
stub_url = '/billing_requests/:identity/actions/fallback'.gsub(':identity', resource_id)
|
827
|
+
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
828
|
+
|
829
|
+
body: {
|
830
|
+
'billing_requests' => {
|
831
|
+
|
832
|
+
'actions' => 'actions-input',
|
833
|
+
'created_at' => 'created_at-input',
|
834
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
835
|
+
'id' => 'id-input',
|
836
|
+
'links' => 'links-input',
|
837
|
+
'mandate_request' => 'mandate_request-input',
|
838
|
+
'metadata' => 'metadata-input',
|
839
|
+
'payment_request' => 'payment_request-input',
|
840
|
+
'resources' => 'resources-input',
|
841
|
+
'status' => 'status-input',
|
842
|
+
},
|
843
|
+
}.to_json,
|
844
|
+
|
845
|
+
headers: response_headers
|
846
|
+
)
|
847
|
+
end
|
848
|
+
|
849
|
+
it 'wraps the response and calls the right endpoint' do
|
850
|
+
expect(post_response).to be_a(GoCardlessPro::Resources::BillingRequest)
|
851
|
+
|
852
|
+
expect(stub).to have_been_requested
|
853
|
+
end
|
854
|
+
|
855
|
+
context 'when the request needs a body and custom header' do
|
856
|
+
let(:body) { { foo: 'bar' } }
|
857
|
+
let(:headers) { { 'Foo' => 'Bar' } }
|
858
|
+
subject(:post_response) { client.billing_requests.fallback(resource_id, body, headers) }
|
859
|
+
|
860
|
+
let(:resource_id) { 'ABC123' }
|
861
|
+
|
862
|
+
let!(:stub) do
|
863
|
+
# /billing_requests/%v/actions/fallback
|
864
|
+
stub_url = '/billing_requests/:identity/actions/fallback'.gsub(':identity', resource_id)
|
865
|
+
stub_request(:post, /.*api.gocardless.com#{stub_url}/).
|
866
|
+
with(
|
867
|
+
body: { foo: 'bar' },
|
868
|
+
headers: { 'Foo' => 'Bar' }
|
869
|
+
).to_return(
|
870
|
+
body: {
|
871
|
+
'billing_requests' => {
|
872
|
+
|
873
|
+
'actions' => 'actions-input',
|
874
|
+
'created_at' => 'created_at-input',
|
875
|
+
'fallback_enabled' => 'fallback_enabled-input',
|
768
876
|
'id' => 'id-input',
|
769
877
|
'links' => 'links-input',
|
770
878
|
'mandate_request' => 'mandate_request-input',
|
@@ -371,6 +371,7 @@ describe GoCardlessPro::Resources::Block do
|
|
371
371
|
# /blocks/%v/actions/disable
|
372
372
|
stub_url = '/blocks/:identity/actions/disable'.gsub(':identity', resource_id)
|
373
373
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
374
|
+
|
374
375
|
body: {
|
375
376
|
'blocks' => {
|
376
377
|
|
@@ -384,6 +385,7 @@ describe GoCardlessPro::Resources::Block do
|
|
384
385
|
'updated_at' => 'updated_at-input',
|
385
386
|
},
|
386
387
|
}.to_json,
|
388
|
+
|
387
389
|
headers: response_headers
|
388
390
|
)
|
389
391
|
end
|
@@ -437,6 +439,7 @@ describe GoCardlessPro::Resources::Block do
|
|
437
439
|
# /blocks/%v/actions/enable
|
438
440
|
stub_url = '/blocks/:identity/actions/enable'.gsub(':identity', resource_id)
|
439
441
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
442
|
+
|
440
443
|
body: {
|
441
444
|
'blocks' => {
|
442
445
|
|
@@ -450,6 +453,7 @@ describe GoCardlessPro::Resources::Block do
|
|
450
453
|
'updated_at' => 'updated_at-input',
|
451
454
|
},
|
452
455
|
}.to_json,
|
456
|
+
|
453
457
|
headers: response_headers
|
454
458
|
)
|
455
459
|
end
|
@@ -503,8 +507,9 @@ describe GoCardlessPro::Resources::Block do
|
|
503
507
|
# /block_by_ref
|
504
508
|
stub_url = '/block_by_ref'.gsub(':identity', resource_id)
|
505
509
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
510
|
+
|
506
511
|
body: {
|
507
|
-
'blocks' =>
|
512
|
+
'blocks' => [{
|
508
513
|
|
509
514
|
'active' => 'active-input',
|
510
515
|
'block_type' => 'block_type-input',
|
@@ -515,7 +520,14 @@ describe GoCardlessPro::Resources::Block do
|
|
515
520
|
'resource_reference' => 'resource_reference-input',
|
516
521
|
'updated_at' => 'updated_at-input',
|
517
522
|
}],
|
523
|
+
meta: {
|
524
|
+
cursors: {
|
525
|
+
before: nil,
|
526
|
+
after: 'ABC123',
|
527
|
+
},
|
528
|
+
},
|
518
529
|
}.to_json,
|
530
|
+
|
519
531
|
headers: response_headers
|
520
532
|
)
|
521
533
|
end
|
@@ -526,6 +538,11 @@ describe GoCardlessPro::Resources::Block do
|
|
526
538
|
expect(stub).to have_been_requested
|
527
539
|
end
|
528
540
|
|
541
|
+
it 'exposes the cursors for before and after' do
|
542
|
+
expect(post_response.before).to eq(nil)
|
543
|
+
expect(post_response.after).to eq('ABC123')
|
544
|
+
end
|
545
|
+
|
529
546
|
context 'when the request needs a body and custom header' do
|
530
547
|
subject(:post_response) { client.blocks.block_by_ref(body, headers) }
|
531
548
|
|
@@ -405,6 +405,7 @@ describe GoCardlessPro::Resources::CreditorBankAccount do
|
|
405
405
|
# /creditor_bank_accounts/%v/actions/disable
|
406
406
|
stub_url = '/creditor_bank_accounts/:identity/actions/disable'.gsub(':identity', resource_id)
|
407
407
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
408
|
+
|
408
409
|
body: {
|
409
410
|
'creditor_bank_accounts' => {
|
410
411
|
|
@@ -421,6 +422,7 @@ describe GoCardlessPro::Resources::CreditorBankAccount do
|
|
421
422
|
'metadata' => 'metadata-input',
|
422
423
|
},
|
423
424
|
}.to_json,
|
425
|
+
|
424
426
|
headers: response_headers
|
425
427
|
)
|
426
428
|
end
|
@@ -442,6 +442,7 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
442
442
|
# /customer_bank_accounts/%v/actions/disable
|
443
443
|
stub_url = '/customer_bank_accounts/:identity/actions/disable'.gsub(':identity', resource_id)
|
444
444
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
445
|
+
|
445
446
|
body: {
|
446
447
|
'customer_bank_accounts' => {
|
447
448
|
|
@@ -458,6 +459,7 @@ describe GoCardlessPro::Resources::CustomerBankAccount do
|
|
458
459
|
'metadata' => 'metadata-input',
|
459
460
|
},
|
460
461
|
}.to_json,
|
462
|
+
|
461
463
|
headers: response_headers
|
462
464
|
)
|
463
465
|
end
|
@@ -18,6 +18,7 @@ describe GoCardlessPro::Resources::CustomerNotification do
|
|
18
18
|
# /customer_notifications/%v/actions/handle
|
19
19
|
stub_url = '/customer_notifications/:identity/actions/handle'.gsub(':identity', resource_id)
|
20
20
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
21
|
+
|
21
22
|
body: {
|
22
23
|
'customer_notifications' => {
|
23
24
|
|
@@ -29,6 +30,7 @@ describe GoCardlessPro::Resources::CustomerNotification do
|
|
29
30
|
'type' => 'type-input',
|
30
31
|
},
|
31
32
|
}.to_json,
|
33
|
+
|
32
34
|
headers: response_headers
|
33
35
|
)
|
34
36
|
end
|
@@ -535,6 +535,7 @@ describe GoCardlessPro::Resources::Customer do
|
|
535
535
|
# /customers/%v
|
536
536
|
stub_url = '/customers/:identity'.gsub(':identity', resource_id)
|
537
537
|
stub_request(:delete, /.*api.gocardless.com#{stub_url}/).to_return(
|
538
|
+
|
538
539
|
body: {
|
539
540
|
'customers' => {
|
540
541
|
|
@@ -558,6 +559,7 @@ describe GoCardlessPro::Resources::Customer do
|
|
558
559
|
'swedish_identity_number' => 'swedish_identity_number-input',
|
559
560
|
},
|
560
561
|
}.to_json,
|
562
|
+
|
561
563
|
headers: response_headers
|
562
564
|
)
|
563
565
|
end
|
@@ -573,6 +573,7 @@ describe GoCardlessPro::Resources::InstalmentSchedule do
|
|
573
573
|
# /instalment_schedules/%v/actions/cancel
|
574
574
|
stub_url = '/instalment_schedules/:identity/actions/cancel'.gsub(':identity', resource_id)
|
575
575
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
576
|
+
|
576
577
|
body: {
|
577
578
|
'instalment_schedules' => {
|
578
579
|
|
@@ -587,6 +588,7 @@ describe GoCardlessPro::Resources::InstalmentSchedule do
|
|
587
588
|
'total_amount' => 'total_amount-input',
|
588
589
|
},
|
589
590
|
}.to_json,
|
591
|
+
|
590
592
|
headers: response_headers
|
591
593
|
)
|
592
594
|
end
|
@@ -231,6 +231,7 @@ describe GoCardlessPro::Resources::MandateImport do
|
|
231
231
|
# /mandate_imports/%v/actions/submit
|
232
232
|
stub_url = '/mandate_imports/:identity/actions/submit'.gsub(':identity', resource_id)
|
233
233
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
234
|
+
|
234
235
|
body: {
|
235
236
|
'mandate_imports' => {
|
236
237
|
|
@@ -240,6 +241,7 @@ describe GoCardlessPro::Resources::MandateImport do
|
|
240
241
|
'status' => 'status-input',
|
241
242
|
},
|
242
243
|
}.to_json,
|
244
|
+
|
243
245
|
headers: response_headers
|
244
246
|
)
|
245
247
|
end
|
@@ -289,6 +291,7 @@ describe GoCardlessPro::Resources::MandateImport do
|
|
289
291
|
# /mandate_imports/%v/actions/cancel
|
290
292
|
stub_url = '/mandate_imports/:identity/actions/cancel'.gsub(':identity', resource_id)
|
291
293
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
294
|
+
|
292
295
|
body: {
|
293
296
|
'mandate_imports' => {
|
294
297
|
|
@@ -298,6 +301,7 @@ describe GoCardlessPro::Resources::MandateImport do
|
|
298
301
|
'status' => 'status-input',
|
299
302
|
},
|
300
303
|
}.to_json,
|
304
|
+
|
301
305
|
headers: response_headers
|
302
306
|
)
|
303
307
|
end
|
@@ -416,6 +416,7 @@ describe GoCardlessPro::Resources::Mandate do
|
|
416
416
|
# /mandates/%v/actions/cancel
|
417
417
|
stub_url = '/mandates/:identity/actions/cancel'.gsub(':identity', resource_id)
|
418
418
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
419
|
+
|
419
420
|
body: {
|
420
421
|
'mandates' => {
|
421
422
|
|
@@ -430,6 +431,7 @@ describe GoCardlessPro::Resources::Mandate do
|
|
430
431
|
'status' => 'status-input',
|
431
432
|
},
|
432
433
|
}.to_json,
|
434
|
+
|
433
435
|
headers: response_headers
|
434
436
|
)
|
435
437
|
end
|
@@ -484,6 +486,7 @@ describe GoCardlessPro::Resources::Mandate do
|
|
484
486
|
# /mandates/%v/actions/reinstate
|
485
487
|
stub_url = '/mandates/:identity/actions/reinstate'.gsub(':identity', resource_id)
|
486
488
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
489
|
+
|
487
490
|
body: {
|
488
491
|
'mandates' => {
|
489
492
|
|
@@ -498,6 +501,7 @@ describe GoCardlessPro::Resources::Mandate do
|
|
498
501
|
'status' => 'status-input',
|
499
502
|
},
|
500
503
|
}.to_json,
|
504
|
+
|
501
505
|
headers: response_headers
|
502
506
|
)
|
503
507
|
end
|
@@ -293,6 +293,7 @@ describe GoCardlessPro::Resources::PayerAuthorisation do
|
|
293
293
|
# /payer_authorisations/%v/actions/submit
|
294
294
|
stub_url = '/payer_authorisations/:identity/actions/submit'.gsub(':identity', resource_id)
|
295
295
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
296
|
+
|
296
297
|
body: {
|
297
298
|
'payer_authorisations' => {
|
298
299
|
|
@@ -306,6 +307,7 @@ describe GoCardlessPro::Resources::PayerAuthorisation do
|
|
306
307
|
'status' => 'status-input',
|
307
308
|
},
|
308
309
|
}.to_json,
|
310
|
+
|
309
311
|
headers: response_headers
|
310
312
|
)
|
311
313
|
end
|
@@ -359,6 +361,7 @@ describe GoCardlessPro::Resources::PayerAuthorisation do
|
|
359
361
|
# /payer_authorisations/%v/actions/confirm
|
360
362
|
stub_url = '/payer_authorisations/:identity/actions/confirm'.gsub(':identity', resource_id)
|
361
363
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
364
|
+
|
362
365
|
body: {
|
363
366
|
'payer_authorisations' => {
|
364
367
|
|
@@ -372,6 +375,7 @@ describe GoCardlessPro::Resources::PayerAuthorisation do
|
|
372
375
|
'status' => 'status-input',
|
373
376
|
},
|
374
377
|
}.to_json,
|
378
|
+
|
375
379
|
headers: response_headers
|
376
380
|
)
|
377
381
|
end
|
@@ -468,6 +468,7 @@ describe GoCardlessPro::Resources::Payment do
|
|
468
468
|
# /payments/%v/actions/cancel
|
469
469
|
stub_url = '/payments/:identity/actions/cancel'.gsub(':identity', resource_id)
|
470
470
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
471
|
+
|
471
472
|
body: {
|
472
473
|
'payments' => {
|
473
474
|
|
@@ -486,6 +487,7 @@ describe GoCardlessPro::Resources::Payment do
|
|
486
487
|
'status' => 'status-input',
|
487
488
|
},
|
488
489
|
}.to_json,
|
490
|
+
|
489
491
|
headers: response_headers
|
490
492
|
)
|
491
493
|
end
|
@@ -544,6 +546,7 @@ describe GoCardlessPro::Resources::Payment do
|
|
544
546
|
# /payments/%v/actions/retry
|
545
547
|
stub_url = '/payments/:identity/actions/retry'.gsub(':identity', resource_id)
|
546
548
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
549
|
+
|
547
550
|
body: {
|
548
551
|
'payments' => {
|
549
552
|
|
@@ -562,6 +565,7 @@ describe GoCardlessPro::Resources::Payment do
|
|
562
565
|
'status' => 'status-input',
|
563
566
|
},
|
564
567
|
}.to_json,
|
568
|
+
|
565
569
|
headers: response_headers
|
566
570
|
)
|
567
571
|
end
|
@@ -280,6 +280,7 @@ describe GoCardlessPro::Resources::RedirectFlow do
|
|
280
280
|
# /redirect_flows/%v/actions/complete
|
281
281
|
stub_url = '/redirect_flows/:identity/actions/complete'.gsub(':identity', resource_id)
|
282
282
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
283
|
+
|
283
284
|
body: {
|
284
285
|
'redirect_flows' => {
|
285
286
|
|
@@ -296,6 +297,7 @@ describe GoCardlessPro::Resources::RedirectFlow do
|
|
296
297
|
'success_redirect_url' => 'success_redirect_url-input',
|
297
298
|
},
|
298
299
|
}.to_json,
|
300
|
+
|
299
301
|
headers: response_headers
|
300
302
|
)
|
301
303
|
end
|
@@ -18,12 +18,14 @@ describe GoCardlessPro::Resources::ScenarioSimulator do
|
|
18
18
|
# /scenario_simulators/%v/actions/run
|
19
19
|
stub_url = '/scenario_simulators/:identity/actions/run'.gsub(':identity', resource_id)
|
20
20
|
stub_request(:post, /.*api.gocardless.com#{stub_url}/).to_return(
|
21
|
+
|
21
22
|
body: {
|
22
23
|
'scenario_simulators' => {
|
23
24
|
|
24
25
|
'id' => 'id-input',
|
25
26
|
},
|
26
27
|
}.to_json,
|
28
|
+
|
27
29
|
headers: response_headers
|
28
30
|
)
|
29
31
|
end
|