github.com/stripe/stripe-go/v76@v76.25.0/paymentmethod.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  import "encoding/json"
    10  
    11  // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
    12  type PaymentMethodCardBrand string
    13  
    14  // List of values that PaymentMethodCardBrand can take
    15  const (
    16  	PaymentMethodCardBrandAmex       PaymentMethodCardBrand = "amex"
    17  	PaymentMethodCardBrandDiners     PaymentMethodCardBrand = "diners"
    18  	PaymentMethodCardBrandDiscover   PaymentMethodCardBrand = "discover"
    19  	PaymentMethodCardBrandJCB        PaymentMethodCardBrand = "jcb"
    20  	PaymentMethodCardBrandMastercard PaymentMethodCardBrand = "mastercard"
    21  	PaymentMethodCardBrandUnionpay   PaymentMethodCardBrand = "unionpay"
    22  	PaymentMethodCardBrandUnknown    PaymentMethodCardBrand = "unknown"
    23  	PaymentMethodCardBrandVisa       PaymentMethodCardBrand = "visa"
    24  )
    25  
    26  // If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
    27  type PaymentMethodCardChecksAddressLine1Check string
    28  
    29  // List of values that PaymentMethodCardChecksAddressLine1Check can take
    30  const (
    31  	PaymentMethodCardChecksAddressLine1CheckFail        PaymentMethodCardChecksAddressLine1Check = "fail"
    32  	PaymentMethodCardChecksAddressLine1CheckPass        PaymentMethodCardChecksAddressLine1Check = "pass"
    33  	PaymentMethodCardChecksAddressLine1CheckUnavailable PaymentMethodCardChecksAddressLine1Check = "unavailable"
    34  	PaymentMethodCardChecksAddressLine1CheckUnchecked   PaymentMethodCardChecksAddressLine1Check = "unchecked"
    35  )
    36  
    37  // If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
    38  type PaymentMethodCardChecksAddressPostalCodeCheck string
    39  
    40  // List of values that PaymentMethodCardChecksAddressPostalCodeCheck can take
    41  const (
    42  	PaymentMethodCardChecksAddressPostalCodeCheckFail        PaymentMethodCardChecksAddressPostalCodeCheck = "fail"
    43  	PaymentMethodCardChecksAddressPostalCodeCheckPass        PaymentMethodCardChecksAddressPostalCodeCheck = "pass"
    44  	PaymentMethodCardChecksAddressPostalCodeCheckUnavailable PaymentMethodCardChecksAddressPostalCodeCheck = "unavailable"
    45  	PaymentMethodCardChecksAddressPostalCodeCheckUnchecked   PaymentMethodCardChecksAddressPostalCodeCheck = "unchecked"
    46  )
    47  
    48  // If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
    49  type PaymentMethodCardChecksCVCCheck string
    50  
    51  // List of values that PaymentMethodCardChecksCVCCheck can take
    52  const (
    53  	PaymentMethodCardChecksCVCCheckFail        PaymentMethodCardChecksCVCCheck = "fail"
    54  	PaymentMethodCardChecksCVCCheckPass        PaymentMethodCardChecksCVCCheck = "pass"
    55  	PaymentMethodCardChecksCVCCheckUnavailable PaymentMethodCardChecksCVCCheck = "unavailable"
    56  	PaymentMethodCardChecksCVCCheckUnchecked   PaymentMethodCardChecksCVCCheck = "unchecked"
    57  )
    58  
    59  // All available networks for the card.
    60  type PaymentMethodCardNetworksAvailable string
    61  
    62  // List of values that PaymentMethodCardNetworksAvailable can take
    63  const (
    64  	PaymentMethodCardNetworksAvailableAmex            PaymentMethodCardNetworksAvailable = "amex"
    65  	PaymentMethodCardNetworksAvailableCartesBancaires PaymentMethodCardNetworksAvailable = "cartes_bancaires"
    66  	PaymentMethodCardNetworksAvailableDiners          PaymentMethodCardNetworksAvailable = "diners"
    67  	PaymentMethodCardNetworksAvailableDiscover        PaymentMethodCardNetworksAvailable = "discover"
    68  	PaymentMethodCardNetworksAvailableInterac         PaymentMethodCardNetworksAvailable = "interac"
    69  	PaymentMethodCardNetworksAvailableJCB             PaymentMethodCardNetworksAvailable = "jcb"
    70  	PaymentMethodCardNetworksAvailableMastercard      PaymentMethodCardNetworksAvailable = "mastercard"
    71  	PaymentMethodCardNetworksAvailableUnionpay        PaymentMethodCardNetworksAvailable = "unionpay"
    72  	PaymentMethodCardNetworksAvailableVisa            PaymentMethodCardNetworksAvailable = "visa"
    73  	PaymentMethodCardNetworksAvailableUnknown         PaymentMethodCardNetworksAvailable = "unknown"
    74  )
    75  
    76  // 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.
    77  type PaymentMethodCardNetworksPreferred string
    78  
    79  // List of values that PaymentMethodCardNetworksPreferred can take
    80  const (
    81  	PaymentMethodCardNetworksPreferredAmex            PaymentMethodCardNetworksPreferred = "amex"
    82  	PaymentMethodCardNetworksPreferredCartesBancaires PaymentMethodCardNetworksPreferred = "cartes_bancaires"
    83  	PaymentMethodCardNetworksPreferredDiners          PaymentMethodCardNetworksPreferred = "diners"
    84  	PaymentMethodCardNetworksPreferredDiscover        PaymentMethodCardNetworksPreferred = "discover"
    85  	PaymentMethodCardNetworksPreferredInterac         PaymentMethodCardNetworksPreferred = "interac"
    86  	PaymentMethodCardNetworksPreferredJCB             PaymentMethodCardNetworksPreferred = "jcb"
    87  	PaymentMethodCardNetworksPreferredMastercard      PaymentMethodCardNetworksPreferred = "mastercard"
    88  	PaymentMethodCardNetworksPreferredUnionpay        PaymentMethodCardNetworksPreferred = "unionpay"
    89  	PaymentMethodCardNetworksPreferredVisa            PaymentMethodCardNetworksPreferred = "visa"
    90  	PaymentMethodCardNetworksPreferredUnknown         PaymentMethodCardNetworksPreferred = "unknown"
    91  )
    92  
    93  // 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.
    94  type PaymentMethodCardWalletType string
    95  
    96  // List of values that PaymentMethodCardWalletType can take
    97  const (
    98  	PaymentMethodCardWalletTypeAmexExpressCheckout PaymentMethodCardWalletType = "amex_express_checkout"
    99  	PaymentMethodCardWalletTypeApplePay            PaymentMethodCardWalletType = "apple_pay"
   100  	PaymentMethodCardWalletTypeGooglePay           PaymentMethodCardWalletType = "google_pay"
   101  	PaymentMethodCardWalletTypeLink                PaymentMethodCardWalletType = "link"
   102  	PaymentMethodCardWalletTypeMasterpass          PaymentMethodCardWalletType = "masterpass"
   103  	PaymentMethodCardWalletTypeSamsungPay          PaymentMethodCardWalletType = "samsung_pay"
   104  	PaymentMethodCardWalletTypeVisaCheckout        PaymentMethodCardWalletType = "visa_checkout"
   105  )
   106  
   107  // How card details were read in this transaction.
   108  type PaymentMethodCardPresentReadMethod string
   109  
   110  // List of values that PaymentMethodCardPresentReadMethod can take
   111  const (
   112  	PaymentMethodCardPresentReadMethodContactEmv               PaymentMethodCardPresentReadMethod = "contact_emv"
   113  	PaymentMethodCardPresentReadMethodContactlessEmv           PaymentMethodCardPresentReadMethod = "contactless_emv"
   114  	PaymentMethodCardPresentReadMethodContactlessMagstripeMode PaymentMethodCardPresentReadMethod = "contactless_magstripe_mode"
   115  	PaymentMethodCardPresentReadMethodMagneticStripeFallback   PaymentMethodCardPresentReadMethod = "magnetic_stripe_fallback"
   116  	PaymentMethodCardPresentReadMethodMagneticStripeTrack2     PaymentMethodCardPresentReadMethod = "magnetic_stripe_track2"
   117  )
   118  
   119  // Account holder type, if provided. Can be one of `individual` or `company`.
   120  type PaymentMethodFPXAccountHolderType string
   121  
   122  // List of values that PaymentMethodFPXAccountHolderType can take
   123  const (
   124  	PaymentMethodFPXAccountHolderTypeCompany    PaymentMethodFPXAccountHolderType = "company"
   125  	PaymentMethodFPXAccountHolderTypeIndividual PaymentMethodFPXAccountHolderType = "individual"
   126  )
   127  
   128  // How card details were read in this transaction.
   129  type PaymentMethodInteracPresentReadMethod string
   130  
   131  // List of values that PaymentMethodInteracPresentReadMethod can take
   132  const (
   133  	PaymentMethodInteracPresentReadMethodContactEmv               PaymentMethodInteracPresentReadMethod = "contact_emv"
   134  	PaymentMethodInteracPresentReadMethodContactlessEmv           PaymentMethodInteracPresentReadMethod = "contactless_emv"
   135  	PaymentMethodInteracPresentReadMethodContactlessMagstripeMode PaymentMethodInteracPresentReadMethod = "contactless_magstripe_mode"
   136  	PaymentMethodInteracPresentReadMethodMagneticStripeFallback   PaymentMethodInteracPresentReadMethod = "magnetic_stripe_fallback"
   137  	PaymentMethodInteracPresentReadMethodMagneticStripeTrack2     PaymentMethodInteracPresentReadMethod = "magnetic_stripe_track2"
   138  )
   139  
   140  // 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.
   141  type PaymentMethodType string
   142  
   143  // List of values that PaymentMethodType can take
   144  const (
   145  	PaymentMethodTypeACSSDebit        PaymentMethodType = "acss_debit"
   146  	PaymentMethodTypeAffirm           PaymentMethodType = "affirm"
   147  	PaymentMethodTypeAfterpayClearpay PaymentMethodType = "afterpay_clearpay"
   148  	PaymentMethodTypeAlipay           PaymentMethodType = "alipay"
   149  	PaymentMethodTypeAUBECSDebit      PaymentMethodType = "au_becs_debit"
   150  	PaymentMethodTypeBACSDebit        PaymentMethodType = "bacs_debit"
   151  	PaymentMethodTypeBancontact       PaymentMethodType = "bancontact"
   152  	PaymentMethodTypeBLIK             PaymentMethodType = "blik"
   153  	PaymentMethodTypeBoleto           PaymentMethodType = "boleto"
   154  	PaymentMethodTypeCard             PaymentMethodType = "card"
   155  	PaymentMethodTypeCardPresent      PaymentMethodType = "card_present"
   156  	PaymentMethodTypeCashApp          PaymentMethodType = "cashapp"
   157  	PaymentMethodTypeCustomerBalance  PaymentMethodType = "customer_balance"
   158  	PaymentMethodTypeEPS              PaymentMethodType = "eps"
   159  	PaymentMethodTypeFPX              PaymentMethodType = "fpx"
   160  	PaymentMethodTypeGiropay          PaymentMethodType = "giropay"
   161  	PaymentMethodTypeGrabpay          PaymentMethodType = "grabpay"
   162  	PaymentMethodTypeIDEAL            PaymentMethodType = "ideal"
   163  	PaymentMethodTypeInteracPresent   PaymentMethodType = "interac_present"
   164  	PaymentMethodTypeKlarna           PaymentMethodType = "klarna"
   165  	PaymentMethodTypeKonbini          PaymentMethodType = "konbini"
   166  	PaymentMethodTypeLink             PaymentMethodType = "link"
   167  	PaymentMethodTypeMobilepay        PaymentMethodType = "mobilepay"
   168  	PaymentMethodTypeOXXO             PaymentMethodType = "oxxo"
   169  	PaymentMethodTypeP24              PaymentMethodType = "p24"
   170  	PaymentMethodTypePayNow           PaymentMethodType = "paynow"
   171  	PaymentMethodTypePaypal           PaymentMethodType = "paypal"
   172  	PaymentMethodTypePix              PaymentMethodType = "pix"
   173  	PaymentMethodTypePromptPay        PaymentMethodType = "promptpay"
   174  	PaymentMethodTypeRevolutPay       PaymentMethodType = "revolut_pay"
   175  	PaymentMethodTypeSEPADebit        PaymentMethodType = "sepa_debit"
   176  	PaymentMethodTypeSofort           PaymentMethodType = "sofort"
   177  	PaymentMethodTypeSwish            PaymentMethodType = "swish"
   178  	PaymentMethodTypeUSBankAccount    PaymentMethodType = "us_bank_account"
   179  	PaymentMethodTypeWeChatPay        PaymentMethodType = "wechat_pay"
   180  	PaymentMethodTypeZip              PaymentMethodType = "zip"
   181  )
   182  
   183  // Account holder type: individual or company.
   184  type PaymentMethodUSBankAccountAccountHolderType string
   185  
   186  // List of values that PaymentMethodUSBankAccountAccountHolderType can take
   187  const (
   188  	PaymentMethodUSBankAccountAccountHolderTypeCompany    PaymentMethodUSBankAccountAccountHolderType = "company"
   189  	PaymentMethodUSBankAccountAccountHolderTypeIndividual PaymentMethodUSBankAccountAccountHolderType = "individual"
   190  )
   191  
   192  // Account type: checkings or savings. Defaults to checking if omitted.
   193  type PaymentMethodUSBankAccountAccountType string
   194  
   195  // List of values that PaymentMethodUSBankAccountAccountType can take
   196  const (
   197  	PaymentMethodUSBankAccountAccountTypeChecking PaymentMethodUSBankAccountAccountType = "checking"
   198  	PaymentMethodUSBankAccountAccountTypeSavings  PaymentMethodUSBankAccountAccountType = "savings"
   199  )
   200  
   201  // All supported networks.
   202  type PaymentMethodUSBankAccountNetworksSupported string
   203  
   204  // List of values that PaymentMethodUSBankAccountNetworksSupported can take
   205  const (
   206  	PaymentMethodUSBankAccountNetworksSupportedACH            PaymentMethodUSBankAccountNetworksSupported = "ach"
   207  	PaymentMethodUSBankAccountNetworksSupportedUSDomesticWire PaymentMethodUSBankAccountNetworksSupported = "us_domestic_wire"
   208  )
   209  
   210  // The ACH network code that resulted in this block.
   211  type PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode string
   212  
   213  // List of values that PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode can take
   214  const (
   215  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR02 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R02"
   216  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR03 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R03"
   217  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR04 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R04"
   218  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR05 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R05"
   219  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR07 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R07"
   220  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR08 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R08"
   221  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR10 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R10"
   222  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR11 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R11"
   223  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR16 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R16"
   224  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR20 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R20"
   225  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR29 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R29"
   226  	PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCodeR31 PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode = "R31"
   227  )
   228  
   229  // The reason why this PaymentMethod's fingerprint has been blocked
   230  type PaymentMethodUSBankAccountStatusDetailsBlockedReason string
   231  
   232  // List of values that PaymentMethodUSBankAccountStatusDetailsBlockedReason can take
   233  const (
   234  	PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountClosed         PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_closed"
   235  	PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountFrozen         PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_frozen"
   236  	PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountInvalidDetails PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_invalid_details"
   237  	PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountRestricted     PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_restricted"
   238  	PaymentMethodUSBankAccountStatusDetailsBlockedReasonBankAccountUnusable       PaymentMethodUSBankAccountStatusDetailsBlockedReason = "bank_account_unusable"
   239  	PaymentMethodUSBankAccountStatusDetailsBlockedReasonDebitNotAuthorized        PaymentMethodUSBankAccountStatusDetailsBlockedReason = "debit_not_authorized"
   240  )
   241  
   242  // 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.
   243  type PaymentMethodListParams struct {
   244  	ListParams `form:"*"`
   245  	// The ID of the customer whose PaymentMethods will be retrieved.
   246  	Customer *string `form:"customer"`
   247  	// Specifies which fields in the response should be expanded.
   248  	Expand []*string `form:"expand"`
   249  	// 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.
   250  	Type *string `form:"type"`
   251  }
   252  
   253  // AddExpand appends a new field to expand.
   254  func (p *PaymentMethodListParams) AddExpand(f string) {
   255  	p.Expand = append(p.Expand, &f)
   256  }
   257  
   258  // If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
   259  type PaymentMethodACSSDebitParams struct {
   260  	// Customer's bank account number.
   261  	AccountNumber *string `form:"account_number"`
   262  	// Institution number of the customer's bank.
   263  	InstitutionNumber *string `form:"institution_number"`
   264  	// Transit number of the customer's bank.
   265  	TransitNumber *string `form:"transit_number"`
   266  }
   267  
   268  // If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
   269  type PaymentMethodAffirmParams struct{}
   270  
   271  // If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
   272  type PaymentMethodAfterpayClearpayParams struct{}
   273  
   274  // If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
   275  type PaymentMethodAlipayParams struct{}
   276  
   277  // If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
   278  type PaymentMethodAUBECSDebitParams struct {
   279  	// The account number for the bank account.
   280  	AccountNumber *string `form:"account_number"`
   281  	// Bank-State-Branch number of the bank account.
   282  	BSBNumber *string `form:"bsb_number"`
   283  }
   284  
   285  // If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
   286  type PaymentMethodBACSDebitParams struct {
   287  	// Account number of the bank account that the funds will be debited from.
   288  	AccountNumber *string `form:"account_number"`
   289  	// Sort code of the bank account. (e.g., `10-20-30`)
   290  	SortCode *string `form:"sort_code"`
   291  }
   292  
   293  // If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
   294  type PaymentMethodBancontactParams struct{}
   295  
   296  // Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
   297  type PaymentMethodBillingDetailsParams struct {
   298  	// Billing address.
   299  	Address *AddressParams `form:"address"`
   300  	// Email address.
   301  	Email *string `form:"email"`
   302  	// Full name.
   303  	Name *string `form:"name"`
   304  	// Billing phone number (including extension).
   305  	Phone *string `form:"phone"`
   306  }
   307  
   308  // If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
   309  type PaymentMethodBLIKParams struct{}
   310  
   311  // If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
   312  type PaymentMethodBoletoParams struct {
   313  	// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
   314  	TaxID *string `form:"tax_id"`
   315  }
   316  
   317  // Contains information about card networks used to process the payment.
   318  type PaymentMethodCardNetworksParams struct {
   319  	// 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.
   320  	Preferred *string `form:"preferred"`
   321  }
   322  
   323  // 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.
   324  type PaymentMethodCardParams struct {
   325  	// The card's CVC. It is highly recommended to always include this value.
   326  	CVC *string `form:"cvc"`
   327  	// Two-digit number representing the card's expiration month.
   328  	ExpMonth *int64 `form:"exp_month"`
   329  	// Four-digit number representing the card's expiration year.
   330  	ExpYear *int64 `form:"exp_year"`
   331  	// Contains information about card networks used to process the payment.
   332  	Networks *PaymentMethodCardNetworksParams `form:"networks"`
   333  	// The card number, as a string without any separators.
   334  	Number *string `form:"number"`
   335  	// 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"}.
   336  	Token *string `form:"token"`
   337  }
   338  
   339  // If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
   340  type PaymentMethodCashAppParams struct{}
   341  
   342  // If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
   343  type PaymentMethodCustomerBalanceParams struct{}
   344  
   345  // If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
   346  type PaymentMethodEPSParams struct {
   347  	// The customer's bank.
   348  	Bank *string `form:"bank"`
   349  }
   350  
   351  // If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
   352  type PaymentMethodFPXParams struct {
   353  	// Account holder type for FPX transaction
   354  	AccountHolderType *string `form:"account_holder_type"`
   355  	// The customer's bank.
   356  	Bank *string `form:"bank"`
   357  }
   358  
   359  // If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
   360  type PaymentMethodGiropayParams struct{}
   361  
   362  // If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
   363  type PaymentMethodGrabpayParams struct{}
   364  
   365  // If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
   366  type PaymentMethodIDEALParams struct {
   367  	// The customer's bank.
   368  	Bank *string `form:"bank"`
   369  }
   370  
   371  // If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
   372  type PaymentMethodInteracPresentParams struct{}
   373  
   374  // Customer's date of birth
   375  type PaymentMethodKlarnaDOBParams struct {
   376  	// The day of birth, between 1 and 31.
   377  	Day *int64 `form:"day"`
   378  	// The month of birth, between 1 and 12.
   379  	Month *int64 `form:"month"`
   380  	// The four-digit year of birth.
   381  	Year *int64 `form:"year"`
   382  }
   383  
   384  // If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
   385  type PaymentMethodKlarnaParams struct {
   386  	// Customer's date of birth
   387  	DOB *PaymentMethodKlarnaDOBParams `form:"dob"`
   388  }
   389  
   390  // If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
   391  type PaymentMethodKonbiniParams struct{}
   392  
   393  // If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
   394  type PaymentMethodLinkParams struct{}
   395  
   396  // If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
   397  type PaymentMethodMobilepayParams struct{}
   398  
   399  // If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
   400  type PaymentMethodOXXOParams struct{}
   401  
   402  // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
   403  type PaymentMethodP24Params struct {
   404  	// The customer's bank.
   405  	Bank *string `form:"bank"`
   406  }
   407  
   408  // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
   409  type PaymentMethodPayNowParams struct{}
   410  
   411  // If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
   412  type PaymentMethodPaypalParams struct{}
   413  
   414  // If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
   415  type PaymentMethodPixParams struct{}
   416  
   417  // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
   418  type PaymentMethodPromptPayParams struct{}
   419  
   420  // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
   421  type PaymentMethodRadarOptionsParams struct {
   422  	// 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.
   423  	Session *string `form:"session"`
   424  }
   425  
   426  // If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
   427  type PaymentMethodRevolutPayParams struct{}
   428  
   429  // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
   430  type PaymentMethodSEPADebitParams struct {
   431  	// IBAN of the bank account.
   432  	IBAN *string `form:"iban"`
   433  }
   434  
   435  // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
   436  type PaymentMethodSofortParams struct {
   437  	// Two-letter ISO code representing the country the bank account is located in.
   438  	Country *string `form:"country"`
   439  }
   440  
   441  // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
   442  type PaymentMethodSwishParams struct{}
   443  
   444  // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
   445  type PaymentMethodUSBankAccountParams struct {
   446  	// Account holder type: individual or company.
   447  	AccountHolderType *string `form:"account_holder_type"`
   448  	// Account number of the bank account.
   449  	AccountNumber *string `form:"account_number"`
   450  	// Account type: checkings or savings. Defaults to checking if omitted.
   451  	AccountType *string `form:"account_type"`
   452  	// The ID of a Financial Connections Account to use as a payment method.
   453  	FinancialConnectionsAccount *string `form:"financial_connections_account"`
   454  	// Routing number of the bank account.
   455  	RoutingNumber *string `form:"routing_number"`
   456  }
   457  
   458  // If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
   459  type PaymentMethodWeChatPayParams struct{}
   460  
   461  // If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
   462  type PaymentMethodZipParams struct{}
   463  
   464  // 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.
   465  //
   466  // 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.
   467  type PaymentMethodParams struct {
   468  	Params `form:"*"`
   469  	// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
   470  	ACSSDebit *PaymentMethodACSSDebitParams `form:"acss_debit"`
   471  	// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
   472  	Affirm *PaymentMethodAffirmParams `form:"affirm"`
   473  	// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
   474  	AfterpayClearpay *PaymentMethodAfterpayClearpayParams `form:"afterpay_clearpay"`
   475  	// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
   476  	Alipay *PaymentMethodAlipayParams `form:"alipay"`
   477  	// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
   478  	AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit"`
   479  	// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
   480  	BACSDebit *PaymentMethodBACSDebitParams `form:"bacs_debit"`
   481  	// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
   482  	Bancontact *PaymentMethodBancontactParams `form:"bancontact"`
   483  	// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
   484  	BillingDetails *PaymentMethodBillingDetailsParams `form:"billing_details"`
   485  	// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
   486  	BLIK *PaymentMethodBLIKParams `form:"blik"`
   487  	// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
   488  	Boleto *PaymentMethodBoletoParams `form:"boleto"`
   489  	// 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.
   490  	Card *PaymentMethodCardParams `form:"card"`
   491  	// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
   492  	CashApp *PaymentMethodCashAppParams `form:"cashapp"`
   493  	// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
   494  	CustomerBalance *PaymentMethodCustomerBalanceParams `form:"customer_balance"`
   495  	// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
   496  	EPS *PaymentMethodEPSParams `form:"eps"`
   497  	// Specifies which fields in the response should be expanded.
   498  	Expand []*string `form:"expand"`
   499  	// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
   500  	FPX *PaymentMethodFPXParams `form:"fpx"`
   501  	// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
   502  	Giropay *PaymentMethodGiropayParams `form:"giropay"`
   503  	// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
   504  	Grabpay *PaymentMethodGrabpayParams `form:"grabpay"`
   505  	// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
   506  	IDEAL *PaymentMethodIDEALParams `form:"ideal"`
   507  	// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
   508  	InteracPresent *PaymentMethodInteracPresentParams `form:"interac_present"`
   509  	// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
   510  	Klarna *PaymentMethodKlarnaParams `form:"klarna"`
   511  	// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
   512  	Konbini *PaymentMethodKonbiniParams `form:"konbini"`
   513  	// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
   514  	Link *PaymentMethodLinkParams `form:"link"`
   515  	// 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`.
   516  	Metadata map[string]string `form:"metadata"`
   517  	// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
   518  	Mobilepay *PaymentMethodMobilepayParams `form:"mobilepay"`
   519  	// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
   520  	OXXO *PaymentMethodOXXOParams `form:"oxxo"`
   521  	// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
   522  	P24 *PaymentMethodP24Params `form:"p24"`
   523  	// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
   524  	PayNow *PaymentMethodPayNowParams `form:"paynow"`
   525  	// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
   526  	Paypal *PaymentMethodPaypalParams `form:"paypal"`
   527  	// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
   528  	Pix *PaymentMethodPixParams `form:"pix"`
   529  	// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
   530  	PromptPay *PaymentMethodPromptPayParams `form:"promptpay"`
   531  	// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
   532  	RadarOptions *PaymentMethodRadarOptionsParams `form:"radar_options"`
   533  	// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
   534  	RevolutPay *PaymentMethodRevolutPayParams `form:"revolut_pay"`
   535  	// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
   536  	SEPADebit *PaymentMethodSEPADebitParams `form:"sepa_debit"`
   537  	// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
   538  	Sofort *PaymentMethodSofortParams `form:"sofort"`
   539  	// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
   540  	Swish *PaymentMethodSwishParams `form:"swish"`
   541  	// 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.
   542  	Type *string `form:"type"`
   543  	// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
   544  	USBankAccount *PaymentMethodUSBankAccountParams `form:"us_bank_account"`
   545  	// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
   546  	WeChatPay *PaymentMethodWeChatPayParams `form:"wechat_pay"`
   547  	// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
   548  	Zip *PaymentMethodZipParams `form:"zip"`
   549  	// The following parameters are used when cloning a PaymentMethod to the connected account
   550  	// The `Customer` to whom the original PaymentMethod is attached.
   551  	Customer *string `form:"customer"`
   552  	// The PaymentMethod to share.
   553  	PaymentMethod *string `form:"payment_method"`
   554  }
   555  
   556  // AddExpand appends a new field to expand.
   557  func (p *PaymentMethodParams) AddExpand(f string) {
   558  	p.Expand = append(p.Expand, &f)
   559  }
   560  
   561  // AddMetadata adds a new key-value pair to the Metadata.
   562  func (p *PaymentMethodParams) AddMetadata(key string, value string) {
   563  	if p.Metadata == nil {
   564  		p.Metadata = make(map[string]string)
   565  	}
   566  
   567  	p.Metadata[key] = value
   568  }
   569  
   570  // Attaches a PaymentMethod object to a Customer.
   571  //
   572  // To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents)
   573  // or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage).
   574  // These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach
   575  // endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for
   576  // future use, which makes later declines and payment friction more likely.
   577  // See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up
   578  // future payments.
   579  //
   580  // To use this PaymentMethod as the default for invoice or subscription payments,
   581  // set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method),
   582  // on the Customer to the PaymentMethod's ID.
   583  type PaymentMethodAttachParams struct {
   584  	Params `form:"*"`
   585  	// The ID of the customer to which to attach the PaymentMethod.
   586  	Customer *string `form:"customer"`
   587  	// Specifies which fields in the response should be expanded.
   588  	Expand []*string `form:"expand"`
   589  }
   590  
   591  // AddExpand appends a new field to expand.
   592  func (p *PaymentMethodAttachParams) AddExpand(f string) {
   593  	p.Expand = append(p.Expand, &f)
   594  }
   595  
   596  // 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.
   597  type PaymentMethodDetachParams struct {
   598  	Params `form:"*"`
   599  	// Specifies which fields in the response should be expanded.
   600  	Expand []*string `form:"expand"`
   601  }
   602  
   603  // AddExpand appends a new field to expand.
   604  func (p *PaymentMethodDetachParams) AddExpand(f string) {
   605  	p.Expand = append(p.Expand, &f)
   606  }
   607  
   608  type PaymentMethodACSSDebit struct {
   609  	// Name of the bank associated with the bank account.
   610  	BankName string `json:"bank_name"`
   611  	// Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
   612  	Fingerprint string `json:"fingerprint"`
   613  	// Institution number of the bank account.
   614  	InstitutionNumber string `json:"institution_number"`
   615  	// Last four digits of the bank account number.
   616  	Last4 string `json:"last4"`
   617  	// Transit number of the bank account.
   618  	TransitNumber string `json:"transit_number"`
   619  }
   620  type PaymentMethodAffirm struct{}
   621  type PaymentMethodAfterpayClearpay struct{}
   622  type PaymentMethodAlipay struct{}
   623  type PaymentMethodAUBECSDebit struct {
   624  	// Six-digit number identifying bank and branch associated with this bank account.
   625  	BSBNumber string `json:"bsb_number"`
   626  	// Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
   627  	Fingerprint string `json:"fingerprint"`
   628  	// Last four digits of the bank account number.
   629  	Last4 string `json:"last4"`
   630  }
   631  type PaymentMethodBACSDebit struct {
   632  	// Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
   633  	Fingerprint string `json:"fingerprint"`
   634  	// Last four digits of the bank account number.
   635  	Last4 string `json:"last4"`
   636  	// Sort code of the bank account. (e.g., `10-20-30`)
   637  	SortCode string `json:"sort_code"`
   638  }
   639  type PaymentMethodBancontact struct{}
   640  type PaymentMethodBillingDetails struct {
   641  	// Billing address.
   642  	Address *Address `json:"address"`
   643  	// Email address.
   644  	Email string `json:"email"`
   645  	// Full name.
   646  	Name string `json:"name"`
   647  	// Billing phone number (including extension).
   648  	Phone string `json:"phone"`
   649  }
   650  type PaymentMethodBLIK struct{}
   651  type PaymentMethodBoleto struct {
   652  	// Uniquely identifies the customer tax id (CNPJ or CPF)
   653  	TaxID string `json:"tax_id"`
   654  }
   655  
   656  // Checks on Card address and CVC if provided.
   657  type PaymentMethodCardChecks struct {
   658  	// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
   659  	AddressLine1Check PaymentMethodCardChecksAddressLine1Check `json:"address_line1_check"`
   660  	// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
   661  	AddressPostalCodeCheck PaymentMethodCardChecksAddressPostalCodeCheck `json:"address_postal_code_check"`
   662  	// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
   663  	CVCCheck PaymentMethodCardChecksCVCCheck `json:"cvc_check"`
   664  }
   665  
   666  // Contains information about card networks that can be used to process the payment.
   667  type PaymentMethodCardNetworks struct {
   668  	// All available networks for the card.
   669  	Available []PaymentMethodCardNetworksAvailable `json:"available"`
   670  	// 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.
   671  	Preferred PaymentMethodCardNetworksPreferred `json:"preferred"`
   672  }
   673  
   674  // Contains details on how this Card may be used for 3D Secure authentication.
   675  type PaymentMethodCardThreeDSecureUsage struct {
   676  	// Whether 3D Secure is supported on this card.
   677  	Supported bool `json:"supported"`
   678  }
   679  type PaymentMethodCardWalletAmexExpressCheckout struct{}
   680  type PaymentMethodCardWalletApplePay struct{}
   681  type PaymentMethodCardWalletGooglePay struct{}
   682  type PaymentMethodCardWalletLink struct{}
   683  type PaymentMethodCardWalletMasterpass struct {
   684  	// 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.
   685  	BillingAddress *Address `json:"billing_address"`
   686  	// 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.
   687  	Email string `json:"email"`
   688  	// 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.
   689  	Name string `json:"name"`
   690  	// 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.
   691  	ShippingAddress *Address `json:"shipping_address"`
   692  }
   693  type PaymentMethodCardWalletSamsungPay struct{}
   694  type PaymentMethodCardWalletVisaCheckout struct {
   695  	// 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.
   696  	BillingAddress *Address `json:"billing_address"`
   697  	// 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.
   698  	Email string `json:"email"`
   699  	// 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.
   700  	Name string `json:"name"`
   701  	// 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.
   702  	ShippingAddress *Address `json:"shipping_address"`
   703  }
   704  
   705  // If this Card is part of a card wallet, this contains the details of the card wallet.
   706  type PaymentMethodCardWallet struct {
   707  	AmexExpressCheckout *PaymentMethodCardWalletAmexExpressCheckout `json:"amex_express_checkout"`
   708  	ApplePay            *PaymentMethodCardWalletApplePay            `json:"apple_pay"`
   709  	// (For tokenized numbers only.) The last four digits of the device account number.
   710  	DynamicLast4 string                             `json:"dynamic_last4"`
   711  	GooglePay    *PaymentMethodCardWalletGooglePay  `json:"google_pay"`
   712  	Link         *PaymentMethodCardWalletLink       `json:"link"`
   713  	Masterpass   *PaymentMethodCardWalletMasterpass `json:"masterpass"`
   714  	SamsungPay   *PaymentMethodCardWalletSamsungPay `json:"samsung_pay"`
   715  	// 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.
   716  	Type         PaymentMethodCardWalletType          `json:"type"`
   717  	VisaCheckout *PaymentMethodCardWalletVisaCheckout `json:"visa_checkout"`
   718  }
   719  type PaymentMethodCard struct {
   720  	// Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
   721  	Brand PaymentMethodCardBrand `json:"brand"`
   722  	// Checks on Card address and CVC if provided.
   723  	Checks *PaymentMethodCardChecks `json:"checks"`
   724  	// 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.
   725  	Country string `json:"country"`
   726  	// 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.
   727  	DisplayBrand string `json:"display_brand"`
   728  	// Two-digit number representing the card's expiration month.
   729  	ExpMonth int64 `json:"exp_month"`
   730  	// Four-digit number representing the card's expiration year.
   731  	ExpYear int64 `json:"exp_year"`
   732  	// 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.
   733  	//
   734  	// *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.*
   735  	Fingerprint string `json:"fingerprint"`
   736  	// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
   737  	Funding CardFunding `json:"funding"`
   738  	// The last four digits of the card.
   739  	Last4 string `json:"last4"`
   740  	// Contains information about card networks that can be used to process the payment.
   741  	Networks *PaymentMethodCardNetworks `json:"networks"`
   742  	// Contains details on how this Card may be used for 3D Secure authentication.
   743  	ThreeDSecureUsage *PaymentMethodCardThreeDSecureUsage `json:"three_d_secure_usage"`
   744  	// If this Card is part of a card wallet, this contains the details of the card wallet.
   745  	Wallet *PaymentMethodCardWallet `json:"wallet"`
   746  	// Please note that the fields below are for internal use only and are not returned
   747  	// as part of standard API requests.
   748  	// 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.)
   749  	Description string `json:"description"`
   750  	// Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
   751  	IIN string `json:"iin"`
   752  	// The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
   753  	Issuer string `json:"issuer"`
   754  }
   755  
   756  // Contains information about card networks that can be used to process the payment.
   757  type PaymentMethodCardPresentNetworks struct {
   758  	// All available networks for the card.
   759  	Available []string `json:"available"`
   760  	// The preferred network for the card.
   761  	Preferred string `json:"preferred"`
   762  }
   763  type PaymentMethodCardPresent struct {
   764  	// Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
   765  	Brand string `json:"brand"`
   766  	// 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.
   767  	CardholderName string `json:"cardholder_name"`
   768  	// 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.
   769  	Country string `json:"country"`
   770  	// 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.)
   771  	Description string `json:"description"`
   772  	// Two-digit number representing the card's expiration month.
   773  	ExpMonth int64 `json:"exp_month"`
   774  	// Four-digit number representing the card's expiration year.
   775  	ExpYear int64 `json:"exp_year"`
   776  	// 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.
   777  	//
   778  	// *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.*
   779  	Fingerprint string `json:"fingerprint"`
   780  	// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
   781  	Funding string `json:"funding"`
   782  	// Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
   783  	IIN string `json:"iin"`
   784  	// The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
   785  	Issuer string `json:"issuer"`
   786  	// The last four digits of the card.
   787  	Last4 string `json:"last4"`
   788  	// Contains information about card networks that can be used to process the payment.
   789  	Networks *PaymentMethodCardPresentNetworks `json:"networks"`
   790  	// How card details were read in this transaction.
   791  	ReadMethod PaymentMethodCardPresentReadMethod `json:"read_method"`
   792  }
   793  type PaymentMethodCashApp struct {
   794  	// A unique and immutable identifier assigned by Cash App to every buyer.
   795  	BuyerID string `json:"buyer_id"`
   796  	// A public identifier for buyers using Cash App.
   797  	Cashtag string `json:"cashtag"`
   798  }
   799  type PaymentMethodCustomerBalance struct{}
   800  type PaymentMethodEPS struct {
   801  	// 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`.
   802  	Bank string `json:"bank"`
   803  }
   804  type PaymentMethodFPX struct {
   805  	// Account holder type, if provided. Can be one of `individual` or `company`.
   806  	AccountHolderType PaymentMethodFPXAccountHolderType `json:"account_holder_type"`
   807  	// 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`.
   808  	Bank string `json:"bank"`
   809  }
   810  type PaymentMethodGiropay struct{}
   811  type PaymentMethodGrabpay struct{}
   812  type PaymentMethodIDEAL struct {
   813  	// 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`.
   814  	Bank string `json:"bank"`
   815  	// The Bank Identifier Code of the customer's bank, if the bank was provided.
   816  	BIC string `json:"bic"`
   817  }
   818  
   819  // Contains information about card networks that can be used to process the payment.
   820  type PaymentMethodInteracPresentNetworks struct {
   821  	// All available networks for the card.
   822  	Available []string `json:"available"`
   823  	// The preferred network for the card.
   824  	Preferred string `json:"preferred"`
   825  }
   826  type PaymentMethodInteracPresent struct {
   827  	// Card brand. Can be `interac`, `mastercard` or `visa`.
   828  	Brand string `json:"brand"`
   829  	// 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.
   830  	CardholderName string `json:"cardholder_name"`
   831  	// 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.
   832  	Country string `json:"country"`
   833  	// 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.)
   834  	Description string `json:"description"`
   835  	// Two-digit number representing the card's expiration month.
   836  	ExpMonth int64 `json:"exp_month"`
   837  	// Four-digit number representing the card's expiration year.
   838  	ExpYear int64 `json:"exp_year"`
   839  	// 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.
   840  	//
   841  	// *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.*
   842  	Fingerprint string `json:"fingerprint"`
   843  	// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
   844  	Funding string `json:"funding"`
   845  	// Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
   846  	IIN string `json:"iin"`
   847  	// The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
   848  	Issuer string `json:"issuer"`
   849  	// The last four digits of the card.
   850  	Last4 string `json:"last4"`
   851  	// Contains information about card networks that can be used to process the payment.
   852  	Networks *PaymentMethodInteracPresentNetworks `json:"networks"`
   853  	// EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
   854  	PreferredLocales []string `json:"preferred_locales"`
   855  	// How card details were read in this transaction.
   856  	ReadMethod PaymentMethodInteracPresentReadMethod `json:"read_method"`
   857  }
   858  
   859  // The customer's date of birth, if provided.
   860  type PaymentMethodKlarnaDOB struct {
   861  	// The day of birth, between 1 and 31.
   862  	Day int64 `json:"day"`
   863  	// The month of birth, between 1 and 12.
   864  	Month int64 `json:"month"`
   865  	// The four-digit year of birth.
   866  	Year int64 `json:"year"`
   867  }
   868  type PaymentMethodKlarna struct {
   869  	// The customer's date of birth, if provided.
   870  	DOB *PaymentMethodKlarnaDOB `json:"dob"`
   871  }
   872  type PaymentMethodKonbini struct{}
   873  type PaymentMethodLink struct {
   874  	// Account owner's email address.
   875  	Email string `json:"email"`
   876  	// [Deprecated] This is a legacy parameter that no longer has any function.
   877  	PersistentToken string `json:"persistent_token"`
   878  }
   879  type PaymentMethodMobilepay struct{}
   880  type PaymentMethodOXXO struct{}
   881  type PaymentMethodP24 struct {
   882  	// The customer's bank, if provided.
   883  	Bank string `json:"bank"`
   884  }
   885  type PaymentMethodPayNow struct{}
   886  type PaymentMethodPaypal struct {
   887  	// Owner's email. Values are provided by PayPal directly
   888  	// (if supported) at the time of authorization or settlement. They cannot be set or mutated.
   889  	PayerEmail string `json:"payer_email"`
   890  	// PayPal account PayerID. This identifier uniquely identifies the PayPal customer.
   891  	PayerID string `json:"payer_id"`
   892  }
   893  type PaymentMethodPix struct{}
   894  type PaymentMethodPromptPay struct{}
   895  
   896  // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
   897  type PaymentMethodRadarOptions struct {
   898  	// 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.
   899  	Session string `json:"session"`
   900  }
   901  type PaymentMethodRevolutPay struct{}
   902  
   903  // Information about the object that generated this PaymentMethod.
   904  type PaymentMethodSEPADebitGeneratedFrom struct {
   905  	// The ID of the Charge that generated this PaymentMethod, if any.
   906  	Charge *Charge `json:"charge"`
   907  	// The ID of the SetupAttempt that generated this PaymentMethod, if any.
   908  	SetupAttempt *SetupAttempt `json:"setup_attempt"`
   909  }
   910  type PaymentMethodSEPADebit struct {
   911  	// Bank code of bank associated with the bank account.
   912  	BankCode string `json:"bank_code"`
   913  	// Branch code of bank associated with the bank account.
   914  	BranchCode string `json:"branch_code"`
   915  	// Two-letter ISO code representing the country the bank account is located in.
   916  	Country string `json:"country"`
   917  	// Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
   918  	Fingerprint string `json:"fingerprint"`
   919  	// Information about the object that generated this PaymentMethod.
   920  	GeneratedFrom *PaymentMethodSEPADebitGeneratedFrom `json:"generated_from"`
   921  	// Last four characters of the IBAN.
   922  	Last4 string `json:"last4"`
   923  }
   924  type PaymentMethodSofort struct {
   925  	// Two-letter ISO code representing the country the bank account is located in.
   926  	Country string `json:"country"`
   927  }
   928  type PaymentMethodSwish struct{}
   929  
   930  // Contains information about US bank account networks that can be used.
   931  type PaymentMethodUSBankAccountNetworks struct {
   932  	// The preferred network.
   933  	Preferred string `json:"preferred"`
   934  	// All supported networks.
   935  	Supported []PaymentMethodUSBankAccountNetworksSupported `json:"supported"`
   936  }
   937  type PaymentMethodUSBankAccountStatusDetailsBlocked struct {
   938  	// The ACH network code that resulted in this block.
   939  	NetworkCode PaymentMethodUSBankAccountStatusDetailsBlockedNetworkCode `json:"network_code"`
   940  	// The reason why this PaymentMethod's fingerprint has been blocked
   941  	Reason PaymentMethodUSBankAccountStatusDetailsBlockedReason `json:"reason"`
   942  }
   943  
   944  // Contains information about the future reusability of this PaymentMethod.
   945  type PaymentMethodUSBankAccountStatusDetails struct {
   946  	Blocked *PaymentMethodUSBankAccountStatusDetailsBlocked `json:"blocked"`
   947  }
   948  type PaymentMethodUSBankAccount struct {
   949  	// Account holder type: individual or company.
   950  	AccountHolderType PaymentMethodUSBankAccountAccountHolderType `json:"account_holder_type"`
   951  	// Account type: checkings or savings. Defaults to checking if omitted.
   952  	AccountType PaymentMethodUSBankAccountAccountType `json:"account_type"`
   953  	// The name of the bank.
   954  	BankName string `json:"bank_name"`
   955  	// The ID of the Financial Connections Account used to create the payment method.
   956  	FinancialConnectionsAccount string `json:"financial_connections_account"`
   957  	// Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
   958  	Fingerprint string `json:"fingerprint"`
   959  	// Last four digits of the bank account number.
   960  	Last4 string `json:"last4"`
   961  	// Contains information about US bank account networks that can be used.
   962  	Networks *PaymentMethodUSBankAccountNetworks `json:"networks"`
   963  	// Routing number of the bank account.
   964  	RoutingNumber string `json:"routing_number"`
   965  	// Contains information about the future reusability of this PaymentMethod.
   966  	StatusDetails *PaymentMethodUSBankAccountStatusDetails `json:"status_details"`
   967  }
   968  type PaymentMethodWeChatPay struct{}
   969  type PaymentMethodZip struct{}
   970  
   971  // PaymentMethod objects represent your customer's payment instruments.
   972  // You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
   973  // Customer objects to store instrument details for future payments.
   974  //
   975  // Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
   976  type PaymentMethod struct {
   977  	APIResource
   978  	ACSSDebit        *PaymentMethodACSSDebit        `json:"acss_debit"`
   979  	Affirm           *PaymentMethodAffirm           `json:"affirm"`
   980  	AfterpayClearpay *PaymentMethodAfterpayClearpay `json:"afterpay_clearpay"`
   981  	Alipay           *PaymentMethodAlipay           `json:"alipay"`
   982  	AUBECSDebit      *PaymentMethodAUBECSDebit      `json:"au_becs_debit"`
   983  	BACSDebit        *PaymentMethodBACSDebit        `json:"bacs_debit"`
   984  	Bancontact       *PaymentMethodBancontact       `json:"bancontact"`
   985  	BillingDetails   *PaymentMethodBillingDetails   `json:"billing_details"`
   986  	BLIK             *PaymentMethodBLIK             `json:"blik"`
   987  	Boleto           *PaymentMethodBoleto           `json:"boleto"`
   988  	Card             *PaymentMethodCard             `json:"card"`
   989  	CardPresent      *PaymentMethodCardPresent      `json:"card_present"`
   990  	CashApp          *PaymentMethodCashApp          `json:"cashapp"`
   991  	// Time at which the object was created. Measured in seconds since the Unix epoch.
   992  	Created int64 `json:"created"`
   993  	// 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.
   994  	Customer        *Customer                     `json:"customer"`
   995  	CustomerBalance *PaymentMethodCustomerBalance `json:"customer_balance"`
   996  	EPS             *PaymentMethodEPS             `json:"eps"`
   997  	FPX             *PaymentMethodFPX             `json:"fpx"`
   998  	Giropay         *PaymentMethodGiropay         `json:"giropay"`
   999  	Grabpay         *PaymentMethodGrabpay         `json:"grabpay"`
  1000  	// Unique identifier for the object.
  1001  	ID             string                       `json:"id"`
  1002  	IDEAL          *PaymentMethodIDEAL          `json:"ideal"`
  1003  	InteracPresent *PaymentMethodInteracPresent `json:"interac_present"`
  1004  	Klarna         *PaymentMethodKlarna         `json:"klarna"`
  1005  	Konbini        *PaymentMethodKonbini        `json:"konbini"`
  1006  	Link           *PaymentMethodLink           `json:"link"`
  1007  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
  1008  	Livemode bool `json:"livemode"`
  1009  	// 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.
  1010  	Metadata  map[string]string       `json:"metadata"`
  1011  	Mobilepay *PaymentMethodMobilepay `json:"mobilepay"`
  1012  	// String representing the object's type. Objects of the same type share the same value.
  1013  	Object    string                  `json:"object"`
  1014  	OXXO      *PaymentMethodOXXO      `json:"oxxo"`
  1015  	P24       *PaymentMethodP24       `json:"p24"`
  1016  	PayNow    *PaymentMethodPayNow    `json:"paynow"`
  1017  	Paypal    *PaymentMethodPaypal    `json:"paypal"`
  1018  	Pix       *PaymentMethodPix       `json:"pix"`
  1019  	PromptPay *PaymentMethodPromptPay `json:"promptpay"`
  1020  	// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
  1021  	RadarOptions *PaymentMethodRadarOptions `json:"radar_options"`
  1022  	RevolutPay   *PaymentMethodRevolutPay   `json:"revolut_pay"`
  1023  	SEPADebit    *PaymentMethodSEPADebit    `json:"sepa_debit"`
  1024  	Sofort       *PaymentMethodSofort       `json:"sofort"`
  1025  	Swish        *PaymentMethodSwish        `json:"swish"`
  1026  	// 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.
  1027  	Type          PaymentMethodType           `json:"type"`
  1028  	USBankAccount *PaymentMethodUSBankAccount `json:"us_bank_account"`
  1029  	WeChatPay     *PaymentMethodWeChatPay     `json:"wechat_pay"`
  1030  	Zip           *PaymentMethodZip           `json:"zip"`
  1031  }
  1032  
  1033  // PaymentMethodList is a list of PaymentMethods as retrieved from a list endpoint.
  1034  type PaymentMethodList struct {
  1035  	APIResource
  1036  	ListMeta
  1037  	Data []*PaymentMethod `json:"data"`
  1038  }
  1039  
  1040  // UnmarshalJSON handles deserialization of a PaymentMethod.
  1041  // This custom unmarshaling is needed because the resulting
  1042  // property may be an id or the full struct if it was expanded.
  1043  func (p *PaymentMethod) UnmarshalJSON(data []byte) error {
  1044  	if id, ok := ParseID(data); ok {
  1045  		p.ID = id
  1046  		return nil
  1047  	}
  1048  
  1049  	type paymentMethod PaymentMethod
  1050  	var v paymentMethod
  1051  	if err := json.Unmarshal(data, &v); err != nil {
  1052  		return err
  1053  	}
  1054  
  1055  	*p = PaymentMethod(v)
  1056  	return nil
  1057  }