use renox::prelude::*;
use crate::{BillingPayment, Owner, Subscription, SubscriptionStatus};
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct SubscriptionCreated {
pub subscription: Subscription,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct SubscriptionUpdated {
pub subscription: Subscription,
pub previous_plan: String,
pub previous_status: SubscriptionStatus,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct SubscriptionCanceled {
pub subscription: Subscription,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct SubscriptionPaused {
pub subscription: Subscription,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct SubscriptionUnpaused {
pub subscription: Subscription,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct PaymentSucceeded {
pub gateway: String,
pub payment_id: String,
pub amount: i64,
pub currency: String,
pub owner: Option<Owner>,
pub subscription: Option<Subscription>,
pub reference_type: Option<String>,
pub reference_id: Option<String>,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct PaymentFailed {
pub gateway: String,
pub payment_id: String,
pub amount: i64,
pub currency: String,
pub owner: Option<Owner>,
pub subscription: Option<Subscription>,
pub reference_type: Option<String>,
pub reference_id: Option<String>,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct PaymentRefunded {
pub payment: BillingPayment,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct RefundSucceeded {
pub payment: BillingPayment,
pub amount: i64,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct RefundFailed {
pub payment: BillingPayment,
pub amount: i64,
pub reason: Option<String>,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct DisputeOpened {
pub payment: BillingPayment,
pub evidence_due_by: Option<DateTime>,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct DisputeWon {
pub payment: BillingPayment,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct DisputeLost {
pub payment: BillingPayment,
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct PaymentLinkExpired {
pub payment: BillingPayment,
}
impl Event for SubscriptionCreated {}
impl Event for SubscriptionUpdated {}
impl Event for SubscriptionCanceled {}
impl Event for SubscriptionPaused {}
impl Event for SubscriptionUnpaused {}
impl Event for PaymentSucceeded {}
impl Event for PaymentFailed {}
impl Event for PaymentRefunded {}
impl Event for RefundSucceeded {}
impl Event for RefundFailed {}
impl Event for DisputeOpened {}
impl Event for DisputeWon {}
impl Event for DisputeLost {}
impl Event for PaymentLinkExpired {}