11use api_models:: payment_methods:: {
2- CustomerPaymentMethodsListResponse as ListCustomerPaymentMethodsV1Response ,
32 CustomerPaymentMethod ,
3+ CustomerPaymentMethodsListResponse as ListCustomerPaymentMethodsV1Response ,
44} ;
55use common_utils:: { id_type, request:: Method } ;
66use hyperswitch_interfaces:: micro_service:: { MicroserviceClientError , MicroserviceClientErrorKind } ;
7- use crate :: types:: { ModularListCustomerPaymentMethodsRequest , ModularListCustomerPaymentMethodsResponse , PaymentMethodResponseData } ;
7+
8+ use crate :: types:: {
9+ ModularListCustomerPaymentMethodsRequest , ModularListCustomerPaymentMethodsResponse ,
10+ PaymentMethodResponseData ,
11+ } ;
812
913/// V1-facing retrieve flow type.
1014#[ derive( Debug ) ]
@@ -28,15 +32,16 @@ impl TryFrom<&ListCustomerPaymentMethodsV1Request> for ModularListCustomerPaymen
2832impl TryFrom < ModularListCustomerPaymentMethodsResponse > for ListCustomerPaymentMethodsV1Response {
2933 type Error = MicroserviceClientError ;
3034
31- fn try_from ( v2_response : ModularListCustomerPaymentMethodsResponse ) -> Result < Self , Self :: Error > {
35+ fn try_from (
36+ v2_response : ModularListCustomerPaymentMethodsResponse ,
37+ ) -> Result < Self , Self :: Error > {
3238 let customer_payment_methods = v2_response
3339 . customer_payment_methods
3440 . into_iter ( )
3541 . map ( |pm| CustomerPaymentMethod {
3642 payment_token : pm. id . clone ( ) ,
3743 payment_method_id : pm. id ,
38- customer_id : pm
39- . customer_id ,
44+ customer_id : pm. customer_id ,
4045 payment_method : pm. payment_method_type ,
4146 payment_method_type : Some ( pm. payment_method_subtype ) ,
4247 payment_method_issuer : None ,
0 commit comments