1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// ======================================
// This file was automatically generated.
// ======================================
use serde_derive::{Deserialize, Serialize};
/// The resource representing a Stripe "payment_method_details_card_present".
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PaymentMethodDetailsCardPresent {
/// The authorized amount.
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_authorized: Option<Box<i64>>,
/// Card brand.
///
/// Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
#[serde(skip_serializing_if = "Option::is_none")]
pub brand: Option<Box<String>>,
/// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format.
///
/// May include alphanumeric characters, special characters and first/last name separator (`/`).
/// In some cases, the cardholder name may not be available depending on how the issuer has configured the card.
/// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.
#[serde(skip_serializing_if = "Option::is_none")]
pub cardholder_name: Option<Box<String>>,
/// 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.
#[serde(skip_serializing_if = "Option::is_none")]
pub country: Option<Box<String>>,
/// Authorization response cryptogram.
#[serde(skip_serializing_if = "Option::is_none")]
pub emv_auth_data: Option<Box<String>>,
/// Two-digit number representing the card's expiration month.
pub exp_month: i64,
/// Four-digit number representing the card's expiration year.
pub exp_year: i64,
/// 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. *Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*.
#[serde(skip_serializing_if = "Option::is_none")]
pub fingerprint: Option<Box<String>>,
/// Card funding type.
///
/// Can be `credit`, `debit`, `prepaid`, or `unknown`.
#[serde(skip_serializing_if = "Option::is_none")]
pub funding: Option<Box<String>>,
/// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions.
///
/// Only present if it was possible to generate a card PaymentMethod.
#[serde(skip_serializing_if = "Option::is_none")]
pub generated_card: Option<Box<String>>,
/// The last four digits of the card.
#[serde(skip_serializing_if = "Option::is_none")]
pub last4: Option<Box<String>>,
/// Identifies which network this charge was processed on.
///
/// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
#[serde(skip_serializing_if = "Option::is_none")]
pub network: Option<Box<String>>,
/// Defines whether the authorized amount can be over-captured or not.
#[serde(skip_serializing_if = "Option::is_none")]
pub overcapture_supported: Option<Box<bool>>,
/// How card details were read in this transaction.
#[serde(skip_serializing_if = "Option::is_none")]
pub read_method: Option<Box<PaymentMethodDetailsCardPresentReadMethod>>,
/// A collection of fields required to be displayed on receipts.
///
/// Only required for EMV transactions.
#[serde(skip_serializing_if = "Option::is_none")]
pub receipt: Option<Box<PaymentMethodDetailsCardPresentReceipt>>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PaymentMethodDetailsCardPresentReceipt {
/// The type of account being debited or credited.
#[serde(skip_serializing_if = "Option::is_none")]
pub account_type: Option<Box<PaymentMethodDetailsCardPresentReceiptAccountType>>,
/// EMV tag 9F26, cryptogram generated by the integrated circuit chip.
#[serde(skip_serializing_if = "Option::is_none")]
pub application_cryptogram: Option<Box<String>>,
/// Mnenomic of the Application Identifier.
#[serde(skip_serializing_if = "Option::is_none")]
pub application_preferred_name: Option<Box<String>>,
/// Identifier for this transaction.
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization_code: Option<Box<String>>,
/// EMV tag 8A.
///
/// A code returned by the card issuer.
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization_response_code: Option<Box<String>>,
/// How the cardholder verified ownership of the card.
#[serde(skip_serializing_if = "Option::is_none")]
pub cardholder_verification_method: Option<Box<String>>,
/// EMV tag 84.
///
/// Similar to the application identifier stored on the integrated circuit chip.
#[serde(skip_serializing_if = "Option::is_none")]
pub dedicated_file_name: Option<Box<String>>,
/// The outcome of a series of EMV functions performed by the card reader.
#[serde(skip_serializing_if = "Option::is_none")]
pub terminal_verification_results: Option<Box<String>>,
/// An indication of various EMV functions performed during the transaction.
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_status_information: Option<Box<String>>,
}
/// An enum representing the possible values of an `PaymentMethodDetailsCardPresent`'s `read_method` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum PaymentMethodDetailsCardPresentReadMethod {
ContactEmv,
ContactlessEmv,
ContactlessMagstripeMode,
MagneticStripeFallback,
MagneticStripeTrack2,
}
impl PaymentMethodDetailsCardPresentReadMethod {
pub fn as_str(self) -> &'static str {
match self {
PaymentMethodDetailsCardPresentReadMethod::ContactEmv => "contact_emv",
PaymentMethodDetailsCardPresentReadMethod::ContactlessEmv => "contactless_emv",
PaymentMethodDetailsCardPresentReadMethod::ContactlessMagstripeMode => {
"contactless_magstripe_mode"
}
PaymentMethodDetailsCardPresentReadMethod::MagneticStripeFallback => {
"magnetic_stripe_fallback"
}
PaymentMethodDetailsCardPresentReadMethod::MagneticStripeTrack2 => {
"magnetic_stripe_track2"
}
}
}
}
impl AsRef<str> for PaymentMethodDetailsCardPresentReadMethod {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl std::fmt::Display for PaymentMethodDetailsCardPresentReadMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
/// An enum representing the possible values of an `PaymentMethodDetailsCardPresentReceipt`'s `account_type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum PaymentMethodDetailsCardPresentReceiptAccountType {
Checking,
Credit,
Prepaid,
Unknown,
}
impl PaymentMethodDetailsCardPresentReceiptAccountType {
pub fn as_str(self) -> &'static str {
match self {
PaymentMethodDetailsCardPresentReceiptAccountType::Checking => "checking",
PaymentMethodDetailsCardPresentReceiptAccountType::Credit => "credit",
PaymentMethodDetailsCardPresentReceiptAccountType::Prepaid => "prepaid",
PaymentMethodDetailsCardPresentReceiptAccountType::Unknown => "unknown",
}
}
}
impl AsRef<str> for PaymentMethodDetailsCardPresentReceiptAccountType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl std::fmt::Display for PaymentMethodDetailsCardPresentReceiptAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}