1use crate::{
2 MerchantReference, Money, PaymentProvider, PaymentStatus, ProviderReference, WebhookEventId,
3};
4
5#[derive(Debug, Clone, PartialEq, Eq)]
7pub struct PaymentEvent {
8 pub id: Option<WebhookEventId>,
10 pub provider: PaymentProvider,
12 pub provider_reference: ProviderReference,
14 pub merchant_reference: Option<MerchantReference>,
16 pub status: PaymentStatus,
18 pub amount: Option<Money>,
20 pub event_type: PaymentEventType,
22 pub message: Option<String>,
24}
25
26#[derive(Debug, Clone, Copy, PartialEq, Eq)]
28#[non_exhaustive]
29pub enum PaymentEventType {
30 PaymentCreated,
32 PaymentRequiresAction,
34 PaymentPending,
36 PaymentSucceeded,
38 PaymentFailed,
40 PaymentCancelled,
42 PaymentRefunded,
44 RefundCreated,
46 RefundFailed,
48}