feat(router): add payment failed webhook event (#305)

This commit is contained in:
ItsMeShashank
2023-01-06 14:02:39 +05:30
committed by GitHub
parent 2f65459d9e
commit f2b88350a6
4 changed files with 8 additions and 4 deletions

View File

@ -7,6 +7,7 @@ use crate::{enums as api_enums, payments};
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum IncomingWebhookEvent {
PaymentIntentFailure,
PaymentIntentSuccess,
}
@ -19,6 +20,7 @@ pub enum WebhookFlow {
impl From<IncomingWebhookEvent> for WebhookFlow {
fn from(evt: IncomingWebhookEvent) -> Self {
match evt {
IncomingWebhookEvent::PaymentIntentFailure => Self::Payment,
IncomingWebhookEvent::PaymentIntentSuccess => Self::Payment,
}
}