pub struct Event {
pub amount: i64,
pub order_id: String,
pub project: String,
pub status: TransactionStatus,
pub payment_method: PaymentMethod,
pub completed_at: String,
pub is_sandbox: bool,
}Expand description
Decoded webhook event.
Shape matches the JSON body Pakasir sends; field order in this struct is purely cosmetic.
Fields§
§amount: i64Transaction amount.
order_id: StringOrder identifier.
project: StringProject slug the transaction belongs to.
status: TransactionStatusLifecycle status at the moment the webhook fired.
payment_method: PaymentMethodPayment method used for the transaction.
completed_at: StringRFC 3339 completion timestamp.
is_sandbox: booltrue when this event came from a sandbox project.
Not part of the public Pakasir webhook contract — the upstream
payload documented at https://pakasir.com/p/docs does not include
this field. Defaults to false when the JSON body omits it so
production webhooks continue to deserialize cleanly.
Implementations§
Source§impl Event
impl Event
Sourcepub fn parse_time(&self) -> Result<DateTime<FixedOffset>, ParseError>
pub fn parse_time(&self) -> Result<DateTime<FixedOffset>, ParseError>
Parse Event::completed_at into a DateTime.
Sourcepub fn validate(&self) -> Result<(), WebhookError>
pub fn validate(&self) -> Result<(), WebhookError>
Sanity-check the fields most handlers rely on.
Returns WebhookError::InvalidOrderId for an empty order_id and
WebhookError::InvalidAmount for a non-positive amount. Other
fields are not inspected.