Skip to main content

stripe_pay_core/id/
enum.rs

1/// The resource family a `StripeId` addresses.
2///
3/// Stripe encodes the resource family into the identifier prefix, so
4/// `pi_3Abc...` is a PaymentIntent and `cus_9Xyz...` is a Customer.
5/// Keeping the family alongside the raw value lets the compiler reject
6/// passing a Charge identifier where a PaymentIntent is required.
7#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, serde::Serialize)]
8pub enum StripeIdKind {
9    /// A Checkout Session.
10    CheckoutSession,
11    /// A Charge created by a PaymentIntent.
12    Charge,
13    /// A Customer.
14    Customer,
15    /// A PaymentIntent.
16    PaymentIntent,
17    /// A PaymentMethod.
18    PaymentMethod,
19    /// A Refund.
20    Refund,
21    /// A webhook Event.
22    Event,
23}