mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(core): add new payments webhook events (#3212)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: hrithikeshvm <vmhrithikesh@gmail.com>
This commit is contained in:
@ -8,11 +8,18 @@ use crate::{disputes, enums as api_enums, mandates, payments, refunds};
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Copy)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum IncomingWebhookEvent {
|
||||
/// Authorization + Capture success
|
||||
PaymentIntentFailure,
|
||||
/// Authorization + Capture failure
|
||||
PaymentIntentSuccess,
|
||||
PaymentIntentProcessing,
|
||||
PaymentIntentPartiallyFunded,
|
||||
PaymentIntentCancelled,
|
||||
PaymentIntentCancelFailure,
|
||||
PaymentIntentAuthorizationSuccess,
|
||||
PaymentIntentAuthorizationFailure,
|
||||
PaymentIntentCaptureSuccess,
|
||||
PaymentIntentCaptureFailure,
|
||||
PaymentActionRequired,
|
||||
EventNotSupported,
|
||||
SourceChargeable,
|
||||
@ -86,7 +93,12 @@ impl From<IncomingWebhookEvent> for WebhookFlow {
|
||||
| IncomingWebhookEvent::PaymentIntentProcessing
|
||||
| IncomingWebhookEvent::PaymentActionRequired
|
||||
| IncomingWebhookEvent::PaymentIntentPartiallyFunded
|
||||
| IncomingWebhookEvent::PaymentIntentCancelled => Self::Payment,
|
||||
| IncomingWebhookEvent::PaymentIntentCancelled
|
||||
| IncomingWebhookEvent::PaymentIntentCancelFailure
|
||||
| IncomingWebhookEvent::PaymentIntentAuthorizationSuccess
|
||||
| IncomingWebhookEvent::PaymentIntentAuthorizationFailure
|
||||
| IncomingWebhookEvent::PaymentIntentCaptureSuccess
|
||||
| IncomingWebhookEvent::PaymentIntentCaptureFailure => Self::Payment,
|
||||
IncomingWebhookEvent::EventNotSupported => Self::ReturnResponse,
|
||||
IncomingWebhookEvent::RefundSuccess | IncomingWebhookEvent::RefundFailure => {
|
||||
Self::Refund
|
||||
|
||||
Reference in New Issue
Block a user