mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +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,
|
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 {
|
impl From<IncomingWebhookEvent> for WebhookFlow {
|
||||||
fn from(evt: IncomingWebhookEvent) -> Self {
|
fn from(evt: IncomingWebhookEvent) -> Self {
|
||||||
match evt {
|
match evt {
|
||||||
|
|||||||
Reference in New Issue
Block a user