• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-go / 11295426688

11 Oct 2024 03:52PM UTC coverage: 62.991% (-0.02%) from 63.015%
11295426688

Pull #1934

github

stripe-openapi[bot]
Merge upstream and update generated code for v1290
Pull Request #1934: Update generated code for beta

0 of 8 new or added lines in 2 files covered. (0.0%)

472 existing lines in 21 files now uncovered.

6209 of 9857 relevant lines covered (62.99%)

15.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/paymentmethod.go
1
//
2
//
3
// File generated from our OpenAPI spec
4
//
5
//
6

7
package stripe
8

9
import "encoding/json"
10

11
// This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
12
type PaymentMethodAllowRedisplay string
13

14
// List of values that PaymentMethodAllowRedisplay can take
15
const (
16
        PaymentMethodAllowRedisplayAlways      PaymentMethodAllowRedisplay = "always"
17
        PaymentMethodAllowRedisplayLimited     PaymentMethodAllowRedisplay = "limited"
18
        PaymentMethodAllowRedisplayUnspecified PaymentMethodAllowRedisplay = "unspecified"
19
)
20

21
// Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
22
type PaymentMethodCardBrand string
23

24
// List of values that PaymentMethodCardBrand can take
25
const (
26
        PaymentMethodCardBrandAmex       PaymentMethodCardBrand = "amex"
27
        PaymentMethodCardBrandDiners     PaymentMethodCardBrand = "diners"
28
        PaymentMethodCardBrandDiscover   PaymentMethodCardBrand = "discover"
29
        PaymentMethodCardBrandJCB        PaymentMethodCardBrand = "jcb"
30
        PaymentMethodCardBrandMastercard PaymentMethodCardBrand = "mastercard"
31
        PaymentMethodCardBrandUnionpay   PaymentMethodCardBrand = "unionpay"
32
        PaymentMethodCardBrandUnknown    PaymentMethodCardBrand = "unknown"
33
        PaymentMethodCardBrandVisa       PaymentMethodCardBrand = "visa"
34
)
35

36
// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
37
type PaymentMethodCardChecksAddressLine1Check string
38

39
// List of values that PaymentMethodCardChecksAddressLine1Check can take
40
const (
41
        PaymentMethodCardChecksAddressLine1CheckFail        PaymentMethodCardChecksAddressLine1Check = "fail"
42
        PaymentMethodCardChecksAddressLine1CheckPass        PaymentMethodCardChecksAddressLine1Check = "pass"
43
        PaymentMethodCardChecksAddressLine1CheckUnavailable PaymentMethodCardChecksAddressLine1Check = "unavailable"
44
        PaymentMethodCardChecksAddressLine1CheckUnchecked   PaymentMethodCardChecksAddressLine1Check = "unchecked"
45
)
46

47
// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
48
type PaymentMethodCardChecksAddressPostalCodeCheck string
49

50
// List of values that PaymentMethodCardChecksAddressPostalCodeCheck can take
51
const (
52
        PaymentMethodCardChecksAddressPostalCodeCheckFail        PaymentMethodCardChecksAddressPostalCodeCheck = "fail"
53
        PaymentMethodCardChecksAddressPostalCodeCheckPass        PaymentMethodCardChecksAddressPostalCodeCheck = "pass"
54
        PaymentMethodCardChecksAddressPostalCodeCheckUnavailable PaymentMethodCardChecksAddressPostalCodeCheck = "unavailable"
55
        PaymentMethodCardChecksAddressPostalCodeCheckUnchecked   PaymentMethodCardChecksAddressPostalCodeCheck = "unchecked"
56
)
57

58
// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
59
type PaymentMethodCardChecksCVCCheck string
60

61
// List of values that PaymentMethodCardChecksCVCCheck can take
62
const (
63
        PaymentMethodCardChecksCVCCheckFail        PaymentMethodCardChecksCVCCheck = "fail"
64
        PaymentMethodCardChecksCVCCheckPass        PaymentMethodCardChecksCVCCheck = "pass"
65
        PaymentMethodCardChecksCVCCheckUnavailable PaymentMethodCardChecksCVCCheck = "unavailable"
66
        PaymentMethodCardChecksCVCCheckUnchecked   PaymentMethodCardChecksCVCCheck = "unchecked"
67
)
68

69
// The method used to process this payment method offline. Only deferred is allowed.
70
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentOfflineType string
71

72
// List of values that PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentOfflineType can take
73
const (
74
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentOfflineTypeDeferred PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentOfflineType = "deferred"
75
)
76

77
// How card details were read in this transaction.
78
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod string
79

80
// List of values that PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod can take
81
const (
82
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethodContactEmv               PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod = "contact_emv"
83
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethodContactlessEmv           PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod = "contactless_emv"
84
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethodContactlessMagstripeMode PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod = "contactless_magstripe_mode"
85
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethodMagneticStripeFallback   PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod = "magnetic_stripe_fallback"
86
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethodMagneticStripeTrack2     PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod = "magnetic_stripe_track2"
87
)
88

89
// The type of account being debited or credited
90
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountType string
91

92
// List of values that PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountType can take
93
const (
94
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountTypeChecking PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountType = "checking"
95
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountTypeCredit   PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountType = "credit"
96
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountTypePrepaid  PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountType = "prepaid"
97
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountTypeUnknown  PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountType = "unknown"
98
)
99

100
// The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`.
101
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletType string
102

103
// List of values that PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletType can take
104
const (
105
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletTypeApplePay   PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletType = "apple_pay"
106
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletTypeGooglePay  PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletType = "google_pay"
107
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletTypeSamsungPay PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletType = "samsung_pay"
108
        PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletTypeUnknown    PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletType = "unknown"
109
)
110

111
// All available networks for the card.
112
type PaymentMethodCardNetworksAvailable string
113

114
// List of values that PaymentMethodCardNetworksAvailable can take
115
const (
116
        PaymentMethodCardNetworksAvailableAmex            PaymentMethodCardNetworksAvailable = "amex"
117
        PaymentMethodCardNetworksAvailableCartesBancaires PaymentMethodCardNetworksAvailable = "cartes_bancaires"
118
        PaymentMethodCardNetworksAvailableDiners          PaymentMethodCardNetworksAvailable = "diners"
119
        PaymentMethodCardNetworksAvailableDiscover        PaymentMethodCardNetworksAvailable = "discover"
120
        PaymentMethodCardNetworksAvailableInterac         PaymentMethodCardNetworksAvailable = "interac"
121
        PaymentMethodCardNetworksAvailableJCB             PaymentMethodCardNetworksAvailable = "jcb"
122
        PaymentMethodCardNetworksAvailableMastercard      PaymentMethodCardNetworksAvailable = "mastercard"
123
        PaymentMethodCardNetworksAvailableUnionpay        PaymentMethodCardNetworksAvailable = "unionpay"
124
        PaymentMethodCardNetworksAvailableVisa            PaymentMethodCardNetworksAvailable = "visa"
125
        PaymentMethodCardNetworksAvailableUnknown         PaymentMethodCardNetworksAvailable = "unknown"
126
)
127

128
// The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card.
129
type PaymentMethodCardNetworksPreferred string
130

131
// List of values that PaymentMethodCardNetworksPreferred can take
132
const (
133
        PaymentMethodCardNetworksPreferredAmex            PaymentMethodCardNetworksPreferred = "amex"
134
        PaymentMethodCardNetworksPreferredCartesBancaires PaymentMethodCardNetworksPreferred = "cartes_bancaires"
135
        PaymentMethodCardNetworksPreferredDiners          PaymentMethodCardNetworksPreferred = "diners"
136
        PaymentMethodCardNetworksPreferredDiscover        PaymentMethodCardNetworksPreferred = "discover"
137
        PaymentMethodCardNetworksPreferredInterac         PaymentMethodCardNetworksPreferred = "interac"
138
        PaymentMethodCardNetworksPreferredJCB             PaymentMethodCardNetworksPreferred = "jcb"
139
        PaymentMethodCardNetworksPreferredMastercard      PaymentMethodCardNetworksPreferred = "mastercard"
140
        PaymentMethodCardNetworksPreferredUnionpay        PaymentMethodCardNetworksPreferred = "unionpay"
141
        PaymentMethodCardNetworksPreferredVisa            PaymentMethodCardNetworksPreferred = "visa"
142
        PaymentMethodCardNetworksPreferredUnknown         PaymentMethodCardNetworksPreferred = "unknown"
143
)
144

145
// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.
146
type PaymentMethodCardWalletType string
147

148
// List of values that PaymentMethodCardWalletType can take
149
const (
150
        PaymentMethodCardWalletTypeAmexExpressCheckout PaymentMethodCardWalletType = "amex_express_checkout"
151
        PaymentMethodCardWalletTypeApplePay            PaymentMethodCardWalletType = "apple_pay"
152
        PaymentMethodCardWalletTypeGooglePay           PaymentMethodCardWalletType = "google_pay"
153
        PaymentMethodCardWalletTypeLink                PaymentMethodCardWalletType = "link"
154
        PaymentMethodCardWalletTypeMasterpass          PaymentMethodCardWalletType = "masterpass"
155
        PaymentMethodCardWalletTypeSamsungPay          PaymentMethodCardWalletType = "samsung_pay"
156
        PaymentMethodCardWalletTypeVisaCheckout        PaymentMethodCardWalletType = "visa_checkout"
157
)
158

159
// The method used to process this payment method offline. Only deferred is allowed.
160
type PaymentMethodCardPresentOfflineType string
161

162
// List of values that PaymentMethodCardPresentOfflineType can take
163
const (
164
        PaymentMethodCardPresentOfflineTypeDeferred PaymentMethodCardPresentOfflineType = "deferred"
165
)
166

167
// How card details were read in this transaction.
168
type PaymentMethodCardPresentReadMethod string
169

170
// List of values that PaymentMethodCardPresentReadMethod can take
171
const (
172
        PaymentMethodCardPresentReadMethodContactEmv               PaymentMethodCardPresentReadMethod = "contact_emv"
173
        PaymentMethodCardPresentReadMethodContactlessEmv           PaymentMethodCardPresentReadMethod = "contactless_emv"
174
        PaymentMethodCardPresentReadMethodContactlessMagstripeMode PaymentMethodCardPresentReadMethod = "contactless_magstripe_mode"
175
        PaymentMethodCardPresentReadMethodMagneticStripeFallback   PaymentMethodCardPresentReadMethod = "magnetic_stripe_fallback"
176
        PaymentMethodCardPresentReadMethodMagneticStripeTrack2     PaymentMethodCardPresentReadMethod = "magnetic_stripe_track2"
177
)
178

179
// The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`.
180
type PaymentMethodCardPresentWalletType string
181

182
// List of values that PaymentMethodCardPresentWalletType can take
183
const (
184
        PaymentMethodCardPresentWalletTypeApplePay   PaymentMethodCardPresentWalletType = "apple_pay"
185
        PaymentMethodCardPresentWalletTypeGooglePay  PaymentMethodCardPresentWalletType = "google_pay"
186
        PaymentMethodCardPresentWalletTypeSamsungPay PaymentMethodCardPresentWalletType = "samsung_pay"
187
        PaymentMethodCardPresentWalletTypeUnknown    PaymentMethodCardPresentWalletType = "unknown"
188
)
189

190
// Account holder type, if provided. Can be one of `individual` or `company`.
191
type PaymentMethodFPXAccountHolderType string
192

193
// List of values that PaymentMethodFPXAccountHolderType can take
194
const (
195
        PaymentMethodFPXAccountHolderTypeCompany    PaymentMethodFPXAccountHolderType = "company"
196
        PaymentMethodFPXAccountHolderTypeIndividual PaymentMethodFPXAccountHolderType = "individual"
197
)
198

199
// How card details were read in this transaction.
200
type PaymentMethodInteracPresentReadMethod string
201

202
// List of values that PaymentMethodInteracPresentReadMethod can take
203
const (
204
        PaymentMethodInteracPresentReadMethodContactEmv               PaymentMethodInteracPresentReadMethod = "contact_emv"
205
        PaymentMethodInteracPresentReadMethodContactlessEmv           PaymentMethodInteracPresentReadMethod = "contactless_emv"
206
        PaymentMethodInteracPresentReadMethodContactlessMagstripeMode PaymentMethodInteracPresentReadMethod = "contactless_magstripe_mode"
207
        PaymentMethodInteracPresentReadMethodMagneticStripeFallback   PaymentMethodInteracPresentReadMethod = "magnetic_stripe_fallback"
208
        PaymentMethodInteracPresentReadMethodMagneticStripeTrack2     PaymentMethodInteracPresentReadMethod = "magnetic_stripe_track2"
209
)
210

211
// The local credit or debit card brand.
212
type PaymentMethodKrCardBrand string
213

214
// List of values that PaymentMethodKrCardBrand can take
215
const (
216
        PaymentMethodKrCardBrandBc          PaymentMethodKrCardBrand = "bc"
217
        PaymentMethodKrCardBrandCiti        PaymentMethodKrCardBrand = "citi"
218
        PaymentMethodKrCardBrandHana        PaymentMethodKrCardBrand = "hana"
219
        PaymentMethodKrCardBrandHyundai     PaymentMethodKrCardBrand = "hyundai"
220
        PaymentMethodKrCardBrandJeju        PaymentMethodKrCardBrand = "jeju"
221
        PaymentMethodKrCardBrandJeonbuk     PaymentMethodKrCardBrand = "jeonbuk"
222
        PaymentMethodKrCardBrandKakaobank   PaymentMethodKrCardBrand = "kakaobank"
223
        PaymentMethodKrCardBrandKbank       PaymentMethodKrCardBrand = "kbank"
224
        PaymentMethodKrCardBrandKdbbank     PaymentMethodKrCardBrand = "kdbbank"
225
        PaymentMethodKrCardBrandKookmin     PaymentMethodKrCardBrand = "kookmin"
226
        PaymentMethodKrCardBrandKwangju     PaymentMethodKrCardBrand = "kwangju"
227
        PaymentMethodKrCardBrandLotte       PaymentMethodKrCardBrand = "lotte"
228
        PaymentMethodKrCardBrandMg          PaymentMethodKrCardBrand = "mg"
229
        PaymentMethodKrCardBrandNh          PaymentMethodKrCardBrand = "nh"
230
        PaymentMethodKrCardBrandPost        PaymentMethodKrCardBrand = "post"
231
        PaymentMethodKrCardBrandSamsung     PaymentMethodKrCardBrand = "samsung"
232
        PaymentMethodKrCardBrandSavingsbank PaymentMethodKrCardBrand = "savingsbank"
233
        PaymentMethodKrCardBrandShinhan     PaymentMethodKrCardBrand = "shinhan"
234
        PaymentMethodKrCardBrandShinhyup    PaymentMethodKrCardBrand = "shinhyup"
235
        PaymentMethodKrCardBrandSuhyup      PaymentMethodKrCardBrand = "suhyup"
236
        PaymentMethodKrCardBrandTossbank    PaymentMethodKrCardBrand = "tossbank"
237
        PaymentMethodKrCardBrandWoori       PaymentMethodKrCardBrand = "woori"
238
)
239

240
// Whether to fund this transaction with Naver Pay points or a card.
241
type PaymentMethodNaverPayFunding string
242

243
// List of values that PaymentMethodNaverPayFunding can take
244
const (
245
        PaymentMethodNaverPayFundingCard   PaymentMethodNaverPayFunding = "card"
246
        PaymentMethodNaverPayFundingPoints PaymentMethodNaverPayFunding = "points"
247
)
248

249
// The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
250
type PaymentMethodType string
251

252
// List of values that PaymentMethodType can take
253
const (
254
        PaymentMethodTypeACSSDebit        PaymentMethodType = "acss_debit"
255
        PaymentMethodTypeAffirm           PaymentMethodType = "affirm"
256
        PaymentMethodTypeAfterpayClearpay PaymentMethodType = "afterpay_clearpay"
257
        PaymentMethodTypeAlipay           PaymentMethodType = "alipay"
258
        PaymentMethodTypeAmazonPay        PaymentMethodType = "amazon_pay"
259
        PaymentMethodTypeAUBECSDebit      PaymentMethodType = "au_becs_debit"
260
        PaymentMethodTypeBACSDebit        PaymentMethodType = "bacs_debit"
261
        PaymentMethodTypeBancontact       PaymentMethodType = "bancontact"
262
        PaymentMethodTypeBLIK             PaymentMethodType = "blik"
263
        PaymentMethodTypeBoleto           PaymentMethodType = "boleto"
264
        PaymentMethodTypeCard             PaymentMethodType = "card"
265
        PaymentMethodTypeCardPresent      PaymentMethodType = "card_present"
266
        PaymentMethodTypeCashApp          PaymentMethodType = "cashapp"
267
        PaymentMethodTypeCustomerBalance  PaymentMethodType = "customer_balance"
268
        PaymentMethodTypeEPS              PaymentMethodType = "eps"
269
        PaymentMethodTypeFPX              PaymentMethodType = "fpx"
270
        PaymentMethodTypeGiropay          PaymentMethodType = "giropay"
271
        PaymentMethodTypeGrabpay          PaymentMethodType = "grabpay"
272
        PaymentMethodTypeIDEAL            PaymentMethodType = "ideal"
273
        PaymentMethodTypeInteracPresent   PaymentMethodType = "interac_present"
274
        PaymentMethodTypeKakaoPay         PaymentMethodType = "kakao_pay"
275
        PaymentMethodTypeKlarna           PaymentMethodType = "klarna"
276
        PaymentMethodTypeKonbini          PaymentMethodType = "konbini"
277
        PaymentMethodTypeKrCard           PaymentMethodType = "kr_card"
278
        PaymentMethodTypeLink             PaymentMethodType = "link"
279
        PaymentMethodTypeMbWay            PaymentMethodType = "mb_way"
280
        PaymentMethodTypeMobilepay        PaymentMethodType = "mobilepay"
281
        PaymentMethodTypeMultibanco       PaymentMethodType = "multibanco"
282
        PaymentMethodTypeNaverPay         PaymentMethodType = "naver_pay"
283
        PaymentMethodTypeOXXO             PaymentMethodType = "oxxo"
284
        PaymentMethodTypeP24              PaymentMethodType = "p24"
285
        PaymentMethodTypePayco            PaymentMethodType = "payco"
286
        PaymentMethodTypePayNow           PaymentMethodType = "paynow"
287
        PaymentMethodTypePaypal           PaymentMethodType = "paypal"
288
        PaymentMethodTypePayto            PaymentMethodType = "payto"
289
        PaymentMethodTypePix              PaymentMethodType = "pix"
290
        PaymentMethodTypePromptPay        PaymentMethodType = "promptpay"
291
        PaymentMethodTypeRechnung         PaymentMethodType = "rechnung"
292
        PaymentMethodTypeRevolutPay       PaymentMethodType = "revolut_pay"
293
        PaymentMethodTypeSamsungPay       PaymentMethodType = "samsung_pay"
294
        PaymentMethodTypeSEPADebit        PaymentMethodType = "sepa_debit"
295
        PaymentMethodTypeSofort           PaymentMethodType = "sofort"
296
        PaymentMethodTypeSwish            PaymentMethodType = "swish"
297
        PaymentMethodTypeTWINT            PaymentMethodType = "twint"
298
        PaymentMethodTypeUSBankAccount    PaymentMethodType = "us_bank_account"
299
        PaymentMethodTypeWeChatPay        PaymentMethodType = "wechat_pay"
300
        PaymentMethodTypeZip              PaymentMethodType = "zip"
301
)
302

303
// Account holder type: individual or company.
304
type PaymentMethodUSBankAccountAccountHolderType string
305

306
// List of values that PaymentMethodUSBankAccountAccountHolderType can take
307
const (
308
        PaymentMethodUSBankAccountAccountHolderTypeCompany    PaymentMethodUSBankAccountAccountHolderType = "company"
309
        PaymentMethodUSBankAccountAccountHolderTypeIndividual PaymentMethodUSBankAccountAccountHolderType = "individual"
310
)
311

312
// Account type: checkings or savings. Defaults to checking if omitted.
313
type PaymentMethodUSBankAccountAccountType string
314

315
// List of values that PaymentMethodUSBankAccountAccountType can take
316
const (
317
        PaymentMethodUSBankAccountAccountTypeChecking PaymentMethodUSBankAccountAccountType = "checking"
318
        PaymentMethodUSBankAccountAccountTypeSavings  PaymentMethodUSBankAccountAccountType = "savings"
319
)
320

321
// All supported networks.
322
type PaymentMethodUSBankAccountNetworksSupported string
323

324
// List of values that PaymentMethodUSBankAccountNetworksSupported can take
325
const (
326
        PaymentMethodUSBankAccountNetworksSupportedACH            PaymentMethodUSBankAccountNetworksSupported = "ach"
327
        PaymentMethodUSBankAccountNetworksSupportedUSDomesticWire PaymentMethodUSBankAccountNetworksSupported = "us_domestic_wire"
328
)
329

330
// The ACH network code that resulted in this block.
331
type PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode string
332

333
// List of values that PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode can take
334
const (
335
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR02 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R02"
336
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR03 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R03"
337
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR04 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R04"
338
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR05 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R05"
339
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR07 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R07"
340
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR08 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R08"
341
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR10 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R10"
342
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR11 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R11"
343
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR16 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R16"
344
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR20 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R20"
345
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR29 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R29"
346
        PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR31 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R31"
347
)
348

349
// The reason why this PaymentMethod's fingerprint has been blocked
350
type PaymentMethodUSBankAccountStatusDetailsBlockedReason string
351

352
// List of values that PaymentMethodUSBankAccountStatusDetailsBlockedReason can take
353
const (
354
        PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountClosed         PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_closed"
355
        PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountFrozen         PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_frozen"
356
        PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountInvalidDetails PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_invalid_details"
357
        PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountRestricted     PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_restricted"
358
        PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountUnusable       PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_unusable"
359
        PaymentMethodUSBankAccountStatusDetailsBlockedReasonDebitNotAuthorized        PaymentMethodUSBankAccountStatusDetailsBlockedReason = "debit_not_authorized"
360
)
361

362
// Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead.
363
type PaymentMethodListParams struct {
364
        ListParams `form:"*"`
365
        // The ID of the customer whose PaymentMethods will be retrieved.
366
        Customer *string `form:"customer"`
367
        // Specifies which fields in the response should be expanded.
368
        Expand []*string `form:"expand"`
369
        // An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request.
370
        Type *string `form:"type"`
371
}
372

373
// AddExpand appends a new field to expand.
UNCOV
374
func (p *PaymentMethodListParams) AddExpand(f string) {
×
UNCOV
375
        p.Expand = append(p.Expand, &f)
×
UNCOV
376
}
×
377

378
// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
379
type PaymentMethodACSSDebitParams struct {
380
        // Customer's bank account number.
381
        AccountNumber *string `form:"account_number"`
382
        // Institution number of the customer's bank.
383
        InstitutionNumber *string `form:"institution_number"`
384
        // Transit number of the customer's bank.
385
        TransitNumber *string `form:"transit_number"`
386
}
387

388
// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
389
type PaymentMethodAffirmParams struct{}
390

391
// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
392
type PaymentMethodAfterpayClearpayParams struct{}
393

394
// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
395
type PaymentMethodAlipayParams struct{}
396

397
// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
398
type PaymentMethodAmazonPayParams struct{}
399

400
// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
401
type PaymentMethodAUBECSDebitParams struct {
402
        // The account number for the bank account.
403
        AccountNumber *string `form:"account_number"`
404
        // Bank-State-Branch number of the bank account.
405
        BSBNumber *string `form:"bsb_number"`
406
}
407

408
// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
409
type PaymentMethodBACSDebitParams struct {
410
        // Account number of the bank account that the funds will be debited from.
411
        AccountNumber *string `form:"account_number"`
412
        // Sort code of the bank account. (e.g., `10-20-30`)
413
        SortCode *string `form:"sort_code"`
414
}
415

416
// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
417
type PaymentMethodBancontactParams struct{}
418

419
// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
420
type PaymentMethodBillingDetailsParams struct {
421
        // Billing address.
422
        Address *AddressParams `form:"address"`
423
        // Email address.
424
        Email *string `form:"email"`
425
        // Full name.
426
        Name *string `form:"name"`
427
        // Billing phone number (including extension).
428
        Phone *string `form:"phone"`
429
}
430

431
// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
432
type PaymentMethodBLIKParams struct{}
433

434
// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
435
type PaymentMethodBoletoParams struct {
436
        // The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
437
        TaxID *string `form:"tax_id"`
438
}
439

440
// Contains information about card networks used to process the payment.
441
type PaymentMethodCardNetworksParams struct {
442
        // The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card.
443
        Preferred *string `form:"preferred"`
444
}
445

446
// If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly.
447
type PaymentMethodCardParams struct {
448
        // The card's CVC. It is highly recommended to always include this value.
449
        CVC *string `form:"cvc"`
450
        // Two-digit number representing the card's expiration month.
451
        ExpMonth *int64 `form:"exp_month"`
452
        // Four-digit number representing the card's expiration year.
453
        ExpYear *int64 `form:"exp_year"`
454
        // Contains information about card networks used to process the payment.
455
        Networks *PaymentMethodCardNetworksParams `form:"networks"`
456
        // The card number, as a string without any separators.
457
        Number *string `form:"number"`
458
        // For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}.
459
        Token *string `form:"token"`
460
}
461

462
// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
463
type PaymentMethodCashAppParams struct{}
464

465
// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
466
type PaymentMethodCustomerBalanceParams struct{}
467

468
// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
469
type PaymentMethodEPSParams struct {
470
        // The customer's bank.
471
        Bank *string `form:"bank"`
472
}
473

474
// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
475
type PaymentMethodFPXParams struct {
476
        // Account holder type for FPX transaction
477
        AccountHolderType *string `form:"account_holder_type"`
478
        // The customer's bank.
479
        Bank *string `form:"bank"`
480
}
481

482
// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
483
type PaymentMethodGiropayParams struct{}
484

485
// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
486
type PaymentMethodGrabpayParams struct{}
487

488
// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
489
type PaymentMethodIDEALParams struct {
490
        // The customer's bank.
491
        Bank *string `form:"bank"`
492
}
493

494
// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
495
type PaymentMethodInteracPresentParams struct{}
496

497
// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
498
type PaymentMethodKakaoPayParams struct{}
499

500
// Customer's date of birth
501
type PaymentMethodKlarnaDOBParams struct {
502
        // The day of birth, between 1 and 31.
503
        Day *int64 `form:"day"`
504
        // The month of birth, between 1 and 12.
505
        Month *int64 `form:"month"`
506
        // The four-digit year of birth.
507
        Year *int64 `form:"year"`
508
}
509

510
// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
511
type PaymentMethodKlarnaParams struct {
512
        // Customer's date of birth
513
        DOB *PaymentMethodKlarnaDOBParams `form:"dob"`
514
}
515

516
// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
517
type PaymentMethodKonbiniParams struct{}
518

519
// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
520
type PaymentMethodKrCardParams struct{}
521

522
// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
523
type PaymentMethodLinkParams struct{}
524

525
// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
526
type PaymentMethodMbWayParams struct{}
527

528
// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
529
type PaymentMethodMobilepayParams struct{}
530

531
// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
532
type PaymentMethodMultibancoParams struct{}
533

534
// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
535
type PaymentMethodNaverPayParams struct {
536
        // Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`.
537
        Funding *string `form:"funding"`
538
}
539

540
// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
541
type PaymentMethodOXXOParams struct{}
542

543
// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
544
type PaymentMethodP24Params struct {
545
        // The customer's bank.
546
        Bank *string `form:"bank"`
547
}
548

549
// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
550
type PaymentMethodPaycoParams struct{}
551

552
// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
553
type PaymentMethodPayNowParams struct{}
554

555
// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
556
type PaymentMethodPaypalParams struct{}
557

558
// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
559
type PaymentMethodPaytoParams struct {
560
        // The account number for the bank account.
561
        AccountNumber *string `form:"account_number"`
562
        // Bank-State-Branch number of the bank account.
563
        BSBNumber *string `form:"bsb_number"`
564
        // The PayID alias for the bank account.
565
        PayID *string `form:"pay_id"`
566
}
567

568
// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
569
type PaymentMethodPixParams struct{}
570

571
// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
572
type PaymentMethodPromptPayParams struct{}
573

574
// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
575
type PaymentMethodRadarOptionsParams struct {
576
        // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
577
        Session *string `form:"session"`
578
}
579

580
// Customer's date of birth
581
type PaymentMethodRechnungDOBParams struct {
582
        // The day of birth, between 1 and 31.
583
        Day *int64 `form:"day"`
584
        // The month of birth, between 1 and 12.
585
        Month *int64 `form:"month"`
586
        // The four-digit year of birth.
587
        Year *int64 `form:"year"`
588
}
589

590
// If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method.
591
type PaymentMethodRechnungParams struct {
592
        // Customer's date of birth
593
        DOB *PaymentMethodRechnungDOBParams `form:"dob"`
594
}
595

596
// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
597
type PaymentMethodRevolutPayParams struct{}
598

599
// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
600
type PaymentMethodSamsungPayParams struct{}
601

602
// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
603
type PaymentMethodSEPADebitParams struct {
604
        // IBAN of the bank account.
605
        IBAN *string `form:"iban"`
606
}
607

608
// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
609
type PaymentMethodSofortParams struct {
610
        // Two-letter ISO code representing the country the bank account is located in.
611
        Country *string `form:"country"`
612
}
613

614
// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
615
type PaymentMethodSwishParams struct{}
616

617
// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
618
type PaymentMethodTWINTParams struct{}
619

620
// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
621
type PaymentMethodUSBankAccountParams struct {
622
        // Account holder type: individual or company.
623
        AccountHolderType *string `form:"account_holder_type"`
624
        // Account number of the bank account.
625
        AccountNumber *string `form:"account_number"`
626
        // Account type: checkings or savings. Defaults to checking if omitted.
627
        AccountType *string `form:"account_type"`
628
        // The ID of a Financial Connections Account to use as a payment method.
629
        FinancialConnectionsAccount *string `form:"financial_connections_account"`
630
        // Routing number of the bank account.
631
        RoutingNumber *string `form:"routing_number"`
632
}
633

634
// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
635
type PaymentMethodWeChatPayParams struct{}
636

637
// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
638
type PaymentMethodZipParams struct{}
639

640
// Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js.
641
//
642
// Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the <a href="/docs/payments/save-and-reuse">SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment.
643
type PaymentMethodParams struct {
644
        Params `form:"*"`
645
        // If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
646
        ACSSDebit *PaymentMethodACSSDebitParams `form:"acss_debit"`
647
        // If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
648
        Affirm *PaymentMethodAffirmParams `form:"affirm"`
649
        // If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
650
        AfterpayClearpay *PaymentMethodAfterpayClearpayParams `form:"afterpay_clearpay"`
651
        // If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
652
        Alipay *PaymentMethodAlipayParams `form:"alipay"`
653
        // This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`.
654
        AllowRedisplay *string `form:"allow_redisplay"`
655
        // If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
656
        AmazonPay *PaymentMethodAmazonPayParams `form:"amazon_pay"`
657
        // If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
658
        AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit"`
659
        // If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
660
        BACSDebit *PaymentMethodBACSDebitParams `form:"bacs_debit"`
661
        // If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
662
        Bancontact *PaymentMethodBancontactParams `form:"bancontact"`
663
        // Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
664
        BillingDetails *PaymentMethodBillingDetailsParams `form:"billing_details"`
665
        // If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
666
        BLIK *PaymentMethodBLIKParams `form:"blik"`
667
        // If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
668
        Boleto *PaymentMethodBoletoParams `form:"boleto"`
669
        // If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly.
670
        Card *PaymentMethodCardParams `form:"card"`
671
        // If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
672
        CashApp *PaymentMethodCashAppParams `form:"cashapp"`
673
        // If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
674
        CustomerBalance *PaymentMethodCustomerBalanceParams `form:"customer_balance"`
675
        // If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
676
        EPS *PaymentMethodEPSParams `form:"eps"`
677
        // Specifies which fields in the response should be expanded.
678
        Expand []*string `form:"expand"`
679
        // If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
680
        FPX *PaymentMethodFPXParams `form:"fpx"`
681
        // If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
682
        Giropay *PaymentMethodGiropayParams `form:"giropay"`
683
        // If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
684
        Grabpay *PaymentMethodGrabpayParams `form:"grabpay"`
685
        // If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
686
        IDEAL *PaymentMethodIDEALParams `form:"ideal"`
687
        // If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
688
        InteracPresent *PaymentMethodInteracPresentParams `form:"interac_present"`
689
        // If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
690
        KakaoPay *PaymentMethodKakaoPayParams `form:"kakao_pay"`
691
        // If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
692
        Klarna *PaymentMethodKlarnaParams `form:"klarna"`
693
        // If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
694
        Konbini *PaymentMethodKonbiniParams `form:"konbini"`
695
        // If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
696
        KrCard *PaymentMethodKrCardParams `form:"kr_card"`
697
        // If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
698
        Link *PaymentMethodLinkParams `form:"link"`
699
        // If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
700
        MbWay *PaymentMethodMbWayParams `form:"mb_way"`
701
        // 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
702
        Metadata map[string]string `form:"metadata"`
703
        // If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
704
        Mobilepay *PaymentMethodMobilepayParams `form:"mobilepay"`
705
        // If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
706
        Multibanco *PaymentMethodMultibancoParams `form:"multibanco"`
707
        // If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
708
        NaverPay *PaymentMethodNaverPayParams `form:"naver_pay"`
709
        // If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
710
        OXXO *PaymentMethodOXXOParams `form:"oxxo"`
711
        // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
712
        P24 *PaymentMethodP24Params `form:"p24"`
713
        // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
714
        Payco *PaymentMethodPaycoParams `form:"payco"`
715
        // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
716
        PayNow *PaymentMethodPayNowParams `form:"paynow"`
717
        // If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
718
        Paypal *PaymentMethodPaypalParams `form:"paypal"`
719
        // If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
720
        Payto *PaymentMethodPaytoParams `form:"payto"`
721
        // If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
722
        Pix *PaymentMethodPixParams `form:"pix"`
723
        // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
724
        PromptPay *PaymentMethodPromptPayParams `form:"promptpay"`
725
        // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
726
        RadarOptions *PaymentMethodRadarOptionsParams `form:"radar_options"`
727
        // If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method.
728
        Rechnung *PaymentMethodRechnungParams `form:"rechnung"`
729
        // If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
730
        RevolutPay *PaymentMethodRevolutPayParams `form:"revolut_pay"`
731
        // If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
732
        SamsungPay *PaymentMethodSamsungPayParams `form:"samsung_pay"`
733
        // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
734
        SEPADebit *PaymentMethodSEPADebitParams `form:"sepa_debit"`
735
        // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
736
        Sofort *PaymentMethodSofortParams `form:"sofort"`
737
        // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
738
        Swish *PaymentMethodSwishParams `form:"swish"`
739
        // If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
740
        TWINT *PaymentMethodTWINTParams `form:"twint"`
741
        // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
742
        Type *string `form:"type"`
743
        // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
744
        USBankAccount *PaymentMethodUSBankAccountParams `form:"us_bank_account"`
745
        // If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
746
        WeChatPay *PaymentMethodWeChatPayParams `form:"wechat_pay"`
747
        // If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
748
        Zip *PaymentMethodZipParams `form:"zip"`
749
        // The following parameters are used when cloning a PaymentMethod to the connected account
750
        // The `Customer` to whom the original PaymentMethod is attached.
751
        Customer *string `form:"customer"`
752
        // The PaymentMethod to share.
753
        PaymentMethod *string `form:"payment_method"`
754
}
755

756
// AddExpand appends a new field to expand.
757
func (p *PaymentMethodParams) AddExpand(f string) {
×
758
        p.Expand = append(p.Expand, &f)
×
UNCOV
759
}
×
760

761
// AddMetadata adds a new key-value pair to the Metadata.
UNCOV
762
func (p *PaymentMethodParams) AddMetadata(key string, value string) {
×
UNCOV
763
        if p.Metadata == nil {
×
UNCOV
764
                p.Metadata = make(map[string]string)
×
UNCOV
765
        }
×
766

UNCOV
767
        p.Metadata[key] = value
×
768
}
769

770
// Attaches a PaymentMethod object to a Customer.
771
//
772
// To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents)
773
// or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage).
774
// These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach
775
// endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for
776
// future use, which makes later declines and payment friction more likely.
777
// See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up
778
// future payments.
779
//
780
// To use this PaymentMethod as the default for invoice or subscription payments,
781
// set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method),
782
// on the Customer to the PaymentMethod's ID.
783
type PaymentMethodAttachParams struct {
784
        Params `form:"*"`
785
        // The ID of the customer to which to attach the PaymentMethod.
786
        Customer *string `form:"customer"`
787
        // Specifies which fields in the response should be expanded.
788
        Expand []*string `form:"expand"`
789
}
790

791
// AddExpand appends a new field to expand.
UNCOV
792
func (p *PaymentMethodAttachParams) AddExpand(f string) {
×
UNCOV
793
        p.Expand = append(p.Expand, &f)
×
UNCOV
794
}
×
795

796
// Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.
797
type PaymentMethodDetachParams struct {
798
        Params `form:"*"`
799
        // Specifies which fields in the response should be expanded.
800
        Expand []*string `form:"expand"`
801
}
802

803
// AddExpand appends a new field to expand.
UNCOV
804
func (p *PaymentMethodDetachParams) AddExpand(f string) {
×
UNCOV
805
        p.Expand = append(p.Expand, &f)
×
UNCOV
806
}
×
807

808
type PaymentMethodACSSDebit struct {
809
        // Name of the bank associated with the bank account.
810
        BankName string `json:"bank_name"`
811
        // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
812
        Fingerprint string `json:"fingerprint"`
813
        // Institution number of the bank account.
814
        InstitutionNumber string `json:"institution_number"`
815
        // Last four digits of the bank account number.
816
        Last4 string `json:"last4"`
817
        // Transit number of the bank account.
818
        TransitNumber string `json:"transit_number"`
819
}
820
type PaymentMethodAffirm struct{}
821
type PaymentMethodAfterpayClearpay struct{}
822
type PaymentMethodAlipay struct{}
823
type PaymentMethodAmazonPay struct{}
824
type PaymentMethodAUBECSDebit struct {
825
        // Six-digit number identifying bank and branch associated with this bank account.
826
        BSBNumber string `json:"bsb_number"`
827
        // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
828
        Fingerprint string `json:"fingerprint"`
829
        // Last four digits of the bank account number.
830
        Last4 string `json:"last4"`
831
}
832
type PaymentMethodBACSDebit struct {
833
        // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
834
        Fingerprint string `json:"fingerprint"`
835
        // Last four digits of the bank account number.
836
        Last4 string `json:"last4"`
837
        // Sort code of the bank account. (e.g., `10-20-30`)
838
        SortCode string `json:"sort_code"`
839
}
840
type PaymentMethodBancontact struct{}
841
type PaymentMethodBillingDetails struct {
842
        // Billing address.
843
        Address *Address `json:"address"`
844
        // Email address.
845
        Email string `json:"email"`
846
        // Full name.
847
        Name string `json:"name"`
848
        // Billing phone number (including extension).
849
        Phone string `json:"phone"`
850
}
851
type PaymentMethodBLIK struct{}
852
type PaymentMethodBoleto struct {
853
        // Uniquely identifies the customer tax id (CNPJ or CPF)
854
        TaxID string `json:"tax_id"`
855
}
856

857
// Checks on Card address and CVC if provided.
858
type PaymentMethodCardChecks struct {
859
        // If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
860
        AddressLine1Check PaymentMethodCardChecksAddressLine1Check `json:"address_line1_check"`
861
        // If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
862
        AddressPostalCodeCheck PaymentMethodCardChecksAddressPostalCodeCheck `json:"address_postal_code_check"`
863
        // If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
864
        CVCCheck PaymentMethodCardChecksCVCCheck `json:"cvc_check"`
865
}
866

867
// Details about payments collected offline.
868
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentOffline struct {
869
        // Time at which the payment was collected while offline
870
        StoredAt int64 `json:"stored_at"`
871
        // The method used to process this payment method offline. Only deferred is allowed.
872
        Type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentOfflineType `json:"type"`
873
}
874

875
// A collection of fields required to be displayed on receipts. Only required for EMV transactions.
876
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceipt struct {
877
        // The type of account being debited or credited
878
        AccountType PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceiptAccountType `json:"account_type"`
879
        // EMV tag 9F26, cryptogram generated by the integrated circuit chip.
880
        ApplicationCryptogram string `json:"application_cryptogram"`
881
        // Mnenomic of the Application Identifier.
882
        ApplicationPreferredName string `json:"application_preferred_name"`
883
        // Identifier for this transaction.
884
        AuthorizationCode string `json:"authorization_code"`
885
        // EMV tag 8A. A code returned by the card issuer.
886
        AuthorizationResponseCode string `json:"authorization_response_code"`
887
        // Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`.
888
        CardholderVerificationMethod string `json:"cardholder_verification_method"`
889
        // EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.
890
        DedicatedFileName string `json:"dedicated_file_name"`
891
        // The outcome of a series of EMV functions performed by the card reader.
892
        TerminalVerificationResults string `json:"terminal_verification_results"`
893
        // An indication of various EMV functions performed during the transaction.
894
        TransactionStatusInformation string `json:"transaction_status_information"`
895
}
896
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWallet struct {
897
        // The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`.
898
        Type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWalletType `json:"type"`
899
}
900
type PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent struct {
901
        // The authorized amount
902
        AmountAuthorized int64 `json:"amount_authorized"`
903
        // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
904
        Brand string `json:"brand"`
905
        // The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card.
906
        BrandProduct string `json:"brand_product"`
907
        // When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.
908
        CaptureBefore int64 `json:"capture_before"`
909
        // 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.
910
        CardholderName string `json:"cardholder_name"`
911
        // 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.
912
        Country string `json:"country"`
913
        // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
914
        Description string `json:"description"`
915
        // Authorization response cryptogram.
916
        EmvAuthData string `json:"emv_auth_data"`
917
        // Two-digit number representing the card's expiration month.
918
        ExpMonth int64 `json:"exp_month"`
919
        // Four-digit number representing the card's expiration year.
920
        ExpYear int64 `json:"exp_year"`
921
        // 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.
922
        //
923
        // *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.*
924
        Fingerprint string `json:"fingerprint"`
925
        // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
926
        Funding string `json:"funding"`
927
        // 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.
928
        GeneratedCard string `json:"generated_card"`
929
        // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
930
        IIN string `json:"iin"`
931
        // Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).
932
        IncrementalAuthorizationSupported bool `json:"incremental_authorization_supported"`
933
        // The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
934
        Issuer string `json:"issuer"`
935
        // The last four digits of the card.
936
        Last4 string `json:"last4"`
937
        // Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
938
        Network string `json:"network"`
939
        // This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands.
940
        NetworkTransactionID string `json:"network_transaction_id"`
941
        // Details about payments collected offline.
942
        Offline *PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentOffline `json:"offline"`
943
        // Defines whether the authorized amount can be over-captured or not
944
        OvercaptureSupported bool `json:"overcapture_supported"`
945
        // EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
946
        PreferredLocales []string `json:"preferred_locales"`
947
        // How card details were read in this transaction.
948
        ReadMethod PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReadMethod `json:"read_method"`
949
        // A collection of fields required to be displayed on receipts. Only required for EMV transactions.
950
        Receipt *PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentReceipt `json:"receipt"`
951
        Wallet  *PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentWallet  `json:"wallet"`
952
}
953

954
// Transaction-specific details of the payment method used in the payment.
955
type PaymentMethodCardGeneratedFromPaymentMethodDetails struct {
956
        CardPresent *PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent `json:"card_present"`
957
        // The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.
958
        Type string `json:"type"`
959
}
960

961
// Details of the original PaymentMethod that created this object.
962
type PaymentMethodCardGeneratedFrom struct {
963
        // The charge that created this object.
964
        Charge string `json:"charge"`
965
        // Transaction-specific details of the payment method used in the payment.
966
        PaymentMethodDetails *PaymentMethodCardGeneratedFromPaymentMethodDetails `json:"payment_method_details"`
967
        // The ID of the SetupAttempt that generated this PaymentMethod, if any.
968
        SetupAttempt *SetupAttempt `json:"setup_attempt"`
969
}
970

971
// Contains information about card networks that can be used to process the payment.
972
type PaymentMethodCardNetworks struct {
973
        // All available networks for the card.
974
        Available []PaymentMethodCardNetworksAvailable `json:"available"`
975
        // The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card.
976
        Preferred PaymentMethodCardNetworksPreferred `json:"preferred"`
977
}
978

979
// Contains details on how this Card may be used for 3D Secure authentication.
980
type PaymentMethodCardThreeDSecureUsage struct {
981
        // Whether 3D Secure is supported on this card.
982
        Supported bool `json:"supported"`
983
}
984
type PaymentMethodCardWalletAmexExpressCheckout struct{}
985
type PaymentMethodCardWalletApplePay struct{}
986
type PaymentMethodCardWalletGooglePay struct{}
987
type PaymentMethodCardWalletLink struct{}
988
type PaymentMethodCardWalletMasterpass struct {
989
        // Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
990
        BillingAddress *Address `json:"billing_address"`
991
        // Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
992
        Email string `json:"email"`
993
        // Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
994
        Name string `json:"name"`
995
        // Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
996
        ShippingAddress *Address `json:"shipping_address"`
997
}
998
type PaymentMethodCardWalletSamsungPay struct{}
999
type PaymentMethodCardWalletVisaCheckout struct {
1000
        // Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
1001
        BillingAddress *Address `json:"billing_address"`
1002
        // Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
1003
        Email string `json:"email"`
1004
        // Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
1005
        Name string `json:"name"`
1006
        // Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
1007
        ShippingAddress *Address `json:"shipping_address"`
1008
}
1009

1010
// If this Card is part of a card wallet, this contains the details of the card wallet.
1011
type PaymentMethodCardWallet struct {
1012
        AmexExpressCheckout *PaymentMethodCardWalletAmexExpressCheckout `json:"amex_express_checkout"`
1013
        ApplePay            *PaymentMethodCardWalletApplePay            `json:"apple_pay"`
1014
        // (For tokenized numbers only.) The last four digits of the device account number.
1015
        DynamicLast4 string                             `json:"dynamic_last4"`
1016
        GooglePay    *PaymentMethodCardWalletGooglePay  `json:"google_pay"`
1017
        Link         *PaymentMethodCardWalletLink       `json:"link"`
1018
        Masterpass   *PaymentMethodCardWalletMasterpass `json:"masterpass"`
1019
        SamsungPay   *PaymentMethodCardWalletSamsungPay `json:"samsung_pay"`
1020
        // The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.
1021
        Type         PaymentMethodCardWalletType          `json:"type"`
1022
        VisaCheckout *PaymentMethodCardWalletVisaCheckout `json:"visa_checkout"`
1023
}
1024
type PaymentMethodCard struct {
1025
        // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
1026
        Brand PaymentMethodCardBrand `json:"brand"`
1027
        // Checks on Card address and CVC if provided.
1028
        Checks *PaymentMethodCardChecks `json:"checks"`
1029
        // 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.
1030
        Country string `json:"country"`
1031
        // The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future.
1032
        DisplayBrand string `json:"display_brand"`
1033
        // Two-digit number representing the card's expiration month.
1034
        ExpMonth int64 `json:"exp_month"`
1035
        // Four-digit number representing the card's expiration year.
1036
        ExpYear int64 `json:"exp_year"`
1037
        // 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.
1038
        //
1039
        // *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.*
1040
        Fingerprint string `json:"fingerprint"`
1041
        // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
1042
        Funding CardFunding `json:"funding"`
1043
        // Details of the original PaymentMethod that created this object.
1044
        GeneratedFrom *PaymentMethodCardGeneratedFrom `json:"generated_from"`
1045
        // The last four digits of the card.
1046
        Last4 string `json:"last4"`
1047
        // Contains information about card networks that can be used to process the payment.
1048
        Networks *PaymentMethodCardNetworks `json:"networks"`
1049
        // Contains details on how this Card may be used for 3D Secure authentication.
1050
        ThreeDSecureUsage *PaymentMethodCardThreeDSecureUsage `json:"three_d_secure_usage"`
1051
        // If this Card is part of a card wallet, this contains the details of the card wallet.
1052
        Wallet *PaymentMethodCardWallet `json:"wallet"`
1053
        // Please note that the fields below are for internal use only and are not returned
1054
        // as part of standard API requests.
1055
        // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
1056
        Description string `json:"description"`
1057
        // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
1058
        IIN string `json:"iin"`
1059
        // The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
1060
        Issuer string `json:"issuer"`
1061
}
1062

1063
// Contains information about card networks that can be used to process the payment.
1064
type PaymentMethodCardPresentNetworks struct {
1065
        // All available networks for the card.
1066
        Available []string `json:"available"`
1067
        // The preferred network for the card.
1068
        Preferred string `json:"preferred"`
1069
}
1070

1071
// Details about payment methods collected offline.
1072
type PaymentMethodCardPresentOffline struct {
1073
        // Time at which the payment was collected while offline
1074
        StoredAt int64 `json:"stored_at"`
1075
        // The method used to process this payment method offline. Only deferred is allowed.
1076
        Type PaymentMethodCardPresentOfflineType `json:"type"`
1077
}
1078
type PaymentMethodCardPresentWallet struct {
1079
        // The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`.
1080
        Type PaymentMethodCardPresentWalletType `json:"type"`
1081
}
1082
type PaymentMethodCardPresent struct {
1083
        // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
1084
        Brand string `json:"brand"`
1085
        // The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card.
1086
        BrandProduct string `json:"brand_product"`
1087
        // 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.
1088
        CardholderName string `json:"cardholder_name"`
1089
        // 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.
1090
        Country string `json:"country"`
1091
        // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
1092
        Description string `json:"description"`
1093
        // Two-digit number representing the card's expiration month.
1094
        ExpMonth int64 `json:"exp_month"`
1095
        // Four-digit number representing the card's expiration year.
1096
        ExpYear int64 `json:"exp_year"`
1097
        // 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.
1098
        //
1099
        // *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.*
1100
        Fingerprint string `json:"fingerprint"`
1101
        // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
1102
        Funding string `json:"funding"`
1103
        // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
1104
        IIN string `json:"iin"`
1105
        // The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
1106
        Issuer string `json:"issuer"`
1107
        // The last four digits of the card.
1108
        Last4 string `json:"last4"`
1109
        // Contains information about card networks that can be used to process the payment.
1110
        Networks *PaymentMethodCardPresentNetworks `json:"networks"`
1111
        // Details about payment methods collected offline.
1112
        Offline *PaymentMethodCardPresentOffline `json:"offline"`
1113
        // EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
1114
        PreferredLocales []string `json:"preferred_locales"`
1115
        // How card details were read in this transaction.
1116
        ReadMethod PaymentMethodCardPresentReadMethod `json:"read_method"`
1117
        Wallet     *PaymentMethodCardPresentWallet    `json:"wallet"`
1118
}
1119
type PaymentMethodCashApp struct {
1120
        // A unique and immutable identifier assigned by Cash App to every buyer.
1121
        BuyerID string `json:"buyer_id"`
1122
        // A public identifier for buyers using Cash App.
1123
        Cashtag string `json:"cashtag"`
1124
}
1125
type PaymentMethodCustomerBalance struct{}
1126
type PaymentMethodEPS struct {
1127
        // The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
1128
        Bank string `json:"bank"`
1129
}
1130
type PaymentMethodFPX struct {
1131
        // Account holder type, if provided. Can be one of `individual` or `company`.
1132
        AccountHolderType PaymentMethodFPXAccountHolderType `json:"account_holder_type"`
1133
        // The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.
1134
        Bank string `json:"bank"`
1135
}
1136
type PaymentMethodGiropay struct{}
1137
type PaymentMethodGrabpay struct{}
1138
type PaymentMethodIDEAL struct {
1139
        // The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
1140
        Bank string `json:"bank"`
1141
        // The Bank Identifier Code of the customer's bank, if the bank was provided.
1142
        BIC string `json:"bic"`
1143
}
1144

1145
// Contains information about card networks that can be used to process the payment.
1146
type PaymentMethodInteracPresentNetworks struct {
1147
        // All available networks for the card.
1148
        Available []string `json:"available"`
1149
        // The preferred network for the card.
1150
        Preferred string `json:"preferred"`
1151
}
1152
type PaymentMethodInteracPresent struct {
1153
        // Card brand. Can be `interac`, `mastercard` or `visa`.
1154
        Brand string `json:"brand"`
1155
        // 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.
1156
        CardholderName string `json:"cardholder_name"`
1157
        // 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.
1158
        Country string `json:"country"`
1159
        // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
1160
        Description string `json:"description"`
1161
        // Two-digit number representing the card's expiration month.
1162
        ExpMonth int64 `json:"exp_month"`
1163
        // Four-digit number representing the card's expiration year.
1164
        ExpYear int64 `json:"exp_year"`
1165
        // 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.
1166
        //
1167
        // *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.*
1168
        Fingerprint string `json:"fingerprint"`
1169
        // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
1170
        Funding string `json:"funding"`
1171
        // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
1172
        IIN string `json:"iin"`
1173
        // The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
1174
        Issuer string `json:"issuer"`
1175
        // The last four digits of the card.
1176
        Last4 string `json:"last4"`
1177
        // Contains information about card networks that can be used to process the payment.
1178
        Networks *PaymentMethodInteracPresentNetworks `json:"networks"`
1179
        // EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
1180
        PreferredLocales []string `json:"preferred_locales"`
1181
        // How card details were read in this transaction.
1182
        ReadMethod PaymentMethodInteracPresentReadMethod `json:"read_method"`
1183
}
1184
type PaymentMethodKakaoPay struct{}
1185

1186
// The customer's date of birth, if provided.
1187
type PaymentMethodKlarnaDOB struct {
1188
        // The day of birth, between 1 and 31.
1189
        Day int64 `json:"day"`
1190
        // The month of birth, between 1 and 12.
1191
        Month int64 `json:"month"`
1192
        // The four-digit year of birth.
1193
        Year int64 `json:"year"`
1194
}
1195
type PaymentMethodKlarna struct {
1196
        // The customer's date of birth, if provided.
1197
        DOB *PaymentMethodKlarnaDOB `json:"dob"`
1198
}
1199
type PaymentMethodKonbini struct{}
1200
type PaymentMethodKrCard struct {
1201
        // The local credit or debit card brand.
1202
        Brand PaymentMethodKrCardBrand `json:"brand"`
1203
        // The last four digits of the card. This may not be present for American Express cards.
1204
        Last4 string `json:"last4"`
1205
}
1206
type PaymentMethodLink struct {
1207
        // Account owner's email address.
1208
        Email string `json:"email"`
1209
        // [Deprecated] This is a legacy parameter that no longer has any function.
1210
        // Deprecated:
1211
        PersistentToken string `json:"persistent_token"`
1212
}
1213
type PaymentMethodMbWay struct{}
1214
type PaymentMethodMobilepay struct{}
1215
type PaymentMethodMultibanco struct{}
1216
type PaymentMethodNaverPay struct {
1217
        // Whether to fund this transaction with Naver Pay points or a card.
1218
        Funding PaymentMethodNaverPayFunding `json:"funding"`
1219
}
1220
type PaymentMethodOXXO struct{}
1221
type PaymentMethodP24 struct {
1222
        // The customer's bank, if provided.
1223
        Bank string `json:"bank"`
1224
}
1225
type PaymentMethodPayco struct{}
1226
type PaymentMethodPayNow struct{}
1227
type PaymentMethodPaypal struct {
1228
        // Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same.
1229
        Fingerprint string `json:"fingerprint"`
1230
        // Owner's email. Values are provided by PayPal directly
1231
        // (if supported) at the time of authorization or settlement. They cannot be set or mutated.
1232
        PayerEmail string `json:"payer_email"`
1233
        // PayPal account PayerID. This identifier uniquely identifies the PayPal customer.
1234
        PayerID string `json:"payer_id"`
1235
        // Owner's verified email. Values are verified or provided by PayPal directly
1236
        // (if supported) at the time of authorization or settlement. They cannot be set or mutated.
1237
        VerifiedEmail string `json:"verified_email"`
1238
}
1239
type PaymentMethodPayto struct {
1240
        // Bank-State-Branch number of the bank account.
1241
        BSBNumber string `json:"bsb_number"`
1242
        // Last four digits of the bank account number.
1243
        Last4 string `json:"last4"`
1244
        // The PayID alias for the bank account.
1245
        PayID string `json:"pay_id"`
1246
}
1247
type PaymentMethodPix struct{}
1248
type PaymentMethodPromptPay struct{}
1249

1250
// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
1251
type PaymentMethodRadarOptions struct {
1252
        // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
1253
        Session string `json:"session"`
1254
}
1255
type PaymentMethodRechnungDOB struct {
1256
        // The day of birth, between 1 and 31.
1257
        Day int64 `json:"day"`
1258
        // The month of birth, between 1 and 12.
1259
        Month int64 `json:"month"`
1260
        // The four-digit year of birth.
1261
        Year int64 `json:"year"`
1262
}
1263
type PaymentMethodRechnung struct {
1264
        DOB *PaymentMethodRechnungDOB `json:"dob"`
1265
}
1266
type PaymentMethodRevolutPay struct{}
1267
type PaymentMethodSamsungPay struct{}
1268

1269
// Information about the object that generated this PaymentMethod.
1270
type PaymentMethodSEPADebitGeneratedFrom struct {
1271
        // The ID of the Charge that generated this PaymentMethod, if any.
1272
        Charge *Charge `json:"charge"`
1273
        // The ID of the SetupAttempt that generated this PaymentMethod, if any.
1274
        SetupAttempt *SetupAttempt `json:"setup_attempt"`
1275
}
1276
type PaymentMethodSEPADebit struct {
1277
        // Bank code of bank associated with the bank account.
1278
        BankCode string `json:"bank_code"`
1279
        // Branch code of bank associated with the bank account.
1280
        BranchCode string `json:"branch_code"`
1281
        // Two-letter ISO code representing the country the bank account is located in.
1282
        Country string `json:"country"`
1283
        // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
1284
        Fingerprint string `json:"fingerprint"`
1285
        // Information about the object that generated this PaymentMethod.
1286
        GeneratedFrom *PaymentMethodSEPADebitGeneratedFrom `json:"generated_from"`
1287
        // Last four characters of the IBAN.
1288
        Last4 string `json:"last4"`
1289
}
1290
type PaymentMethodSofort struct {
1291
        // Two-letter ISO code representing the country the bank account is located in.
1292
        Country string `json:"country"`
1293
}
1294
type PaymentMethodSwish struct{}
1295
type PaymentMethodTWINT struct{}
1296

1297
// Contains information about US bank account networks that can be used.
1298
type PaymentMethodUSBankAccountNetworks struct {
1299
        // The preferred network.
1300
        Preferred string `json:"preferred"`
1301
        // All supported networks.
1302
        Supported []PaymentMethodUSBankAccountNetworksSupported `json:"supported"`
1303
}
1304
type PaymentMethodUSBankAccountStatusDetailsBlocked struct {
1305
        // The ACH network code that resulted in this block.
1306
        NetworkCode PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode `json:"network_code"`
1307
        // The reason why this PaymentMethod's fingerprint has been blocked
1308
        Reason PaymentMethodUSBankAccountStatusDetailsBlockedReason `json:"reason"`
1309
}
1310

1311
// Contains information about the future reusability of this PaymentMethod.
1312
type PaymentMethodUSBankAccountStatusDetails struct {
1313
        Blocked *PaymentMethodUSBankAccountStatusDetailsBlocked `json:"blocked"`
1314
}
1315
type PaymentMethodUSBankAccount struct {
1316
        // Account holder type: individual or company.
1317
        AccountHolderType PaymentMethodUSBankAccountAccountHolderType `json:"account_holder_type"`
1318
        // Account number of the bank account.
1319
        AccountNumber string `json:"account_number"`
1320
        // Account type: checkings or savings. Defaults to checking if omitted.
1321
        AccountType PaymentMethodUSBankAccountAccountType `json:"account_type"`
1322
        // The name of the bank.
1323
        BankName string `json:"bank_name"`
1324
        // The ID of the Financial Connections Account used to create the payment method.
1325
        FinancialConnectionsAccount string `json:"financial_connections_account"`
1326
        // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
1327
        Fingerprint string `json:"fingerprint"`
1328
        // Last four digits of the bank account number.
1329
        Last4 string `json:"last4"`
1330
        // Contains information about US bank account networks that can be used.
1331
        Networks *PaymentMethodUSBankAccountNetworks `json:"networks"`
1332
        // Routing number of the bank account.
1333
        RoutingNumber string `json:"routing_number"`
1334
        // Contains information about the future reusability of this PaymentMethod.
1335
        StatusDetails *PaymentMethodUSBankAccountStatusDetails `json:"status_details"`
1336
}
1337
type PaymentMethodWeChatPay struct{}
1338
type PaymentMethodZip struct{}
1339

1340
// PaymentMethod objects represent your customer's payment instruments.
1341
// You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
1342
// Customer objects to store instrument details for future payments.
1343
//
1344
// Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
1345
type PaymentMethod struct {
1346
        APIResource
1347
        ACSSDebit        *PaymentMethodACSSDebit        `json:"acss_debit"`
1348
        Affirm           *PaymentMethodAffirm           `json:"affirm"`
1349
        AfterpayClearpay *PaymentMethodAfterpayClearpay `json:"afterpay_clearpay"`
1350
        Alipay           *PaymentMethodAlipay           `json:"alipay"`
1351
        // This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
1352
        AllowRedisplay PaymentMethodAllowRedisplay  `json:"allow_redisplay"`
1353
        AmazonPay      *PaymentMethodAmazonPay      `json:"amazon_pay"`
1354
        AUBECSDebit    *PaymentMethodAUBECSDebit    `json:"au_becs_debit"`
1355
        BACSDebit      *PaymentMethodBACSDebit      `json:"bacs_debit"`
1356
        Bancontact     *PaymentMethodBancontact     `json:"bancontact"`
1357
        BillingDetails *PaymentMethodBillingDetails `json:"billing_details"`
1358
        BLIK           *PaymentMethodBLIK           `json:"blik"`
1359
        Boleto         *PaymentMethodBoleto         `json:"boleto"`
1360
        Card           *PaymentMethodCard           `json:"card"`
1361
        CardPresent    *PaymentMethodCardPresent    `json:"card_present"`
1362
        CashApp        *PaymentMethodCashApp        `json:"cashapp"`
1363
        // Time at which the object was created. Measured in seconds since the Unix epoch.
1364
        Created int64 `json:"created"`
1365
        // The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
1366
        Customer        *Customer                     `json:"customer"`
1367
        CustomerBalance *PaymentMethodCustomerBalance `json:"customer_balance"`
1368
        EPS             *PaymentMethodEPS             `json:"eps"`
1369
        FPX             *PaymentMethodFPX             `json:"fpx"`
1370
        Giropay         *PaymentMethodGiropay         `json:"giropay"`
1371
        Grabpay         *PaymentMethodGrabpay         `json:"grabpay"`
1372
        // Unique identifier for the object.
1373
        ID             string                       `json:"id"`
1374
        IDEAL          *PaymentMethodIDEAL          `json:"ideal"`
1375
        InteracPresent *PaymentMethodInteracPresent `json:"interac_present"`
1376
        KakaoPay       *PaymentMethodKakaoPay       `json:"kakao_pay"`
1377
        Klarna         *PaymentMethodKlarna         `json:"klarna"`
1378
        Konbini        *PaymentMethodKonbini        `json:"konbini"`
1379
        KrCard         *PaymentMethodKrCard         `json:"kr_card"`
1380
        Link           *PaymentMethodLink           `json:"link"`
1381
        // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
1382
        Livemode bool                `json:"livemode"`
1383
        MbWay    *PaymentMethodMbWay `json:"mb_way"`
1384
        // 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.
1385
        Metadata   map[string]string        `json:"metadata"`
1386
        Mobilepay  *PaymentMethodMobilepay  `json:"mobilepay"`
1387
        Multibanco *PaymentMethodMultibanco `json:"multibanco"`
1388
        NaverPay   *PaymentMethodNaverPay   `json:"naver_pay"`
1389
        // String representing the object's type. Objects of the same type share the same value.
1390
        Object    string                  `json:"object"`
1391
        OXXO      *PaymentMethodOXXO      `json:"oxxo"`
1392
        P24       *PaymentMethodP24       `json:"p24"`
1393
        Payco     *PaymentMethodPayco     `json:"payco"`
1394
        PayNow    *PaymentMethodPayNow    `json:"paynow"`
1395
        Paypal    *PaymentMethodPaypal    `json:"paypal"`
1396
        Payto     *PaymentMethodPayto     `json:"payto"`
1397
        Pix       *PaymentMethodPix       `json:"pix"`
1398
        PromptPay *PaymentMethodPromptPay `json:"promptpay"`
1399
        // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
1400
        RadarOptions *PaymentMethodRadarOptions `json:"radar_options"`
1401
        Rechnung     *PaymentMethodRechnung     `json:"rechnung"`
1402
        RevolutPay   *PaymentMethodRevolutPay   `json:"revolut_pay"`
1403
        SamsungPay   *PaymentMethodSamsungPay   `json:"samsung_pay"`
1404
        SEPADebit    *PaymentMethodSEPADebit    `json:"sepa_debit"`
1405
        Sofort       *PaymentMethodSofort       `json:"sofort"`
1406
        Swish        *PaymentMethodSwish        `json:"swish"`
1407
        TWINT        *PaymentMethodTWINT        `json:"twint"`
1408
        // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
1409
        Type          PaymentMethodType           `json:"type"`
1410
        USBankAccount *PaymentMethodUSBankAccount `json:"us_bank_account"`
1411
        WeChatPay     *PaymentMethodWeChatPay     `json:"wechat_pay"`
1412
        Zip           *PaymentMethodZip           `json:"zip"`
1413
}
1414

1415
// PaymentMethodList is a list of PaymentMethods as retrieved from a list endpoint.
1416
type PaymentMethodList struct {
1417
        APIResource
1418
        ListMeta
1419
        Data []*PaymentMethod `json:"data"`
1420
}
1421

1422
// UnmarshalJSON handles deserialization of a PaymentMethod.
1423
// This custom unmarshaling is needed because the resulting
1424
// property may be an id or the full struct if it was expanded.
UNCOV
1425
func (p *PaymentMethod) UnmarshalJSON(data []byte) error {
×
UNCOV
1426
        if id, ok := ParseID(data); ok {
×
UNCOV
1427
                p.ID = id
×
UNCOV
1428
                return nil
×
1429
        }
×
1430

UNCOV
1431
        type paymentMethod PaymentMethod
×
UNCOV
1432
        var v paymentMethod
×
UNCOV
1433
        if err := json.Unmarshal(data, &v); err != nil {
×
UNCOV
1434
                return err
×
UNCOV
1435
        }
×
1436

UNCOV
1437
        *p = PaymentMethod(v)
×
UNCOV
1438
        return nil
×
1439
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc