mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat(payment_methods): Add default payment method column in customers table and last used column in payment_methods table (#3790)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -2,7 +2,8 @@ use common_utils::events::{ApiEventMetric, ApiEventsType}; | ||||
|  | ||||
| use crate::{ | ||||
|     payment_methods::{ | ||||
|         CustomerPaymentMethodsListResponse, PaymentMethodDeleteResponse, PaymentMethodListRequest, | ||||
|         CustomerDefaultPaymentMethodResponse, CustomerPaymentMethodsListResponse, | ||||
|         DefaultPaymentMethod, PaymentMethodDeleteResponse, PaymentMethodListRequest, | ||||
|         PaymentMethodListResponse, PaymentMethodResponse, PaymentMethodUpdate, | ||||
|     }, | ||||
|     payments::{ | ||||
| @ -95,6 +96,16 @@ impl ApiEventMetric for PaymentMethodResponse { | ||||
|  | ||||
| impl ApiEventMetric for PaymentMethodUpdate {} | ||||
|  | ||||
| impl ApiEventMetric for DefaultPaymentMethod { | ||||
|     fn get_api_event_type(&self) -> Option<ApiEventsType> { | ||||
|         Some(ApiEventsType::PaymentMethod { | ||||
|             payment_method_id: self.payment_method_id.clone(), | ||||
|             payment_method: None, | ||||
|             payment_method_type: None, | ||||
|         }) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl ApiEventMetric for PaymentMethodDeleteResponse { | ||||
|     fn get_api_event_type(&self) -> Option<ApiEventsType> { | ||||
|         Some(ApiEventsType::PaymentMethod { | ||||
| @ -121,6 +132,16 @@ impl ApiEventMetric for PaymentMethodListRequest { | ||||
|  | ||||
| impl ApiEventMetric for PaymentMethodListResponse {} | ||||
|  | ||||
| impl ApiEventMetric for CustomerDefaultPaymentMethodResponse { | ||||
|     fn get_api_event_type(&self) -> Option<ApiEventsType> { | ||||
|         Some(ApiEventsType::PaymentMethod { | ||||
|             payment_method_id: self.default_payment_method_id.clone().unwrap_or_default(), | ||||
|             payment_method: Some(self.payment_method), | ||||
|             payment_method_type: self.payment_method_type, | ||||
|         }) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl ApiEventMetric for PaymentListFilterConstraints { | ||||
|     fn get_api_event_type(&self) -> Option<ApiEventsType> { | ||||
|         Some(ApiEventsType::ResourceListAPI) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Amisha Prabhat
					Amisha Prabhat