stripe/model/
payment_method_card.rs

1use serde::{Serialize, Deserialize};
2///
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct PaymentMethodCard {
5    ///Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
6    pub brand: String,
7    ///Checks on Card address and CVC if provided.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub checks: Option<serde_json::Value>,
10    ///Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub country: Option<String>,
13    ///Two-digit number representing the card's expiration month.
14    pub exp_month: i64,
15    ///Four-digit number representing the card's expiration year.
16    pub exp_year: i64,
17    /**Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
18
19*As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.**/
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub fingerprint: Option<String>,
22    ///Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
23    pub funding: String,
24    ///Details of the original PaymentMethod that created this object.
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub generated_from: Option<serde_json::Value>,
27    ///The last four digits of the card.
28    pub last4: String,
29    ///Contains information about card networks that can be used to process the payment.
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub networks: Option<serde_json::Value>,
32    ///Contains details on how this Card may be used for 3D Secure authentication.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub three_d_secure_usage: Option<serde_json::Value>,
35    ///If this Card is part of a card wallet, this contains the details of the card wallet.
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub wallet: Option<serde_json::Value>,
38}
39impl std::fmt::Display for PaymentMethodCard {
40    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
41        write!(f, "{}", serde_json::to_string(self).unwrap())
42    }
43}