mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
refactor(customers_v2): include minor fixes for customer v2 flows (#6876)
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
|
||||
use crate::customers::{CustomerDeleteResponse, CustomerRequest, CustomerResponse};
|
||||
use crate::customers::{
|
||||
CustomerDeleteResponse, CustomerRequest, CustomerResponse, CustomerUpdateRequestInternal,
|
||||
};
|
||||
|
||||
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
|
||||
impl ApiEventMetric for CustomerDeleteResponse {
|
||||
@ -55,7 +57,7 @@ impl ApiEventMetric for CustomerResponse {
|
||||
}
|
||||
|
||||
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
|
||||
impl ApiEventMetric for crate::customers::CustomerUpdateRequestInternal {
|
||||
impl ApiEventMetric for CustomerUpdateRequestInternal {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Customer {
|
||||
customer_id: self.customer_id.clone(),
|
||||
@ -64,7 +66,7 @@ impl ApiEventMetric for crate::customers::CustomerUpdateRequestInternal {
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "customer_v2"))]
|
||||
impl ApiEventMetric for crate::customers::CustomerUpdateRequestInternal {
|
||||
impl ApiEventMetric for CustomerUpdateRequestInternal {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Customer {
|
||||
customer_id: Some(self.id.clone()),
|
||||
|
||||
@ -4803,6 +4803,15 @@ pub struct PaymentsConfirmIntentResponse {
|
||||
/// Amount related information for this payment and attempt
|
||||
pub amount: ConfirmIntentAmountDetailsResponse,
|
||||
|
||||
/// The identifier for the customer
|
||||
#[schema(
|
||||
min_length = 32,
|
||||
max_length = 64,
|
||||
example = "12345_cus_01926c58bc6e77c09e809964e72af8c8",
|
||||
value_type = String
|
||||
)]
|
||||
pub customer_id: Option<id_type::GlobalCustomerId>,
|
||||
|
||||
/// The connector used for the payment
|
||||
#[schema(example = "stripe")]
|
||||
pub connector: String,
|
||||
@ -4872,6 +4881,15 @@ pub struct PaymentsRetrieveResponse {
|
||||
/// Amount related information for this payment and attempt
|
||||
pub amount: ConfirmIntentAmountDetailsResponse,
|
||||
|
||||
/// The identifier for the customer
|
||||
#[schema(
|
||||
min_length = 32,
|
||||
max_length = 64,
|
||||
example = "12345_cus_01926c58bc6e77c09e809964e72af8c8",
|
||||
value_type = String
|
||||
)]
|
||||
pub customer_id: Option<id_type::GlobalCustomerId>,
|
||||
|
||||
/// The connector used for the payment
|
||||
#[schema(example = "stripe")]
|
||||
pub connector: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user