@@ -79,6 +79,7 @@ impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthor
79
79
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
80
80
RoutableConnectorChoice ,
81
81
> ,
82
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
82
83
) -> RouterResult < PaymentData < F > >
83
84
where
84
85
F : ' b ,
@@ -97,6 +98,8 @@ impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthor
97
98
locale,
98
99
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
99
100
routable_connector,
101
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
102
+ business_profile,
100
103
) )
101
104
. await ?;
102
105
@@ -357,6 +360,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsIncrementalAu
357
360
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] _routable_connector : Vec <
358
361
RoutableConnectorChoice ,
359
362
> ,
363
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
364
+ _business_profile : & domain:: Profile ,
360
365
) -> RouterResult < PaymentData < F > >
361
366
where
362
367
F : ' b + Send ,
@@ -511,6 +516,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSyncData> for
511
516
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
512
517
RoutableConnectorChoice ,
513
518
> ,
519
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
514
520
) -> RouterResult < PaymentData < F > >
515
521
where
516
522
F : ' b + Send ,
@@ -525,6 +531,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSyncData> for
525
531
locale,
526
532
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
527
533
routable_connector,
534
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
535
+ business_profile,
528
536
) )
529
537
. await
530
538
}
@@ -572,6 +580,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSessionData>
572
580
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
573
581
RoutableConnectorChoice ,
574
582
> ,
583
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
575
584
) -> RouterResult < PaymentData < F > >
576
585
where
577
586
F : ' b + Send ,
@@ -586,6 +595,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSessionData>
586
595
locale,
587
596
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
588
597
routable_connector,
598
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
599
+ business_profile,
589
600
) )
590
601
. await ?;
591
602
@@ -614,6 +625,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SdkPaymentsSessionUpd
614
625
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] _routable_connector : Vec <
615
626
RoutableConnectorChoice ,
616
627
> ,
628
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
629
+ _business_profile : & domain:: Profile ,
617
630
) -> RouterResult < PaymentData < F > >
618
631
where
619
632
F : ' b + Send ,
@@ -687,6 +700,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCaptureData>
687
700
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
688
701
RoutableConnectorChoice ,
689
702
> ,
703
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
690
704
) -> RouterResult < PaymentData < F > >
691
705
where
692
706
F : ' b + Send ,
@@ -701,6 +715,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCaptureData>
701
715
locale,
702
716
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
703
717
routable_connector,
718
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
719
+ business_profile,
704
720
) )
705
721
. await ?;
706
722
@@ -723,6 +739,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCancelData> f
723
739
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
724
740
RoutableConnectorChoice ,
725
741
> ,
742
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
726
743
) -> RouterResult < PaymentData < F > >
727
744
where
728
745
F : ' b + Send ,
@@ -737,6 +754,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCancelData> f
737
754
locale,
738
755
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
739
756
routable_connector,
757
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
758
+ business_profile,
740
759
) )
741
760
. await ?;
742
761
@@ -761,6 +780,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsApproveData>
761
780
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
762
781
RoutableConnectorChoice ,
763
782
> ,
783
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
764
784
) -> RouterResult < PaymentData < F > >
765
785
where
766
786
F : ' b + Send ,
@@ -775,6 +795,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsApproveData>
775
795
locale,
776
796
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
777
797
routable_connector,
798
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
799
+ business_profile,
778
800
) )
779
801
. await ?;
780
802
@@ -797,6 +819,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsRejectData> f
797
819
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
798
820
RoutableConnectorChoice ,
799
821
> ,
822
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
800
823
) -> RouterResult < PaymentData < F > >
801
824
where
802
825
F : ' b + Send ,
@@ -811,6 +834,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsRejectData> f
811
834
locale,
812
835
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
813
836
routable_connector,
837
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
838
+ business_profile,
814
839
) )
815
840
. await ?;
816
841
@@ -839,6 +864,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
839
864
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
840
865
RoutableConnectorChoice ,
841
866
> ,
867
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
842
868
) -> RouterResult < PaymentData < F > >
843
869
where
844
870
F : ' b + Send ,
@@ -858,6 +884,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
858
884
locale,
859
885
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
860
886
routable_connector,
887
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
888
+ business_profile,
861
889
) )
862
890
. await ?;
863
891
@@ -947,6 +975,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::CompleteAuthorizeData
947
975
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connector : Vec <
948
976
RoutableConnectorChoice ,
949
977
> ,
978
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
950
979
) -> RouterResult < PaymentData < F > >
951
980
where
952
981
F : ' b + Send ,
@@ -961,6 +990,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::CompleteAuthorizeData
961
990
locale,
962
991
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
963
992
routable_connector,
993
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
994
+ business_profile,
964
995
) )
965
996
. await
966
997
}
@@ -1019,6 +1050,7 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>(
1019
1050
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] routable_connectors : Vec <
1020
1051
RoutableConnectorChoice ,
1021
1052
> ,
1053
+ #[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ] business_profile : & domain:: Profile ,
1022
1054
) -> RouterResult < PaymentData < F > > {
1023
1055
// Update additional payment data with the payment method response that we received from connector
1024
1056
@@ -1677,11 +1709,25 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>(
1677
1709
) ?;
1678
1710
1679
1711
#[ cfg( all( feature = "v1" , feature = "dynamic_routing" ) ) ]
1680
- push_metrics_for_success_based_routing ( state, key_store, & payment_attempt, routable_connectors)
1681
- . await
1682
- . map_err ( |e| logger:: error!( dynamic_routing_metrics_error=?e) )
1683
- . ok ( ) ;
1684
-
1712
+ {
1713
+ let state = state. clone ( ) ;
1714
+ let business_profile = business_profile. clone ( ) ;
1715
+ let payment_attempt = payment_attempt. clone ( ) ;
1716
+ tokio:: spawn (
1717
+ async move {
1718
+ push_metrics_for_success_based_routing (
1719
+ & state,
1720
+ & payment_attempt,
1721
+ routable_connectors,
1722
+ & business_profile,
1723
+ )
1724
+ . await
1725
+ . map_err ( |e| logger:: error!( dynamic_routing_metrics_error=?e) )
1726
+ . ok ( ) ;
1727
+ }
1728
+ . in_current_span ( ) ,
1729
+ ) ;
1730
+ }
1685
1731
payment_data. payment_intent = payment_intent;
1686
1732
payment_data. payment_attempt = payment_attempt;
1687
1733
router_data. payment_method_status . and_then ( |status| {
0 commit comments