@@ -224,7 +224,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
224
224
let webhook_url = Some ( helpers:: create_webhook_url (
225
225
router_base_url,
226
226
& attempt. merchant_id ,
227
- & merchant_connector_account. get_id ( ) . get_string_repr ( ) . to_string ( ) ,
227
+ merchant_connector_account. get_id ( ) . get_string_repr ( ) ,
228
228
) ) ;
229
229
230
230
let router_return_url = payment_data
@@ -2745,17 +2745,17 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
2745
2745
attempt,
2746
2746
connector_name,
2747
2747
) ) ;
2748
- let merchant_connector_account_id = payment_data
2748
+ let merchant_connector_account_id_or_connector_name = payment_data
2749
2749
. payment_attempt
2750
- . clone ( )
2751
2750
. merchant_connector_id
2752
- . map ( |mca_id| mca_id. get_string_repr ( ) . to_string ( ) )
2753
- . unwrap_or ( connector_name. to_string ( ) ) ;
2751
+ . as_ref ( )
2752
+ . map ( |mca_id| mca_id. get_string_repr ( ) )
2753
+ . unwrap_or ( connector_name) ;
2754
2754
2755
2755
let webhook_url = Some ( helpers:: create_webhook_url (
2756
2756
router_base_url,
2757
2757
& attempt. merchant_id ,
2758
- & merchant_connector_account_id ,
2758
+ merchant_connector_account_id_or_connector_name ,
2759
2759
) ) ;
2760
2760
let router_return_url = Some ( helpers:: create_redirect_url (
2761
2761
router_base_url,
@@ -3575,17 +3575,16 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SetupMandateRequ
3575
3575
. map ( |customer| customer. clone ( ) . into_inner ( ) )
3576
3576
} ) ;
3577
3577
let amount = payment_data. payment_attempt . get_total_amount ( ) ;
3578
- let merchant_connector_account_id = payment_data
3578
+ let merchant_connector_account_id_or_connector_name = payment_data
3579
3579
. payment_attempt
3580
3580
. merchant_connector_id
3581
- . clone ( )
3582
- . get_required_value ( "merchant_connector_id" )
3583
- . change_context ( errors:: ApiErrorResponse :: InternalServerError )
3584
- . attach_printable ( "Merchant connector id is not present in payment_attempt" ) ?;
3581
+ . as_ref ( )
3582
+ . map ( |mca_id| mca_id. get_string_repr ( ) )
3583
+ . unwrap_or ( connector_name) ;
3585
3584
let webhook_url = Some ( helpers:: create_webhook_url (
3586
3585
router_base_url,
3587
3586
& attempt. merchant_id ,
3588
- & merchant_connector_account_id . get_string_repr ( ) . to_string ( ) ,
3587
+ merchant_connector_account_id_or_connector_name ,
3589
3588
) ) ;
3590
3589
3591
3590
Ok ( Self {
@@ -3784,17 +3783,16 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsPreProce
3784
3783
. collect :: < Result < Vec < _ > , _ > > ( )
3785
3784
} )
3786
3785
. transpose ( ) ?;
3787
- let merchant_connector_account_id = payment_data
3786
+ let merchant_connector_account_id_or_connector_name = payment_data
3788
3787
. payment_attempt
3789
3788
. merchant_connector_id
3790
- . clone ( )
3791
- . get_required_value ( "merchant_connector_id" )
3792
- . change_context ( errors:: ApiErrorResponse :: InternalServerError )
3793
- . attach_printable ( "Merchant connector id is not present in payment_attempt" ) ?;
3789
+ . as_ref ( )
3790
+ . map ( |mca_id| mca_id. get_string_repr ( ) )
3791
+ . unwrap_or ( connector_name) ;
3794
3792
let webhook_url = Some ( helpers:: create_webhook_url (
3795
3793
router_base_url,
3796
3794
& attempt. merchant_id ,
3797
- & merchant_connector_account_id . get_string_repr ( ) . to_string ( ) ,
3795
+ merchant_connector_account_id_or_connector_name ,
3798
3796
) ) ;
3799
3797
let router_return_url = Some ( helpers:: create_redirect_url (
3800
3798
router_base_url,
0 commit comments