Skip to content

Commit 4e37606

Browse files
committed
ci: add tests for mandates in cypress
1 parent b82bee6 commit 4e37606

File tree

1 file changed

+65
-39
lines changed
  • cypress-tests/cypress/e2e/configs/Payment

1 file changed

+65
-39
lines changed

cypress-tests/cypress/e2e/configs/Payment/Payload.js

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
import {
22
customerAcceptance,
3-
singleUseMandateData,
4-
multiUseMandateData,
3+
connectorDetails as commonConnectorDetails,
54
} from "./Commons";
5+
import { getCustomExchange } from "./Modifiers";
6+
7+
const DUPLICATION_TIMEOUT = 30000; // 30 seconds
8+
9+
const singleUseMandateData = {
10+
customer_acceptance: customerAcceptance,
11+
mandate_type: {
12+
single_use: {
13+
amount: 8000,
14+
currency: "USD",
15+
},
16+
},
17+
};
18+
19+
const multiUseMandateData = {
20+
customer_acceptance: customerAcceptance,
21+
mandate_type: {
22+
multi_use: {
23+
amount: 8000,
24+
currency: "USD",
25+
},
26+
},
27+
};
628

729
const successfulNo3DSCardDetails = {
830
card_number: "4242424242424242",
@@ -179,7 +201,7 @@ export const connectorDetails = {
179201
Configs: {
180202
DELAY: {
181203
STATUS: true,
182-
TIMEOUT: 15000,
204+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
183205
},
184206
},
185207
Request: {
@@ -313,7 +335,7 @@ export const connectorDetails = {
313335
Configs: {
314336
DELAY: {
315337
STATUS: true,
316-
TIMEOUT: 15000,
338+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
317339
},
318340
},
319341
Request: {
@@ -336,7 +358,7 @@ export const connectorDetails = {
336358
Configs: {
337359
DELAY: {
338360
STATUS: true,
339-
TIMEOUT: 15000,
361+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
340362
},
341363
},
342364
Request: {
@@ -359,7 +381,7 @@ export const connectorDetails = {
359381
Configs: {
360382
DELAY: {
361383
STATUS: true,
362-
TIMEOUT: 15000,
384+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
363385
},
364386
TRIGGER_SKIP: true,
365387
},
@@ -383,7 +405,7 @@ export const connectorDetails = {
383405
Configs: {
384406
DELAY: {
385407
STATUS: true,
386-
TIMEOUT: 15000,
408+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
387409
},
388410
},
389411
Request: {
@@ -430,7 +452,7 @@ export const connectorDetails = {
430452
Configs: {
431453
DELAY: {
432454
STATUS: true,
433-
TIMEOUT: 15000,
455+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
434456
},
435457
},
436458
Request: {
@@ -452,7 +474,7 @@ export const connectorDetails = {
452474
Configs: {
453475
DELAY: {
454476
STATUS: true,
455-
TIMEOUT: 15000,
477+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
456478
},
457479
},
458480
Request: {
@@ -469,7 +491,7 @@ export const connectorDetails = {
469491
Configs: {
470492
DELAY: {
471493
STATUS: true,
472-
TIMEOUT: 15000,
494+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
473495
},
474496
},
475497
Request: {
@@ -486,7 +508,7 @@ export const connectorDetails = {
486508
Configs: {
487509
DELAY: {
488510
STATUS: true,
489-
TIMEOUT: 15000,
511+
TIMEOUT: DUPLICATION_TIMEOUT / 2, // 15 seconds
490512
},
491513
},
492514
Request: {
@@ -504,9 +526,8 @@ export const connectorDetails = {
504526
Configs: {
505527
DELAY: {
506528
STATUS: true,
507-
TIMEOUT: 15000,
529+
TIMEOUT: DUPLICATION_TIMEOUT,
508530
},
509-
TRIGGER_SKIP: true,
510531
},
511532
Request: {
512533
payment_method: "card",
@@ -528,9 +549,8 @@ export const connectorDetails = {
528549
Configs: {
529550
DELAY: {
530551
STATUS: true,
531-
TIMEOUT: 15000,
552+
TIMEOUT: DUPLICATION_TIMEOUT,
532553
},
533-
TRIGGER_SKIP: true,
534554
},
535555
Request: {
536556
payment_method: "card",
@@ -544,20 +564,15 @@ export const connectorDetails = {
544564
status: 200,
545565
body: {
546566
status: "succeeded",
547-
mandate_id: null,
548-
payment_method_data: payment_method_data_no3ds,
549-
payment_method: "card",
550-
connector: "payload",
551567
},
552568
},
553569
},
554570
MandateSingleUseNo3DSManualCapture: {
555571
Configs: {
556572
DELAY: {
557573
STATUS: true,
558-
TIMEOUT: 15000,
574+
TIMEOUT: DUPLICATION_TIMEOUT,
559575
},
560-
TRIGGER_SKIP: true,
561576
},
562577
Request: {
563578
payment_method: "card",
@@ -571,20 +586,15 @@ export const connectorDetails = {
571586
status: 200,
572587
body: {
573588
status: "requires_capture",
574-
mandate_id: null,
575-
payment_method_data: payment_method_data_no3ds,
576-
payment_method: "card",
577-
connector: "payload",
578589
},
579590
},
580591
},
581592
MandateMultiUseNo3DSAutoCapture: {
582593
Configs: {
583594
DELAY: {
584595
STATUS: true,
585-
TIMEOUT: 15000,
596+
TIMEOUT: DUPLICATION_TIMEOUT,
586597
},
587-
TRIGGER_SKIP: true,
588598
},
589599
Request: {
590600
payment_method: "card",
@@ -598,19 +608,15 @@ export const connectorDetails = {
598608
status: 200,
599609
body: {
600610
status: "succeeded",
601-
payment_method_data: payment_method_data_no3ds,
602-
payment_method: "card",
603-
connector: "payload",
604611
},
605612
},
606613
},
607614
MandateMultiUseNo3DSManualCapture: {
608615
Configs: {
609616
DELAY: {
610617
STATUS: true,
611-
TIMEOUT: 15000,
618+
TIMEOUT: DUPLICATION_TIMEOUT,
612619
},
613-
TRIGGER_SKIP: true,
614620
},
615621
Request: {
616622
payment_method: "card",
@@ -624,19 +630,15 @@ export const connectorDetails = {
624630
status: 200,
625631
body: {
626632
status: "requires_capture",
627-
payment_method_data: payment_method_data_no3ds,
628-
payment_method: "card",
629-
connector: "payload",
630633
},
631634
},
632635
},
633636
ZeroAuthPaymentIntent: {
634637
Configs: {
635638
DELAY: {
636639
STATUS: true,
637-
TIMEOUT: 15000,
640+
TIMEOUT: DUPLICATION_TIMEOUT,
638641
},
639-
TRIGGER_SKIP: true,
640642
},
641643
Request: {
642644
currency: "BRL",
@@ -652,9 +654,8 @@ export const connectorDetails = {
652654
Configs: {
653655
DELAY: {
654656
STATUS: true,
655-
TIMEOUT: 15000,
657+
TIMEOUT: DUPLICATION_TIMEOUT,
656658
},
657-
TRIGGER_SKIP: true,
658659
},
659660
Request: {
660661
payment_method: "card",
@@ -673,5 +674,30 @@ export const connectorDetails = {
673674
},
674675
},
675676
},
677+
678+
MITAutoCapture: getCustomExchange({
679+
Configs: {
680+
DELAY: {
681+
STATUS: true,
682+
TIMEOUT: DUPLICATION_TIMEOUT,
683+
},
684+
},
685+
...commonConnectorDetails.card_pm.MITAutoCapture,
686+
}),
687+
MITManualCapture: {
688+
Configs: {
689+
DELAY: {
690+
STATUS: true,
691+
TIMEOUT: DUPLICATION_TIMEOUT,
692+
},
693+
},
694+
Request: {},
695+
Response: {
696+
status: 200,
697+
body: {
698+
status: "requires_capture",
699+
},
700+
},
701+
},
676702
},
677703
};

0 commit comments

Comments
 (0)