mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(router): add payment incoming webhooks support for v2 (#6551)
Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in>
This commit is contained in:
committed by
GitHub
parent
65bf75a75e
commit
8e9c3ec893
@ -60,10 +60,16 @@ pub enum ApiEventsType {
|
||||
PaymentMethodList {
|
||||
payment_id: Option<String>,
|
||||
},
|
||||
#[cfg(feature = "v1")]
|
||||
Webhooks {
|
||||
connector: String,
|
||||
payment_id: Option<id_type::PaymentId>,
|
||||
},
|
||||
#[cfg(feature = "v2")]
|
||||
Webhooks {
|
||||
connector: id_type::MerchantConnectorAccountId,
|
||||
payment_id: Option<id_type::GlobalPaymentId>,
|
||||
},
|
||||
Routing,
|
||||
ResourceListAPI,
|
||||
#[cfg(feature = "v1")]
|
||||
|
||||
@ -66,3 +66,16 @@ impl GlobalAttemptId {
|
||||
self.0.get_string_repr()
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<std::borrow::Cow<'static, str>> for GlobalAttemptId {
|
||||
type Error = error_stack::Report<errors::ValidationError>;
|
||||
fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> {
|
||||
use error_stack::ResultExt;
|
||||
let global_attempt_id = super::GlobalId::from_string(value).change_context(
|
||||
errors::ValidationError::IncorrectValueProvided {
|
||||
field_name: "payment_id",
|
||||
},
|
||||
)?;
|
||||
Ok(Self(global_attempt_id))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user