1
1
import {
2
2
customerAcceptance ,
3
- singleUseMandateData ,
4
- multiUseMandateData ,
3
+ connectorDetails as commonConnectorDetails ,
5
4
} 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
+ } ;
6
28
7
29
const successfulNo3DSCardDetails = {
8
30
card_number : "4242424242424242" ,
@@ -24,24 +46,6 @@ const failedNo3DSCardDetails = {
24
46
card_cvc : "123" ,
25
47
} ;
26
48
27
- const payment_method_data_no3ds = {
28
- card : {
29
- last4 : "4242" ,
30
- card_type : "CREDIT" ,
31
- card_network : "Visa" ,
32
- card_issuer : "STRIPE PAYMENTS UK LIMITED" ,
33
- card_issuing_country : "UNITEDKINGDOM" ,
34
- card_isin : "424242" ,
35
- card_extended_bin : null ,
36
- card_exp_month : "12" ,
37
- card_exp_year : "25" ,
38
- card_holder_name : "John Doe" ,
39
- payment_checks : null ,
40
- authentication_data : null ,
41
- } ,
42
- billing : null ,
43
- } ;
44
-
45
49
export const connectorDetails = {
46
50
card_pm : {
47
51
PaymentIntent : {
@@ -179,7 +183,7 @@ export const connectorDetails = {
179
183
Configs : {
180
184
DELAY : {
181
185
STATUS : true ,
182
- TIMEOUT : 15000 ,
186
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
183
187
} ,
184
188
} ,
185
189
Request : {
@@ -313,7 +317,7 @@ export const connectorDetails = {
313
317
Configs : {
314
318
DELAY : {
315
319
STATUS : true ,
316
- TIMEOUT : 15000 ,
320
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
317
321
} ,
318
322
} ,
319
323
Request : {
@@ -336,7 +340,7 @@ export const connectorDetails = {
336
340
Configs : {
337
341
DELAY : {
338
342
STATUS : true ,
339
- TIMEOUT : 15000 ,
343
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
340
344
} ,
341
345
} ,
342
346
Request : {
@@ -359,7 +363,7 @@ export const connectorDetails = {
359
363
Configs : {
360
364
DELAY : {
361
365
STATUS : true ,
362
- TIMEOUT : 15000 ,
366
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
363
367
} ,
364
368
TRIGGER_SKIP : true ,
365
369
} ,
@@ -383,7 +387,7 @@ export const connectorDetails = {
383
387
Configs : {
384
388
DELAY : {
385
389
STATUS : true ,
386
- TIMEOUT : 15000 ,
390
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
387
391
} ,
388
392
} ,
389
393
Request : {
@@ -430,7 +434,7 @@ export const connectorDetails = {
430
434
Configs : {
431
435
DELAY : {
432
436
STATUS : true ,
433
- TIMEOUT : 15000 ,
437
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
434
438
} ,
435
439
} ,
436
440
Request : {
@@ -452,7 +456,7 @@ export const connectorDetails = {
452
456
Configs : {
453
457
DELAY : {
454
458
STATUS : true ,
455
- TIMEOUT : 15000 ,
459
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
456
460
} ,
457
461
} ,
458
462
Request : {
@@ -469,7 +473,7 @@ export const connectorDetails = {
469
473
Configs : {
470
474
DELAY : {
471
475
STATUS : true ,
472
- TIMEOUT : 15000 ,
476
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
473
477
} ,
474
478
} ,
475
479
Request : {
@@ -486,7 +490,7 @@ export const connectorDetails = {
486
490
Configs : {
487
491
DELAY : {
488
492
STATUS : true ,
489
- TIMEOUT : 15000 ,
493
+ TIMEOUT : DUPLICATION_TIMEOUT / 2 , // 15 seconds
490
494
} ,
491
495
} ,
492
496
Request : {
@@ -504,9 +508,8 @@ export const connectorDetails = {
504
508
Configs : {
505
509
DELAY : {
506
510
STATUS : true ,
507
- TIMEOUT : 15000 ,
511
+ TIMEOUT : DUPLICATION_TIMEOUT ,
508
512
} ,
509
- TRIGGER_SKIP : true ,
510
513
} ,
511
514
Request : {
512
515
payment_method : "card" ,
@@ -528,9 +531,8 @@ export const connectorDetails = {
528
531
Configs : {
529
532
DELAY : {
530
533
STATUS : true ,
531
- TIMEOUT : 15000 ,
534
+ TIMEOUT : DUPLICATION_TIMEOUT ,
532
535
} ,
533
- TRIGGER_SKIP : true ,
534
536
} ,
535
537
Request : {
536
538
payment_method : "card" ,
@@ -544,20 +546,15 @@ export const connectorDetails = {
544
546
status : 200 ,
545
547
body : {
546
548
status : "succeeded" ,
547
- mandate_id : null ,
548
- payment_method_data : payment_method_data_no3ds ,
549
- payment_method : "card" ,
550
- connector : "payload" ,
551
549
} ,
552
550
} ,
553
551
} ,
554
552
MandateSingleUseNo3DSManualCapture : {
555
553
Configs : {
556
554
DELAY : {
557
555
STATUS : true ,
558
- TIMEOUT : 15000 ,
556
+ TIMEOUT : DUPLICATION_TIMEOUT ,
559
557
} ,
560
- TRIGGER_SKIP : true ,
561
558
} ,
562
559
Request : {
563
560
payment_method : "card" ,
@@ -571,20 +568,15 @@ export const connectorDetails = {
571
568
status : 200 ,
572
569
body : {
573
570
status : "requires_capture" ,
574
- mandate_id : null ,
575
- payment_method_data : payment_method_data_no3ds ,
576
- payment_method : "card" ,
577
- connector : "payload" ,
578
571
} ,
579
572
} ,
580
573
} ,
581
574
MandateMultiUseNo3DSAutoCapture : {
582
575
Configs : {
583
576
DELAY : {
584
577
STATUS : true ,
585
- TIMEOUT : 15000 ,
578
+ TIMEOUT : DUPLICATION_TIMEOUT ,
586
579
} ,
587
- TRIGGER_SKIP : true ,
588
580
} ,
589
581
Request : {
590
582
payment_method : "card" ,
@@ -598,19 +590,15 @@ export const connectorDetails = {
598
590
status : 200 ,
599
591
body : {
600
592
status : "succeeded" ,
601
- payment_method_data : payment_method_data_no3ds ,
602
- payment_method : "card" ,
603
- connector : "payload" ,
604
593
} ,
605
594
} ,
606
595
} ,
607
596
MandateMultiUseNo3DSManualCapture : {
608
597
Configs : {
609
598
DELAY : {
610
599
STATUS : true ,
611
- TIMEOUT : 15000 ,
600
+ TIMEOUT : DUPLICATION_TIMEOUT ,
612
601
} ,
613
- TRIGGER_SKIP : true ,
614
602
} ,
615
603
Request : {
616
604
payment_method : "card" ,
@@ -624,19 +612,15 @@ export const connectorDetails = {
624
612
status : 200 ,
625
613
body : {
626
614
status : "requires_capture" ,
627
- payment_method_data : payment_method_data_no3ds ,
628
- payment_method : "card" ,
629
- connector : "payload" ,
630
615
} ,
631
616
} ,
632
617
} ,
633
618
ZeroAuthPaymentIntent : {
634
619
Configs : {
635
620
DELAY : {
636
621
STATUS : true ,
637
- TIMEOUT : 15000 ,
622
+ TIMEOUT : DUPLICATION_TIMEOUT ,
638
623
} ,
639
- TRIGGER_SKIP : true ,
640
624
} ,
641
625
Request : {
642
626
currency : "BRL" ,
@@ -652,9 +636,8 @@ export const connectorDetails = {
652
636
Configs : {
653
637
DELAY : {
654
638
STATUS : true ,
655
- TIMEOUT : 15000 ,
639
+ TIMEOUT : DUPLICATION_TIMEOUT ,
656
640
} ,
657
- TRIGGER_SKIP : true ,
658
641
} ,
659
642
Request : {
660
643
payment_method : "card" ,
@@ -673,5 +656,30 @@ export const connectorDetails = {
673
656
} ,
674
657
} ,
675
658
} ,
659
+
660
+ MITAutoCapture : getCustomExchange ( {
661
+ Configs : {
662
+ DELAY : {
663
+ STATUS : true ,
664
+ TIMEOUT : DUPLICATION_TIMEOUT ,
665
+ } ,
666
+ } ,
667
+ ...commonConnectorDetails . card_pm . MITAutoCapture ,
668
+ } ) ,
669
+ MITManualCapture : {
670
+ Configs : {
671
+ DELAY : {
672
+ STATUS : true ,
673
+ TIMEOUT : DUPLICATION_TIMEOUT ,
674
+ } ,
675
+ } ,
676
+ Request : { } ,
677
+ Response : {
678
+ status : 200 ,
679
+ body : {
680
+ status : "requires_capture" ,
681
+ } ,
682
+ } ,
683
+ } ,
676
684
} ,
677
685
} ;
0 commit comments