stripe-pay-core 10.2.3

Shared Stripe domain types for the Stripe payment SDK: money, identifiers, payment intents, charges, refunds, and form encoding.
Documentation
use super::*;

/// A PaymentIntent as returned by Stripe's REST API.
///
/// A PaymentIntent tracks one customer payment attempt from creation
/// through authentication to capture. The `next_action` field tells the
/// browser what it still owes the user, and `latest_charge` links to
/// the Charge Stripe created once the payment settled.
///
/// Read accessors are generated by `#[derive(Getter)]`. Only the fields
/// a caller acts on are marked; `amount` and `currency` are deliberately
/// unmarked because the pair is only meaningful together, so
/// `get_amount` pairs them into a `Money` by hand instead of exposing
/// two independently readable halves.
#[derive(Clone, Debug, Eq, Getter, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct PaymentIntent {
    /// Stripe's identifier for this intent.
    pub(super) id: String,
    /// The amount Stripe will capture, in minor units.
    #[get(skip)]
    pub(super) amount: i64,
    /// The ISO 4217 code the amount is denominated in.
    #[get(skip)]
    pub(super) currency: String,
    /// Where the intent sits in its lifecycle.
    #[get(type(copy))]
    pub(super) status: PaymentIntentStatus,
    /// What the customer must still do, if anything.
    #[get(type(copy))]
    pub(super) next_action: PaymentIntentNextAction,
    /// The charge created when the payment settled, when there is one.
    #[get(type(clone))]
    pub(super) latest_charge: Option<String>,
    /// The customer this intent charges, when one was supplied.
    #[get(type(clone))]
    pub(super) customer: Option<String>,
}