mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
refactor(payment_id): add payment id domain type (#5738)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -16,10 +16,10 @@ pub enum ApiEventsType {
|
||||
payout_id: String,
|
||||
},
|
||||
Payment {
|
||||
payment_id: String,
|
||||
payment_id: id_type::PaymentId,
|
||||
},
|
||||
Refund {
|
||||
payment_id: Option<String>,
|
||||
payment_id: Option<id_type::PaymentId>,
|
||||
refund_id: String,
|
||||
},
|
||||
PaymentMethod {
|
||||
@ -46,13 +46,13 @@ pub enum ApiEventsType {
|
||||
},
|
||||
Webhooks {
|
||||
connector: String,
|
||||
payment_id: Option<String>,
|
||||
payment_id: Option<id_type::PaymentId>,
|
||||
},
|
||||
Routing,
|
||||
ResourceListAPI,
|
||||
PaymentRedirectionResponse {
|
||||
connector: Option<String>,
|
||||
payment_id: Option<String>,
|
||||
payment_id: Option<id_type::PaymentId>,
|
||||
},
|
||||
Gsm,
|
||||
// TODO: This has to be removed once the corresponding apiEventTypes are created
|
||||
@ -80,6 +80,14 @@ pub enum ApiEventsType {
|
||||
impl ApiEventMetric for serde_json::Value {}
|
||||
impl ApiEventMetric for () {}
|
||||
|
||||
impl ApiEventMetric for id_type::PaymentId {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<Q: ApiEventMetric, E> ApiEventMetric for Result<Q, E> {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user