@@ -3744,6 +3744,11 @@ pub async fn list_customer_payment_method(
3744
3744
)
3745
3745
. await ?;
3746
3746
3747
+ let is_connector_agnostic_mit_enabled = business_profile
3748
+ . as_ref ( )
3749
+ . and_then ( |business_profile| business_profile. is_connector_agnostic_mit_enabled )
3750
+ . unwrap_or ( false ) ;
3751
+
3747
3752
for pm in resp. into_iter ( ) {
3748
3753
let parent_payment_method_token = generate_id ( consts:: ID_LENGTH , "token" ) ;
3749
3754
@@ -3861,9 +3866,20 @@ pub async fn list_customer_payment_method(
3861
3866
state,
3862
3867
& key_store,
3863
3868
& merchant_account. merchant_id ,
3869
+ is_connector_agnostic_mit_enabled,
3864
3870
connector_mandate_details,
3871
+ pm. network_transaction_id . as_ref ( ) ,
3865
3872
)
3866
3873
. await ?;
3874
+
3875
+ let requires_cvv = if is_connector_agnostic_mit_enabled {
3876
+ requires_cvv
3877
+ && !( off_session_payment_flag
3878
+ && ( pm. connector_mandate_details . is_some ( )
3879
+ || pm. network_transaction_id . is_some ( ) ) )
3880
+ } else {
3881
+ requires_cvv && !( off_session_payment_flag && pm. connector_mandate_details . is_some ( ) )
3882
+ } ;
3867
3883
// Need validation for enabled payment method ,querying MCA
3868
3884
let pma = api:: CustomerPaymentMethod {
3869
3885
payment_token : parent_payment_method_token. to_owned ( ) ,
@@ -3883,8 +3899,7 @@ pub async fn list_customer_payment_method(
3883
3899
bank_transfer : payment_method_retrieval_context. bank_transfer_details ,
3884
3900
bank : bank_details,
3885
3901
surcharge_details : None ,
3886
- requires_cvv : requires_cvv
3887
- && !( off_session_payment_flag && pm. connector_mandate_details . is_some ( ) ) ,
3902
+ requires_cvv,
3888
3903
last_used_at : Some ( pm. last_used_at ) ,
3889
3904
default_payment_method_set : customer. default_payment_method_id . is_some ( )
3890
3905
&& customer. default_payment_method_id == Some ( pm. payment_method_id ) ,
@@ -3982,8 +3997,13 @@ pub async fn get_mca_status(
3982
3997
state : & routes:: SessionState ,
3983
3998
key_store : & domain:: MerchantKeyStore ,
3984
3999
merchant_id : & str ,
4000
+ is_connector_agnostic_mit_enabled : bool ,
3985
4001
connector_mandate_details : Option < storage:: PaymentsMandateReference > ,
4002
+ network_transaction_id : Option < & String > ,
3986
4003
) -> errors:: RouterResult < bool > {
4004
+ if is_connector_agnostic_mit_enabled && network_transaction_id. is_some ( ) {
4005
+ return Ok ( true ) ;
4006
+ }
3987
4007
if let Some ( connector_mandate_details) = connector_mandate_details {
3988
4008
let mcas = state
3989
4009
. store
0 commit comments