1#[derive(Debug, thiserror::Error)]
3pub enum Error {
4 #[error("stripe config error: {0}")]
6 Config(String),
7
8 #[error("stripe API error: {0}")]
10 Stripe(String),
11
12 #[error("no Stripe Connect account linked to this tenant")]
14 NoConnectAccount,
15
16 #[error("webhook verification failed: {0}")]
18 WebhookVerification(String),
19
20 #[error("stripe event already processed: {0}")]
22 EventAlreadyProcessed(String),
23
24 #[error("idempotency key required: call .idempotency_key() before .create()")]
26 MissingIdempotencyKey,
27
28 #[error("manual capture requires payment mode; use Mode::Payment with manual_capture()")]
31 ManualCaptureRequiresPaymentMode,
32}
33
34impl From<stripe::StripeError> for Error {
35 fn from(e: stripe::StripeError) -> Self {
36 Error::Stripe(e.to_string())
37 }
38}