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 currency amount stored in Stripe's smallest denomination.
///
/// Stripe never transmits a floating point amount, so `Money` keeps an
/// integer minor-unit count plus the currency that determines how the
/// value converts back to a major-unit decimal. Two USD is `200`
/// minor units; two JPY is `2`, because JPY has no minor unit.
///
/// Accessors are generated by `#[derive(Getter)]`. Both fields are
/// public because callers persist the raw minor-unit count straight
/// into Stripe's `amount` parameter; `currency_code` pairs the two when
/// a human-readable form is needed.
#[derive(Clone, Copy, Debug, Eq, Getter, Hash, Ord, PartialEq, PartialOrd, serde::Serialize)]
pub struct Money {
    /// Amount in the currency's smallest denomination.
    #[get(type(copy))]
    pub(super) amount: i64,
    /// The currency the amount is denominated in.
    #[get(type(copy))]
    pub(super) currency: Currency,
}