mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
refactor(webhook): add a function to retrieve payment_id (#2447)
Co-authored-by: Abhishek Marrivagu <68317979+Abhicodes-crypto@users.noreply.github.com>
This commit is contained in:
@ -59,6 +59,17 @@ pub enum WebhookResponseTracker {
|
||||
NoEffect,
|
||||
}
|
||||
|
||||
impl WebhookResponseTracker {
|
||||
pub fn get_payment_id(&self) -> Option<String> {
|
||||
match self {
|
||||
Self::Payment { payment_id, .. }
|
||||
| Self::Refund { payment_id, .. }
|
||||
| Self::Dispute { payment_id, .. } => Some(payment_id.to_string()),
|
||||
Self::NoEffect => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<IncomingWebhookEvent> for WebhookFlow {
|
||||
fn from(evt: IncomingWebhookEvent) -> Self {
|
||||
match evt {
|
||||
|
||||
Reference in New Issue
Block a user