stripe/model/issuing_card.rs
1use serde::{Serialize, Deserialize};
2use super::{IssuingCardAuthorizationControls, IssuingCardholder};
3///You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders.
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct IssuingCard {
6 ///The brand of the card.
7 pub brand: String,
8 ///The reason why the card was canceled.
9 #[serde(skip_serializing_if = "Option::is_none")]
10 pub cancellation_reason: Option<String>,
11 /**An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards.
12
13Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder)*/
14 pub cardholder: IssuingCardholder,
15 ///Time at which the object was created. Measured in seconds since the Unix epoch.
16 pub created: i64,
17 ///Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK.
18 pub currency: String,
19 ///The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint.
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub cvc: Option<String>,
22 ///The expiration month of the card.
23 pub exp_month: i64,
24 ///The expiration year of the card.
25 pub exp_year: i64,
26 ///The financial account this card is attached to.
27 #[serde(skip_serializing_if = "Option::is_none")]
28 pub financial_account: Option<String>,
29 ///Unique identifier for the object.
30 pub id: String,
31 ///The last 4 digits of the card number.
32 pub last4: String,
33 ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
34 pub livemode: bool,
35 ///Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
36 pub metadata: serde_json::Value,
37 ///The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint.
38 #[serde(skip_serializing_if = "Option::is_none")]
39 pub number: Option<String>,
40 ///String representing the object's type. Objects of the same type share the same value.
41 pub object: String,
42 ///The latest card that replaces this card, if any.
43 #[serde(skip_serializing_if = "Option::is_none")]
44 pub replaced_by: Option<serde_json::Value>,
45 ///The card this card replaces, if any.
46 #[serde(skip_serializing_if = "Option::is_none")]
47 pub replacement_for: Option<serde_json::Value>,
48 ///The reason why the previous card needed to be replaced.
49 #[serde(skip_serializing_if = "Option::is_none")]
50 pub replacement_reason: Option<String>,
51 ///Where and how the card will be shipped.
52 #[serde(skip_serializing_if = "Option::is_none")]
53 pub shipping: Option<serde_json::Value>,
54 ///
55 pub spending_controls: IssuingCardAuthorizationControls,
56 ///Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`.
57 pub status: String,
58 ///The type of the card.
59 #[serde(rename = "type")]
60 pub type_: String,
61 ///Information relating to digital wallets (like Apple Pay and Google Pay).
62 #[serde(skip_serializing_if = "Option::is_none")]
63 pub wallets: Option<serde_json::Value>,
64}
65impl std::fmt::Display for IssuingCard {
66 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
67 write!(f, "{}", serde_json::to_string(self).unwrap())
68 }
69}