Skip to main content

stripe_pay_core/charge/
struct.rs

1use super::*;
2
3/// A Charge as returned by Stripe's REST API.
4///
5/// A charge is the moment money actually moves or is reserved. It is
6/// created by a PaymentIntent rather than requested directly, so its
7/// identifier is what a refund references.
8#[derive(Clone, Debug, Eq, Getter, PartialEq, serde::Deserialize, serde::Serialize)]
9pub struct Charge {
10    /// Stripe's identifier for this charge.
11    pub(super) id: String,
12    /// The amount captured, in minor units.
13    #[get(skip)]
14    pub(super) amount: i64,
15    /// The ISO 4217 code the amount is denominated in.
16    #[get(skip)]
17    pub(super) currency: String,
18    /// Whether the charge moved money.
19    #[get(type(copy))]
20    pub(super) status: ChargeStatus,
21    /// How the customer paid.
22    #[get(type(copy))]
23    pub(super) payment_method_kind: PaymentMethodKind,
24    /// Whether Stripe considers the charge under dispute.
25    #[get(type(copy))]
26    pub(super) disputed: bool,
27    /// The PaymentIntent that created this charge.
28    #[get(type(clone))]
29    pub(super) payment_intent: Option<String>,
30}