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

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  import "encoding/json"
    10  
    11  // Controls whether this SetupIntent will accept redirect-based payment methods.
    12  //
    13  // Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
    14  type SetupIntentAutomaticPaymentMethodsAllowRedirects string
    15  
    16  // List of values that SetupIntentAutomaticPaymentMethodsAllowRedirects can take
    17  const (
    18  	SetupIntentAutomaticPaymentMethodsAllowRedirectsAlways SetupIntentAutomaticPaymentMethodsAllowRedirects = "always"
    19  	SetupIntentAutomaticPaymentMethodsAllowRedirectsNever  SetupIntentAutomaticPaymentMethodsAllowRedirects = "never"
    20  )
    21  
    22  // Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
    23  type SetupIntentCancellationReason string
    24  
    25  // List of values that SetupIntentCancellationReason can take
    26  const (
    27  	SetupIntentCancellationReasonAbandoned           SetupIntentCancellationReason = "abandoned"
    28  	SetupIntentCancellationReasonDuplicate           SetupIntentCancellationReason = "duplicate"
    29  	SetupIntentCancellationReasonRequestedByCustomer SetupIntentCancellationReason = "requested_by_customer"
    30  )
    31  
    32  // Indicates the directions of money movement for which this payment method is intended to be used.
    33  //
    34  // Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
    35  type SetupIntentFlowDirection string
    36  
    37  // List of values that SetupIntentFlowDirection can take
    38  const (
    39  	SetupIntentFlowDirectionInbound  SetupIntentFlowDirection = "inbound"
    40  	SetupIntentFlowDirectionOutbound SetupIntentFlowDirection = "outbound"
    41  )
    42  
    43  // Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.
    44  type SetupIntentNextActionType string
    45  
    46  // List of values that SetupIntentNextActionType can take
    47  const (
    48  	SetupIntentNextActionTypeRedirectToURL           SetupIntentNextActionType = "redirect_to_url"
    49  	SetupIntentNextActionTypeUseStripeSDK            SetupIntentNextActionType = "use_stripe_sdk"
    50  	SetupIntentNextActionTypeAlipayHandleRedirect    SetupIntentNextActionType = "alipay_handle_redirect"
    51  	SetupIntentNextActionTypeOXXODisplayDetails      SetupIntentNextActionType = "oxxo_display_details"
    52  	SetupIntentNextActionTypeVerifyWithMicrodeposits SetupIntentNextActionType = "verify_with_microdeposits"
    53  )
    54  
    55  // The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
    56  type SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType string
    57  
    58  // List of values that SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType can take
    59  const (
    60  	SetupIntentNextActionVerifyWithMicrodepositsMicrodepositTypeAmounts        SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType = "amounts"
    61  	SetupIntentNextActionVerifyWithMicrodepositsMicrodepositTypeDescriptorCode SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType = "descriptor_code"
    62  )
    63  
    64  // Currency supported by the bank account
    65  type SetupIntentPaymentMethodOptionsACSSDebitCurrency string
    66  
    67  // List of values that SetupIntentPaymentMethodOptionsACSSDebitCurrency can take
    68  const (
    69  	SetupIntentPaymentMethodOptionsACSSDebitCurrencyCAD SetupIntentPaymentMethodOptionsACSSDebitCurrency = "cad"
    70  	SetupIntentPaymentMethodOptionsACSSDebitCurrencyUSD SetupIntentPaymentMethodOptionsACSSDebitCurrency = "usd"
    71  )
    72  
    73  // List of Stripe products where this mandate can be selected automatically.
    74  type SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultFor string
    75  
    76  // List of values that SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultFor can take
    77  const (
    78  	SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultForInvoice      SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultFor = "invoice"
    79  	SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultForSubscription SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultFor = "subscription"
    80  )
    81  
    82  // Payment schedule for the mandate.
    83  type SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule string
    84  
    85  // List of values that SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule can take
    86  const (
    87  	SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentScheduleCombined SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule = "combined"
    88  	SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentScheduleInterval SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule = "interval"
    89  	SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentScheduleSporadic SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule = "sporadic"
    90  )
    91  
    92  // Transaction type of the mandate.
    93  type SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionType string
    94  
    95  // List of values that SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionType can take
    96  const (
    97  	SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionTypeBusiness SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionType = "business"
    98  	SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionTypePersonal SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionType = "personal"
    99  )
   100  
   101  // Bank account verification method.
   102  type SetupIntentPaymentMethodOptionsACSSDebitVerificationMethod string
   103  
   104  // List of values that SetupIntentPaymentMethodOptionsACSSDebitVerificationMethod can take
   105  const (
   106  	SetupIntentPaymentMethodOptionsACSSDebitVerificationMethodAutomatic     SetupIntentPaymentMethodOptionsACSSDebitVerificationMethod = "automatic"
   107  	SetupIntentPaymentMethodOptionsACSSDebitVerificationMethodInstant       SetupIntentPaymentMethodOptionsACSSDebitVerificationMethod = "instant"
   108  	SetupIntentPaymentMethodOptionsACSSDebitVerificationMethodMicrodeposits SetupIntentPaymentMethodOptionsACSSDebitVerificationMethod = "microdeposits"
   109  )
   110  
   111  // One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
   112  type SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType string
   113  
   114  // List of values that SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType can take
   115  const (
   116  	SetupIntentPaymentMethodOptionsCardMandateOptionsAmountTypeFixed   SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType = "fixed"
   117  	SetupIntentPaymentMethodOptionsCardMandateOptionsAmountTypeMaximum SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType = "maximum"
   118  )
   119  
   120  // Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
   121  type SetupIntentPaymentMethodOptionsCardMandateOptionsInterval string
   122  
   123  // List of values that SetupIntentPaymentMethodOptionsCardMandateOptionsInterval can take
   124  const (
   125  	SetupIntentPaymentMethodOptionsCardMandateOptionsIntervalDay      SetupIntentPaymentMethodOptionsCardMandateOptionsInterval = "day"
   126  	SetupIntentPaymentMethodOptionsCardMandateOptionsIntervalMonth    SetupIntentPaymentMethodOptionsCardMandateOptionsInterval = "month"
   127  	SetupIntentPaymentMethodOptionsCardMandateOptionsIntervalSporadic SetupIntentPaymentMethodOptionsCardMandateOptionsInterval = "sporadic"
   128  	SetupIntentPaymentMethodOptionsCardMandateOptionsIntervalWeek     SetupIntentPaymentMethodOptionsCardMandateOptionsInterval = "week"
   129  	SetupIntentPaymentMethodOptionsCardMandateOptionsIntervalYear     SetupIntentPaymentMethodOptionsCardMandateOptionsInterval = "year"
   130  )
   131  
   132  // Specifies the type of mandates supported. Possible values are `india`.
   133  type SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedType string
   134  
   135  // List of values that SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedType can take
   136  const (
   137  	SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypeIndia SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedType = "india"
   138  )
   139  
   140  // Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time.
   141  type SetupIntentPaymentMethodOptionsCardNetwork string
   142  
   143  // List of values that SetupIntentPaymentMethodOptionsCardNetwork can take
   144  const (
   145  	SetupIntentPaymentMethodOptionsCardNetworkAmex            SetupIntentPaymentMethodOptionsCardNetwork = "amex"
   146  	SetupIntentPaymentMethodOptionsCardNetworkCartesBancaires SetupIntentPaymentMethodOptionsCardNetwork = "cartes_bancaires"
   147  	SetupIntentPaymentMethodOptionsCardNetworkDiners          SetupIntentPaymentMethodOptionsCardNetwork = "diners"
   148  	SetupIntentPaymentMethodOptionsCardNetworkDiscover        SetupIntentPaymentMethodOptionsCardNetwork = "discover"
   149  	SetupIntentPaymentMethodOptionsCardNetworkEFTPOSAU        SetupIntentPaymentMethodOptionsCardNetwork = "eftpos_au"
   150  	SetupIntentPaymentMethodOptionsCardNetworkInterac         SetupIntentPaymentMethodOptionsCardNetwork = "interac"
   151  	SetupIntentPaymentMethodOptionsCardNetworkJCB             SetupIntentPaymentMethodOptionsCardNetwork = "jcb"
   152  	SetupIntentPaymentMethodOptionsCardNetworkMastercard      SetupIntentPaymentMethodOptionsCardNetwork = "mastercard"
   153  	SetupIntentPaymentMethodOptionsCardNetworkUnionpay        SetupIntentPaymentMethodOptionsCardNetwork = "unionpay"
   154  	SetupIntentPaymentMethodOptionsCardNetworkUnknown         SetupIntentPaymentMethodOptionsCardNetwork = "unknown"
   155  	SetupIntentPaymentMethodOptionsCardNetworkVisa            SetupIntentPaymentMethodOptionsCardNetwork = "visa"
   156  )
   157  
   158  // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
   159  type SetupIntentPaymentMethodOptionsCardRequestThreeDSecure string
   160  
   161  // List of values that SetupIntentPaymentMethodOptionsCardRequestThreeDSecure can take
   162  const (
   163  	SetupIntentPaymentMethodOptionsCardRequestThreeDSecureAny           SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "any"
   164  	SetupIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic     SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic"
   165  	SetupIntentPaymentMethodOptionsCardRequestThreeDSecureChallenge     SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge"
   166  	SetupIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge_only"
   167  )
   168  
   169  // The list of permissions to request. The `payment_method` permission must be included.
   170  type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission string
   171  
   172  // List of values that SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission can take
   173  const (
   174  	SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionBalances      SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "balances"
   175  	SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionOwnership     SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "ownership"
   176  	SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "payment_method"
   177  	SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions  SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "transactions"
   178  )
   179  
   180  // Data features requested to be retrieved upon account creation.
   181  type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch string
   182  
   183  // List of values that SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch can take
   184  const (
   185  	SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchBalances     SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "balances"
   186  	SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchTransactions SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "transactions"
   187  )
   188  
   189  // Mandate collection method
   190  type SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod string
   191  
   192  // List of values that SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod can take
   193  const (
   194  	SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethodPaper SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod = "paper"
   195  )
   196  
   197  // Bank account verification method.
   198  type SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod string
   199  
   200  // List of values that SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod can take
   201  const (
   202  	SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethodAutomatic     SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod = "automatic"
   203  	SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethodInstant       SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod = "instant"
   204  	SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethodMicrodeposits SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod = "microdeposits"
   205  )
   206  
   207  // [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
   208  type SetupIntentStatus string
   209  
   210  // List of values that SetupIntentStatus can take
   211  const (
   212  	SetupIntentStatusCanceled              SetupIntentStatus = "canceled"
   213  	SetupIntentStatusProcessing            SetupIntentStatus = "processing"
   214  	SetupIntentStatusRequiresAction        SetupIntentStatus = "requires_action"
   215  	SetupIntentStatusRequiresConfirmation  SetupIntentStatus = "requires_confirmation"
   216  	SetupIntentStatusRequiresPaymentMethod SetupIntentStatus = "requires_payment_method"
   217  	SetupIntentStatusSucceeded             SetupIntentStatus = "succeeded"
   218  )
   219  
   220  // Indicates how the payment method is intended to be used in the future.
   221  //
   222  // Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.
   223  type SetupIntentUsage string
   224  
   225  // List of values that SetupIntentUsage can take
   226  const (
   227  	SetupIntentUsageOffSession SetupIntentUsage = "off_session"
   228  	SetupIntentUsageOnSession  SetupIntentUsage = "on_session"
   229  )
   230  
   231  // Returns a list of SetupIntents.
   232  type SetupIntentListParams struct {
   233  	ListParams `form:"*"`
   234  	// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
   235  	//
   236  	// It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
   237  	AttachToSelf *bool `form:"attach_to_self"`
   238  	// A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
   239  	Created *int64 `form:"created"`
   240  	// A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
   241  	CreatedRange *RangeQueryParams `form:"created"`
   242  	// Only return SetupIntents for the customer specified by this customer ID.
   243  	Customer *string `form:"customer"`
   244  	// Specifies which fields in the response should be expanded.
   245  	Expand []*string `form:"expand"`
   246  	// Only return SetupIntents that associate with the specified payment method.
   247  	PaymentMethod *string `form:"payment_method"`
   248  }
   249  
   250  // AddExpand appends a new field to expand.
   251  func (p *SetupIntentListParams) AddExpand(f string) {
   252  	p.Expand = append(p.Expand, &f)
   253  }
   254  
   255  // When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
   256  type SetupIntentAutomaticPaymentMethodsParams struct {
   257  	// Controls whether this SetupIntent will accept redirect-based payment methods.
   258  	//
   259  	// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
   260  	AllowRedirects *string `form:"allow_redirects"`
   261  	// Whether this feature is enabled.
   262  	Enabled *bool `form:"enabled"`
   263  }
   264  
   265  // If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
   266  type SetupIntentMandateDataCustomerAcceptanceOfflineParams struct{}
   267  
   268  // If this is a Mandate accepted online, this hash contains details about the online acceptance.
   269  type SetupIntentMandateDataCustomerAcceptanceOnlineParams struct {
   270  	// The IP address from which the Mandate was accepted by the customer.
   271  	IPAddress *string `form:"ip_address"`
   272  	// The user agent of the browser from which the Mandate was accepted by the customer.
   273  	UserAgent *string `form:"user_agent"`
   274  }
   275  
   276  // This hash contains details about the customer acceptance of the Mandate.
   277  type SetupIntentMandateDataCustomerAcceptanceParams struct {
   278  	// The time at which the customer accepted the Mandate.
   279  	AcceptedAt *int64 `form:"accepted_at"`
   280  	// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
   281  	Offline *SetupIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline"`
   282  	// If this is a Mandate accepted online, this hash contains details about the online acceptance.
   283  	Online *SetupIntentMandateDataCustomerAcceptanceOnlineParams `form:"online"`
   284  	// The type of customer acceptance information included with the Mandate. One of `online` or `offline`.
   285  	Type MandateCustomerAcceptanceType `form:"type"`
   286  }
   287  
   288  // This hash contains details about the mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
   289  type SetupIntentMandateDataParams struct {
   290  	// This hash contains details about the customer acceptance of the Mandate.
   291  	CustomerAcceptance *SetupIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"`
   292  }
   293  
   294  // If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
   295  type SetupIntentPaymentMethodDataACSSDebitParams struct {
   296  	// Customer's bank account number.
   297  	AccountNumber *string `form:"account_number"`
   298  	// Institution number of the customer's bank.
   299  	InstitutionNumber *string `form:"institution_number"`
   300  	// Transit number of the customer's bank.
   301  	TransitNumber *string `form:"transit_number"`
   302  }
   303  
   304  // If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
   305  type SetupIntentPaymentMethodDataAffirmParams struct{}
   306  
   307  // If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
   308  type SetupIntentPaymentMethodDataAfterpayClearpayParams struct{}
   309  
   310  // If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
   311  type SetupIntentPaymentMethodDataAlipayParams struct{}
   312  
   313  // If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
   314  type SetupIntentPaymentMethodDataAUBECSDebitParams struct {
   315  	// The account number for the bank account.
   316  	AccountNumber *string `form:"account_number"`
   317  	// Bank-State-Branch number of the bank account.
   318  	BSBNumber *string `form:"bsb_number"`
   319  }
   320  
   321  // If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
   322  type SetupIntentPaymentMethodDataBACSDebitParams struct {
   323  	// Account number of the bank account that the funds will be debited from.
   324  	AccountNumber *string `form:"account_number"`
   325  	// Sort code of the bank account. (e.g., `10-20-30`)
   326  	SortCode *string `form:"sort_code"`
   327  }
   328  
   329  // If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
   330  type SetupIntentPaymentMethodDataBancontactParams struct{}
   331  
   332  // Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
   333  type SetupIntentPaymentMethodDataBillingDetailsParams struct {
   334  	// Billing address.
   335  	Address *AddressParams `form:"address"`
   336  	// Email address.
   337  	Email *string `form:"email"`
   338  	// Full name.
   339  	Name *string `form:"name"`
   340  	// Billing phone number (including extension).
   341  	Phone *string `form:"phone"`
   342  }
   343  
   344  // If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
   345  type SetupIntentPaymentMethodDataBLIKParams struct{}
   346  
   347  // If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
   348  type SetupIntentPaymentMethodDataBoletoParams struct {
   349  	// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
   350  	TaxID *string `form:"tax_id"`
   351  }
   352  
   353  // If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
   354  type SetupIntentPaymentMethodDataCashAppParams struct{}
   355  
   356  // If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
   357  type SetupIntentPaymentMethodDataCustomerBalanceParams struct{}
   358  
   359  // If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
   360  type SetupIntentPaymentMethodDataEPSParams struct {
   361  	// The customer's bank.
   362  	Bank *string `form:"bank"`
   363  }
   364  
   365  // If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
   366  type SetupIntentPaymentMethodDataFPXParams struct {
   367  	// Account holder type for FPX transaction
   368  	AccountHolderType *string `form:"account_holder_type"`
   369  	// The customer's bank.
   370  	Bank *string `form:"bank"`
   371  }
   372  
   373  // If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
   374  type SetupIntentPaymentMethodDataGiropayParams struct{}
   375  
   376  // If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
   377  type SetupIntentPaymentMethodDataGrabpayParams struct{}
   378  
   379  // If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
   380  type SetupIntentPaymentMethodDataIDEALParams struct {
   381  	// The customer's bank.
   382  	Bank *string `form:"bank"`
   383  }
   384  
   385  // If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
   386  type SetupIntentPaymentMethodDataInteracPresentParams struct{}
   387  
   388  // Customer's date of birth
   389  type SetupIntentPaymentMethodDataKlarnaDOBParams struct {
   390  	// The day of birth, between 1 and 31.
   391  	Day *int64 `form:"day"`
   392  	// The month of birth, between 1 and 12.
   393  	Month *int64 `form:"month"`
   394  	// The four-digit year of birth.
   395  	Year *int64 `form:"year"`
   396  }
   397  
   398  // If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
   399  type SetupIntentPaymentMethodDataKlarnaParams struct {
   400  	// Customer's date of birth
   401  	DOB *SetupIntentPaymentMethodDataKlarnaDOBParams `form:"dob"`
   402  }
   403  
   404  // If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
   405  type SetupIntentPaymentMethodDataKonbiniParams struct{}
   406  
   407  // If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
   408  type SetupIntentPaymentMethodDataLinkParams struct{}
   409  
   410  // If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
   411  type SetupIntentPaymentMethodDataMobilepayParams struct{}
   412  
   413  // If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
   414  type SetupIntentPaymentMethodDataOXXOParams struct{}
   415  
   416  // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
   417  type SetupIntentPaymentMethodDataP24Params struct {
   418  	// The customer's bank.
   419  	Bank *string `form:"bank"`
   420  }
   421  
   422  // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
   423  type SetupIntentPaymentMethodDataPayNowParams struct{}
   424  
   425  // If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
   426  type SetupIntentPaymentMethodDataPaypalParams struct{}
   427  
   428  // If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
   429  type SetupIntentPaymentMethodDataPixParams struct{}
   430  
   431  // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
   432  type SetupIntentPaymentMethodDataPromptPayParams struct{}
   433  
   434  // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
   435  type SetupIntentPaymentMethodDataRadarOptionsParams struct {
   436  	// 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.
   437  	Session *string `form:"session"`
   438  }
   439  
   440  // If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
   441  type SetupIntentPaymentMethodDataRevolutPayParams struct{}
   442  
   443  // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
   444  type SetupIntentPaymentMethodDataSEPADebitParams struct {
   445  	// IBAN of the bank account.
   446  	IBAN *string `form:"iban"`
   447  }
   448  
   449  // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
   450  type SetupIntentPaymentMethodDataSofortParams struct {
   451  	// Two-letter ISO code representing the country the bank account is located in.
   452  	Country *string `form:"country"`
   453  }
   454  
   455  // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
   456  type SetupIntentPaymentMethodDataSwishParams struct{}
   457  
   458  // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
   459  type SetupIntentPaymentMethodDataUSBankAccountParams struct {
   460  	// Account holder type: individual or company.
   461  	AccountHolderType *string `form:"account_holder_type"`
   462  	// Account number of the bank account.
   463  	AccountNumber *string `form:"account_number"`
   464  	// Account type: checkings or savings. Defaults to checking if omitted.
   465  	AccountType *string `form:"account_type"`
   466  	// The ID of a Financial Connections Account to use as a payment method.
   467  	FinancialConnectionsAccount *string `form:"financial_connections_account"`
   468  	// Routing number of the bank account.
   469  	RoutingNumber *string `form:"routing_number"`
   470  }
   471  
   472  // If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
   473  type SetupIntentPaymentMethodDataWeChatPayParams struct{}
   474  
   475  // If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
   476  type SetupIntentPaymentMethodDataZipParams struct{}
   477  
   478  // When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method)
   479  // value in the SetupIntent.
   480  type SetupIntentPaymentMethodDataParams struct {
   481  	// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
   482  	ACSSDebit *SetupIntentPaymentMethodDataACSSDebitParams `form:"acss_debit"`
   483  	// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
   484  	Affirm *SetupIntentPaymentMethodDataAffirmParams `form:"affirm"`
   485  	// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
   486  	AfterpayClearpay *SetupIntentPaymentMethodDataAfterpayClearpayParams `form:"afterpay_clearpay"`
   487  	// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
   488  	Alipay *SetupIntentPaymentMethodDataAlipayParams `form:"alipay"`
   489  	// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
   490  	AUBECSDebit *SetupIntentPaymentMethodDataAUBECSDebitParams `form:"au_becs_debit"`
   491  	// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
   492  	BACSDebit *SetupIntentPaymentMethodDataBACSDebitParams `form:"bacs_debit"`
   493  	// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
   494  	Bancontact *SetupIntentPaymentMethodDataBancontactParams `form:"bancontact"`
   495  	// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
   496  	BillingDetails *SetupIntentPaymentMethodDataBillingDetailsParams `form:"billing_details"`
   497  	// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
   498  	BLIK *SetupIntentPaymentMethodDataBLIKParams `form:"blik"`
   499  	// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
   500  	Boleto *SetupIntentPaymentMethodDataBoletoParams `form:"boleto"`
   501  	// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
   502  	CashApp *SetupIntentPaymentMethodDataCashAppParams `form:"cashapp"`
   503  	// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
   504  	CustomerBalance *SetupIntentPaymentMethodDataCustomerBalanceParams `form:"customer_balance"`
   505  	// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
   506  	EPS *SetupIntentPaymentMethodDataEPSParams `form:"eps"`
   507  	// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
   508  	FPX *SetupIntentPaymentMethodDataFPXParams `form:"fpx"`
   509  	// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
   510  	Giropay *SetupIntentPaymentMethodDataGiropayParams `form:"giropay"`
   511  	// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
   512  	Grabpay *SetupIntentPaymentMethodDataGrabpayParams `form:"grabpay"`
   513  	// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
   514  	IDEAL *SetupIntentPaymentMethodDataIDEALParams `form:"ideal"`
   515  	// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
   516  	InteracPresent *SetupIntentPaymentMethodDataInteracPresentParams `form:"interac_present"`
   517  	// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
   518  	Klarna *SetupIntentPaymentMethodDataKlarnaParams `form:"klarna"`
   519  	// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
   520  	Konbini *SetupIntentPaymentMethodDataKonbiniParams `form:"konbini"`
   521  	// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
   522  	Link *SetupIntentPaymentMethodDataLinkParams `form:"link"`
   523  	// 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`.
   524  	Metadata map[string]string `form:"metadata"`
   525  	// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
   526  	Mobilepay *SetupIntentPaymentMethodDataMobilepayParams `form:"mobilepay"`
   527  	// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
   528  	OXXO *SetupIntentPaymentMethodDataOXXOParams `form:"oxxo"`
   529  	// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
   530  	P24 *SetupIntentPaymentMethodDataP24Params `form:"p24"`
   531  	// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
   532  	PayNow *SetupIntentPaymentMethodDataPayNowParams `form:"paynow"`
   533  	// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
   534  	Paypal *SetupIntentPaymentMethodDataPaypalParams `form:"paypal"`
   535  	// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
   536  	Pix *SetupIntentPaymentMethodDataPixParams `form:"pix"`
   537  	// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
   538  	PromptPay *SetupIntentPaymentMethodDataPromptPayParams `form:"promptpay"`
   539  	// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
   540  	RadarOptions *SetupIntentPaymentMethodDataRadarOptionsParams `form:"radar_options"`
   541  	// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
   542  	RevolutPay *SetupIntentPaymentMethodDataRevolutPayParams `form:"revolut_pay"`
   543  	// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
   544  	SEPADebit *SetupIntentPaymentMethodDataSEPADebitParams `form:"sepa_debit"`
   545  	// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
   546  	Sofort *SetupIntentPaymentMethodDataSofortParams `form:"sofort"`
   547  	// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
   548  	Swish *SetupIntentPaymentMethodDataSwishParams `form:"swish"`
   549  	// 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.
   550  	Type *string `form:"type"`
   551  	// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
   552  	USBankAccount *SetupIntentPaymentMethodDataUSBankAccountParams `form:"us_bank_account"`
   553  	// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
   554  	WeChatPay *SetupIntentPaymentMethodDataWeChatPayParams `form:"wechat_pay"`
   555  	// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
   556  	Zip *SetupIntentPaymentMethodDataZipParams `form:"zip"`
   557  }
   558  
   559  // AddMetadata adds a new key-value pair to the Metadata.
   560  func (p *SetupIntentPaymentMethodDataParams) AddMetadata(key string, value string) {
   561  	if p.Metadata == nil {
   562  		p.Metadata = make(map[string]string)
   563  	}
   564  
   565  	p.Metadata[key] = value
   566  }
   567  
   568  // Additional fields for Mandate creation
   569  type SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams struct {
   570  	// A URL for custom mandate text to render during confirmation step.
   571  	// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,
   572  	// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
   573  	CustomMandateURL *string `form:"custom_mandate_url"`
   574  	// List of Stripe products where this mandate can be selected automatically.
   575  	DefaultFor []*string `form:"default_for"`
   576  	// Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
   577  	IntervalDescription *string `form:"interval_description"`
   578  	// Payment schedule for the mandate.
   579  	PaymentSchedule *string `form:"payment_schedule"`
   580  	// Transaction type of the mandate.
   581  	TransactionType *string `form:"transaction_type"`
   582  }
   583  
   584  // If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
   585  type SetupIntentPaymentMethodOptionsACSSDebitParams struct {
   586  	// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
   587  	Currency *string `form:"currency"`
   588  	// Additional fields for Mandate creation
   589  	MandateOptions *SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"`
   590  	// Bank account verification method.
   591  	VerificationMethod *string `form:"verification_method"`
   592  }
   593  
   594  // Configuration options for setting up an eMandate for cards issued in India.
   595  type SetupIntentPaymentMethodOptionsCardMandateOptionsParams struct {
   596  	// Amount to be charged for future payments.
   597  	Amount *int64 `form:"amount"`
   598  	// One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
   599  	AmountType *string `form:"amount_type"`
   600  	// Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
   601  	Currency *string `form:"currency"`
   602  	// A description of the mandate or subscription that is meant to be displayed to the customer.
   603  	Description *string `form:"description"`
   604  	// End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
   605  	EndDate *int64 `form:"end_date"`
   606  	// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
   607  	Interval *string `form:"interval"`
   608  	// The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.
   609  	IntervalCount *int64 `form:"interval_count"`
   610  	// Unique identifier for the mandate or subscription.
   611  	Reference *string `form:"reference"`
   612  	// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
   613  	StartDate *int64 `form:"start_date"`
   614  	// Specifies the type of mandates supported. Possible values are `india`.
   615  	SupportedTypes []*string `form:"supported_types"`
   616  }
   617  
   618  // Cartes Bancaires-specific 3DS fields.
   619  type SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesParams struct {
   620  	// The cryptogram calculation algorithm used by the card Issuer's ACS
   621  	// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
   622  	// messageExtension: CB-AVALGO
   623  	CbAvalgo *string `form:"cb_avalgo"`
   624  	// The exemption indicator returned from Cartes Bancaires in the ARes.
   625  	// message extension: CB-EXEMPTION; string (4 characters)
   626  	// This is a 3 byte bitmap (low significant byte first and most significant
   627  	// bit first) that has been Base64 encoded
   628  	CbExemption *string `form:"cb_exemption"`
   629  	// The risk score returned from Cartes Bancaires in the ARes.
   630  	// message extension: CB-SCORE; numeric value 0-99
   631  	CbScore *int64 `form:"cb_score"`
   632  }
   633  
   634  // Network specific 3DS fields. Network specific arguments require an
   635  // explicit card brand choice. The parameter `payment_method_options.card.network“
   636  // must be populated accordingly
   637  type SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsParams struct {
   638  	// Cartes Bancaires-specific 3DS fields.
   639  	CartesBancaires *SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesParams `form:"cartes_bancaires"`
   640  }
   641  
   642  // If 3D Secure authentication was performed with a third-party provider,
   643  // the authentication details to use for this setup.
   644  type SetupIntentPaymentMethodOptionsCardThreeDSecureParams struct {
   645  	// The `transStatus` returned from the card Issuer's ACS in the ARes.
   646  	AresTransStatus *string `form:"ares_trans_status"`
   647  	// The cryptogram, also known as the "authentication value" (AAV, CAVV or
   648  	// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
   649  	// (Most 3D Secure providers will return the base64-encoded version, which
   650  	// is what you should specify here.)
   651  	Cryptogram *string `form:"cryptogram"`
   652  	// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
   653  	// provider and indicates what degree of authentication was performed.
   654  	ElectronicCommerceIndicator *string `form:"electronic_commerce_indicator"`
   655  	// Network specific 3DS fields. Network specific arguments require an
   656  	// explicit card brand choice. The parameter `payment_method_options.card.network``
   657  	// must be populated accordingly
   658  	NetworkOptions *SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsParams `form:"network_options"`
   659  	// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
   660  	// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
   661  	RequestorChallengeIndicator *string `form:"requestor_challenge_indicator"`
   662  	// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
   663  	// Transaction ID (dsTransID).
   664  	TransactionID *string `form:"transaction_id"`
   665  	// The version of 3D Secure that was performed.
   666  	Version *string `form:"version"`
   667  }
   668  
   669  // Configuration for any card setup attempted on this SetupIntent.
   670  type SetupIntentPaymentMethodOptionsCardParams struct {
   671  	// Configuration options for setting up an eMandate for cards issued in India.
   672  	MandateOptions *SetupIntentPaymentMethodOptionsCardMandateOptionsParams `form:"mandate_options"`
   673  	// When specified, this parameter signals that a card has been collected
   674  	// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
   675  	// parameter can only be provided during confirmation.
   676  	MOTO *bool `form:"moto"`
   677  	// Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time.
   678  	Network *string `form:"network"`
   679  	// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
   680  	RequestThreeDSecure *string `form:"request_three_d_secure"`
   681  	// If 3D Secure authentication was performed with a third-party provider,
   682  	// the authentication details to use for this setup.
   683  	ThreeDSecure *SetupIntentPaymentMethodOptionsCardThreeDSecureParams `form:"three_d_secure"`
   684  }
   685  
   686  // If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
   687  type SetupIntentPaymentMethodOptionsCardPresentParams struct{}
   688  
   689  // If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
   690  type SetupIntentPaymentMethodOptionsLinkParams struct {
   691  	// [Deprecated] This is a legacy parameter that no longer has any function.
   692  	PersistentToken *string `form:"persistent_token"`
   693  }
   694  
   695  // If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
   696  type SetupIntentPaymentMethodOptionsPaypalParams struct {
   697  	// The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
   698  	BillingAgreementID *string `form:"billing_agreement_id"`
   699  }
   700  
   701  // Additional fields for Mandate creation
   702  type SetupIntentPaymentMethodOptionsSEPADebitMandateOptionsParams struct{}
   703  
   704  // If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
   705  type SetupIntentPaymentMethodOptionsSEPADebitParams struct {
   706  	// Additional fields for Mandate creation
   707  	MandateOptions *SetupIntentPaymentMethodOptionsSEPADebitMandateOptionsParams `form:"mandate_options"`
   708  }
   709  
   710  // Additional fields for Financial Connections Session creation
   711  type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct {
   712  	// The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
   713  	Permissions []*string `form:"permissions"`
   714  	// List of data features that you would like to retrieve upon account creation.
   715  	Prefetch []*string `form:"prefetch"`
   716  	// For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
   717  	ReturnURL *string `form:"return_url"`
   718  }
   719  
   720  // Additional fields for Mandate creation
   721  type SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsParams struct {
   722  	// The method used to collect offline mandate customer acceptance.
   723  	CollectionMethod *string `form:"collection_method"`
   724  }
   725  
   726  // Additional fields for network related functions
   727  type SetupIntentPaymentMethodOptionsUSBankAccountNetworksParams struct {
   728  	// Triggers validations to run across the selected networks
   729  	Requested []*string `form:"requested"`
   730  }
   731  
   732  // If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
   733  type SetupIntentPaymentMethodOptionsUSBankAccountParams struct {
   734  	// Additional fields for Financial Connections Session creation
   735  	FinancialConnections *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams `form:"financial_connections"`
   736  	// Additional fields for Mandate creation
   737  	MandateOptions *SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsParams `form:"mandate_options"`
   738  	// Additional fields for network related functions
   739  	Networks *SetupIntentPaymentMethodOptionsUSBankAccountNetworksParams `form:"networks"`
   740  	// Bank account verification method.
   741  	VerificationMethod *string `form:"verification_method"`
   742  }
   743  
   744  // Payment method-specific configuration for this SetupIntent.
   745  type SetupIntentPaymentMethodOptionsParams struct {
   746  	// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
   747  	ACSSDebit *SetupIntentPaymentMethodOptionsACSSDebitParams `form:"acss_debit"`
   748  	// Configuration for any card setup attempted on this SetupIntent.
   749  	Card *SetupIntentPaymentMethodOptionsCardParams `form:"card"`
   750  	// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
   751  	CardPresent *SetupIntentPaymentMethodOptionsCardPresentParams `form:"card_present"`
   752  	// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
   753  	Link *SetupIntentPaymentMethodOptionsLinkParams `form:"link"`
   754  	// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
   755  	Paypal *SetupIntentPaymentMethodOptionsPaypalParams `form:"paypal"`
   756  	// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
   757  	SEPADebit *SetupIntentPaymentMethodOptionsSEPADebitParams `form:"sepa_debit"`
   758  	// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
   759  	USBankAccount *SetupIntentPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"`
   760  }
   761  
   762  // If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
   763  type SetupIntentSingleUseParams struct {
   764  	// Amount the customer is granting permission to collect later. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
   765  	Amount *int64 `form:"amount"`
   766  	// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
   767  	Currency *string `form:"currency"`
   768  }
   769  
   770  // Creates a SetupIntent object.
   771  //
   772  // After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm)
   773  // it to collect any required permissions to charge the payment method later.
   774  type SetupIntentParams struct {
   775  	Params `form:"*"`
   776  	// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
   777  	//
   778  	// It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
   779  	AttachToSelf *bool `form:"attach_to_self"`
   780  	// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
   781  	AutomaticPaymentMethods *SetupIntentAutomaticPaymentMethodsParams `form:"automatic_payment_methods"`
   782  	// The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent.
   783  	ClientSecret *string `form:"client_secret"`
   784  	// Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary.
   785  	Confirm *bool `form:"confirm"`
   786  	// ID of the ConfirmationToken used to confirm this SetupIntent.
   787  	//
   788  	// If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence.
   789  	ConfirmationToken *string `form:"confirmation_token"`
   790  	// ID of the Customer this SetupIntent belongs to, if one exists.
   791  	//
   792  	// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.
   793  	Customer *string `form:"customer"`
   794  	// An arbitrary string attached to the object. Often useful for displaying to users.
   795  	Description *string `form:"description"`
   796  	// Specifies which fields in the response should be expanded.
   797  	Expand []*string `form:"expand"`
   798  	// Indicates the directions of money movement for which this payment method is intended to be used.
   799  	//
   800  	// Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
   801  	FlowDirections []*string `form:"flow_directions"`
   802  	// This hash contains details about the mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
   803  	MandateData *SetupIntentMandateDataParams `form:"mandate_data"`
   804  	// 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`.
   805  	Metadata map[string]string `form:"metadata"`
   806  	// The Stripe account ID created for this SetupIntent.
   807  	OnBehalfOf *string `form:"on_behalf_of"`
   808  	// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
   809  	PaymentMethod *string `form:"payment_method"`
   810  	// The ID of the payment method configuration to use with this SetupIntent.
   811  	PaymentMethodConfiguration *string `form:"payment_method_configuration"`
   812  	// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method)
   813  	// value in the SetupIntent.
   814  	PaymentMethodData *SetupIntentPaymentMethodDataParams `form:"payment_method_data"`
   815  	// Payment method-specific configuration for this SetupIntent.
   816  	PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
   817  	// The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this array, it defaults to ["card"].
   818  	PaymentMethodTypes []*string `form:"payment_method_types"`
   819  	// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
   820  	ReturnURL *string `form:"return_url"`
   821  	// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
   822  	SingleUse *SetupIntentSingleUseParams `form:"single_use"`
   823  	// Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`.
   824  	Usage *string `form:"usage"`
   825  	// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
   826  	UseStripeSDK *bool `form:"use_stripe_sdk"`
   827  }
   828  
   829  // AddExpand appends a new field to expand.
   830  func (p *SetupIntentParams) AddExpand(f string) {
   831  	p.Expand = append(p.Expand, &f)
   832  }
   833  
   834  // AddMetadata adds a new key-value pair to the Metadata.
   835  func (p *SetupIntentParams) AddMetadata(key string, value string) {
   836  	if p.Metadata == nil {
   837  		p.Metadata = make(map[string]string)
   838  	}
   839  
   840  	p.Metadata[key] = value
   841  }
   842  
   843  // You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
   844  //
   845  // After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
   846  type SetupIntentCancelParams struct {
   847  	Params `form:"*"`
   848  	// Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`
   849  	CancellationReason *string `form:"cancellation_reason"`
   850  	// Specifies which fields in the response should be expanded.
   851  	Expand []*string `form:"expand"`
   852  }
   853  
   854  // AddExpand appends a new field to expand.
   855  func (p *SetupIntentCancelParams) AddExpand(f string) {
   856  	p.Expand = append(p.Expand, &f)
   857  }
   858  
   859  // If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
   860  type SetupIntentConfirmPaymentMethodDataACSSDebitParams struct {
   861  	// Customer's bank account number.
   862  	AccountNumber *string `form:"account_number"`
   863  	// Institution number of the customer's bank.
   864  	InstitutionNumber *string `form:"institution_number"`
   865  	// Transit number of the customer's bank.
   866  	TransitNumber *string `form:"transit_number"`
   867  }
   868  
   869  // If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
   870  type SetupIntentConfirmPaymentMethodDataAffirmParams struct{}
   871  
   872  // If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
   873  type SetupIntentConfirmPaymentMethodDataAfterpayClearpayParams struct{}
   874  
   875  // If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
   876  type SetupIntentConfirmPaymentMethodDataAlipayParams struct{}
   877  
   878  // If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
   879  type SetupIntentConfirmPaymentMethodDataAUBECSDebitParams struct {
   880  	// The account number for the bank account.
   881  	AccountNumber *string `form:"account_number"`
   882  	// Bank-State-Branch number of the bank account.
   883  	BSBNumber *string `form:"bsb_number"`
   884  }
   885  
   886  // If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
   887  type SetupIntentConfirmPaymentMethodDataBACSDebitParams struct {
   888  	// Account number of the bank account that the funds will be debited from.
   889  	AccountNumber *string `form:"account_number"`
   890  	// Sort code of the bank account. (e.g., `10-20-30`)
   891  	SortCode *string `form:"sort_code"`
   892  }
   893  
   894  // If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
   895  type SetupIntentConfirmPaymentMethodDataBancontactParams struct{}
   896  
   897  // Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
   898  type SetupIntentConfirmPaymentMethodDataBillingDetailsParams struct {
   899  	// Billing address.
   900  	Address *AddressParams `form:"address"`
   901  	// Email address.
   902  	Email *string `form:"email"`
   903  	// Full name.
   904  	Name *string `form:"name"`
   905  	// Billing phone number (including extension).
   906  	Phone *string `form:"phone"`
   907  }
   908  
   909  // If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
   910  type SetupIntentConfirmPaymentMethodDataBLIKParams struct{}
   911  
   912  // If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
   913  type SetupIntentConfirmPaymentMethodDataBoletoParams struct {
   914  	// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
   915  	TaxID *string `form:"tax_id"`
   916  }
   917  
   918  // If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
   919  type SetupIntentConfirmPaymentMethodDataCashAppParams struct{}
   920  
   921  // If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
   922  type SetupIntentConfirmPaymentMethodDataCustomerBalanceParams struct{}
   923  
   924  // If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
   925  type SetupIntentConfirmPaymentMethodDataEPSParams struct {
   926  	// The customer's bank.
   927  	Bank *string `form:"bank"`
   928  }
   929  
   930  // If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
   931  type SetupIntentConfirmPaymentMethodDataFPXParams struct {
   932  	// Account holder type for FPX transaction
   933  	AccountHolderType *string `form:"account_holder_type"`
   934  	// The customer's bank.
   935  	Bank *string `form:"bank"`
   936  }
   937  
   938  // If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
   939  type SetupIntentConfirmPaymentMethodDataGiropayParams struct{}
   940  
   941  // If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
   942  type SetupIntentConfirmPaymentMethodDataGrabpayParams struct{}
   943  
   944  // If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
   945  type SetupIntentConfirmPaymentMethodDataIDEALParams struct {
   946  	// The customer's bank.
   947  	Bank *string `form:"bank"`
   948  }
   949  
   950  // If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
   951  type SetupIntentConfirmPaymentMethodDataInteracPresentParams struct{}
   952  
   953  // Customer's date of birth
   954  type SetupIntentConfirmPaymentMethodDataKlarnaDOBParams struct {
   955  	// The day of birth, between 1 and 31.
   956  	Day *int64 `form:"day"`
   957  	// The month of birth, between 1 and 12.
   958  	Month *int64 `form:"month"`
   959  	// The four-digit year of birth.
   960  	Year *int64 `form:"year"`
   961  }
   962  
   963  // If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
   964  type SetupIntentConfirmPaymentMethodDataKlarnaParams struct {
   965  	// Customer's date of birth
   966  	DOB *SetupIntentConfirmPaymentMethodDataKlarnaDOBParams `form:"dob"`
   967  }
   968  
   969  // If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
   970  type SetupIntentConfirmPaymentMethodDataKonbiniParams struct{}
   971  
   972  // If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
   973  type SetupIntentConfirmPaymentMethodDataLinkParams struct{}
   974  
   975  // If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
   976  type SetupIntentConfirmPaymentMethodDataMobilepayParams struct{}
   977  
   978  // If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
   979  type SetupIntentConfirmPaymentMethodDataOXXOParams struct{}
   980  
   981  // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
   982  type SetupIntentConfirmPaymentMethodDataP24Params struct {
   983  	// The customer's bank.
   984  	Bank *string `form:"bank"`
   985  }
   986  
   987  // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
   988  type SetupIntentConfirmPaymentMethodDataPayNowParams struct{}
   989  
   990  // If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
   991  type SetupIntentConfirmPaymentMethodDataPaypalParams struct{}
   992  
   993  // If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
   994  type SetupIntentConfirmPaymentMethodDataPixParams struct{}
   995  
   996  // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
   997  type SetupIntentConfirmPaymentMethodDataPromptPayParams struct{}
   998  
   999  // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
  1000  type SetupIntentConfirmPaymentMethodDataRadarOptionsParams struct {
  1001  	// 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.
  1002  	Session *string `form:"session"`
  1003  }
  1004  
  1005  // If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
  1006  type SetupIntentConfirmPaymentMethodDataRevolutPayParams struct{}
  1007  
  1008  // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
  1009  type SetupIntentConfirmPaymentMethodDataSEPADebitParams struct {
  1010  	// IBAN of the bank account.
  1011  	IBAN *string `form:"iban"`
  1012  }
  1013  
  1014  // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
  1015  type SetupIntentConfirmPaymentMethodDataSofortParams struct {
  1016  	// Two-letter ISO code representing the country the bank account is located in.
  1017  	Country *string `form:"country"`
  1018  }
  1019  
  1020  // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
  1021  type SetupIntentConfirmPaymentMethodDataSwishParams struct{}
  1022  
  1023  // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
  1024  type SetupIntentConfirmPaymentMethodDataUSBankAccountParams struct {
  1025  	// Account holder type: individual or company.
  1026  	AccountHolderType *string `form:"account_holder_type"`
  1027  	// Account number of the bank account.
  1028  	AccountNumber *string `form:"account_number"`
  1029  	// Account type: checkings or savings. Defaults to checking if omitted.
  1030  	AccountType *string `form:"account_type"`
  1031  	// The ID of a Financial Connections Account to use as a payment method.
  1032  	FinancialConnectionsAccount *string `form:"financial_connections_account"`
  1033  	// Routing number of the bank account.
  1034  	RoutingNumber *string `form:"routing_number"`
  1035  }
  1036  
  1037  // If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
  1038  type SetupIntentConfirmPaymentMethodDataWeChatPayParams struct{}
  1039  
  1040  // If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
  1041  type SetupIntentConfirmPaymentMethodDataZipParams struct{}
  1042  
  1043  // When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method)
  1044  // value in the SetupIntent.
  1045  type SetupIntentConfirmPaymentMethodDataParams struct {
  1046  	// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
  1047  	ACSSDebit *SetupIntentConfirmPaymentMethodDataACSSDebitParams `form:"acss_debit"`
  1048  	// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
  1049  	Affirm *SetupIntentConfirmPaymentMethodDataAffirmParams `form:"affirm"`
  1050  	// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
  1051  	AfterpayClearpay *SetupIntentConfirmPaymentMethodDataAfterpayClearpayParams `form:"afterpay_clearpay"`
  1052  	// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
  1053  	Alipay *SetupIntentConfirmPaymentMethodDataAlipayParams `form:"alipay"`
  1054  	// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
  1055  	AUBECSDebit *SetupIntentConfirmPaymentMethodDataAUBECSDebitParams `form:"au_becs_debit"`
  1056  	// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
  1057  	BACSDebit *SetupIntentConfirmPaymentMethodDataBACSDebitParams `form:"bacs_debit"`
  1058  	// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
  1059  	Bancontact *SetupIntentConfirmPaymentMethodDataBancontactParams `form:"bancontact"`
  1060  	// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
  1061  	BillingDetails *SetupIntentConfirmPaymentMethodDataBillingDetailsParams `form:"billing_details"`
  1062  	// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
  1063  	BLIK *SetupIntentConfirmPaymentMethodDataBLIKParams `form:"blik"`
  1064  	// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
  1065  	Boleto *SetupIntentConfirmPaymentMethodDataBoletoParams `form:"boleto"`
  1066  	// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
  1067  	CashApp *SetupIntentConfirmPaymentMethodDataCashAppParams `form:"cashapp"`
  1068  	// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
  1069  	CustomerBalance *SetupIntentConfirmPaymentMethodDataCustomerBalanceParams `form:"customer_balance"`
  1070  	// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
  1071  	EPS *SetupIntentConfirmPaymentMethodDataEPSParams `form:"eps"`
  1072  	// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
  1073  	FPX *SetupIntentConfirmPaymentMethodDataFPXParams `form:"fpx"`
  1074  	// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
  1075  	Giropay *SetupIntentConfirmPaymentMethodDataGiropayParams `form:"giropay"`
  1076  	// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
  1077  	Grabpay *SetupIntentConfirmPaymentMethodDataGrabpayParams `form:"grabpay"`
  1078  	// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
  1079  	IDEAL *SetupIntentConfirmPaymentMethodDataIDEALParams `form:"ideal"`
  1080  	// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
  1081  	InteracPresent *SetupIntentConfirmPaymentMethodDataInteracPresentParams `form:"interac_present"`
  1082  	// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
  1083  	Klarna *SetupIntentConfirmPaymentMethodDataKlarnaParams `form:"klarna"`
  1084  	// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
  1085  	Konbini *SetupIntentConfirmPaymentMethodDataKonbiniParams `form:"konbini"`
  1086  	// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
  1087  	Link *SetupIntentConfirmPaymentMethodDataLinkParams `form:"link"`
  1088  	// 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`.
  1089  	Metadata map[string]string `form:"metadata"`
  1090  	// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
  1091  	Mobilepay *SetupIntentConfirmPaymentMethodDataMobilepayParams `form:"mobilepay"`
  1092  	// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
  1093  	OXXO *SetupIntentConfirmPaymentMethodDataOXXOParams `form:"oxxo"`
  1094  	// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
  1095  	P24 *SetupIntentConfirmPaymentMethodDataP24Params `form:"p24"`
  1096  	// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
  1097  	PayNow *SetupIntentConfirmPaymentMethodDataPayNowParams `form:"paynow"`
  1098  	// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
  1099  	Paypal *SetupIntentConfirmPaymentMethodDataPaypalParams `form:"paypal"`
  1100  	// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
  1101  	Pix *SetupIntentConfirmPaymentMethodDataPixParams `form:"pix"`
  1102  	// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
  1103  	PromptPay *SetupIntentConfirmPaymentMethodDataPromptPayParams `form:"promptpay"`
  1104  	// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
  1105  	RadarOptions *SetupIntentConfirmPaymentMethodDataRadarOptionsParams `form:"radar_options"`
  1106  	// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
  1107  	RevolutPay *SetupIntentConfirmPaymentMethodDataRevolutPayParams `form:"revolut_pay"`
  1108  	// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
  1109  	SEPADebit *SetupIntentConfirmPaymentMethodDataSEPADebitParams `form:"sepa_debit"`
  1110  	// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
  1111  	Sofort *SetupIntentConfirmPaymentMethodDataSofortParams `form:"sofort"`
  1112  	// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
  1113  	Swish *SetupIntentConfirmPaymentMethodDataSwishParams `form:"swish"`
  1114  	// 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.
  1115  	Type *string `form:"type"`
  1116  	// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
  1117  	USBankAccount *SetupIntentConfirmPaymentMethodDataUSBankAccountParams `form:"us_bank_account"`
  1118  	// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
  1119  	WeChatPay *SetupIntentConfirmPaymentMethodDataWeChatPayParams `form:"wechat_pay"`
  1120  	// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
  1121  	Zip *SetupIntentConfirmPaymentMethodDataZipParams `form:"zip"`
  1122  }
  1123  
  1124  // AddMetadata adds a new key-value pair to the Metadata.
  1125  func (p *SetupIntentConfirmPaymentMethodDataParams) AddMetadata(key string, value string) {
  1126  	if p.Metadata == nil {
  1127  		p.Metadata = make(map[string]string)
  1128  	}
  1129  
  1130  	p.Metadata[key] = value
  1131  }
  1132  
  1133  // Confirm that your customer intends to set up the current or
  1134  // provided payment method. For example, you would confirm a SetupIntent
  1135  // when a customer hits the “Save” button on a payment method management
  1136  // page on your website.
  1137  //
  1138  // If the selected payment method does not require any additional
  1139  // steps from the customer, the SetupIntent will transition to the
  1140  // succeeded status.
  1141  //
  1142  // Otherwise, it will transition to the requires_action status and
  1143  // suggest additional actions via next_action. If setup fails,
  1144  // the SetupIntent will transition to the
  1145  // requires_payment_method status or the canceled status if the
  1146  // confirmation limit is reached.
  1147  type SetupIntentConfirmParams struct {
  1148  	Params `form:"*"`
  1149  	// ID of the ConfirmationToken used to confirm this SetupIntent.
  1150  	//
  1151  	// If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence.
  1152  	ConfirmationToken *string `form:"confirmation_token"`
  1153  	// Specifies which fields in the response should be expanded.
  1154  	Expand      []*string                     `form:"expand"`
  1155  	MandateData *SetupIntentMandateDataParams `form:"mandate_data"`
  1156  	// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
  1157  	PaymentMethod *string `form:"payment_method"`
  1158  	// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method)
  1159  	// value in the SetupIntent.
  1160  	PaymentMethodData *SetupIntentConfirmPaymentMethodDataParams `form:"payment_method_data"`
  1161  	// Payment method-specific configuration for this SetupIntent.
  1162  	PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
  1163  	// The URL to redirect your customer back to after they authenticate on the payment method's app or site.
  1164  	// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
  1165  	// This parameter is only used for cards and other redirect-based payment methods.
  1166  	ReturnURL *string `form:"return_url"`
  1167  	// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
  1168  	UseStripeSDK *bool `form:"use_stripe_sdk"`
  1169  }
  1170  
  1171  // AddExpand appends a new field to expand.
  1172  func (p *SetupIntentConfirmParams) AddExpand(f string) {
  1173  	p.Expand = append(p.Expand, &f)
  1174  }
  1175  
  1176  // Verifies microdeposits on a SetupIntent object.
  1177  type SetupIntentVerifyMicrodepositsParams struct {
  1178  	Params `form:"*"`
  1179  	// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
  1180  	Amounts []*int64 `form:"amounts"`
  1181  	// A six-character code starting with SM present in the microdeposit sent to the bank account.
  1182  	DescriptorCode *string `form:"descriptor_code"`
  1183  	// Specifies which fields in the response should be expanded.
  1184  	Expand []*string `form:"expand"`
  1185  }
  1186  
  1187  // AddExpand appends a new field to expand.
  1188  func (p *SetupIntentVerifyMicrodepositsParams) AddExpand(f string) {
  1189  	p.Expand = append(p.Expand, &f)
  1190  }
  1191  
  1192  // Settings for dynamic payment methods compatible with this Setup Intent
  1193  type SetupIntentAutomaticPaymentMethods struct {
  1194  	// Controls whether this SetupIntent will accept redirect-based payment methods.
  1195  	//
  1196  	// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
  1197  	AllowRedirects SetupIntentAutomaticPaymentMethodsAllowRedirects `json:"allow_redirects"`
  1198  	// Automatically calculates compatible payment methods
  1199  	Enabled bool `json:"enabled"`
  1200  }
  1201  type SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCodeQRCode struct {
  1202  	// The date (unix timestamp) when the QR code expires.
  1203  	ExpiresAt int64 `json:"expires_at"`
  1204  	// The image_url_png string used to render QR code
  1205  	ImageURLPNG string `json:"image_url_png"`
  1206  	// The image_url_svg string used to render QR code
  1207  	ImageURLSVG string `json:"image_url_svg"`
  1208  }
  1209  type SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCode struct {
  1210  	// The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration.
  1211  	HostedInstructionsURL string `json:"hosted_instructions_url"`
  1212  	// The url for mobile redirect based auth
  1213  	MobileAuthURL string                                                           `json:"mobile_auth_url"`
  1214  	QRCode        *SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCodeQRCode `json:"qr_code"`
  1215  }
  1216  type SetupIntentNextActionRedirectToURL struct {
  1217  	// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
  1218  	ReturnURL string `json:"return_url"`
  1219  	// The URL you must redirect your customer to in order to authenticate.
  1220  	URL string `json:"url"`
  1221  }
  1222  
  1223  // When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
  1224  type SetupIntentNextActionUseStripeSDK struct{}
  1225  type SetupIntentNextActionVerifyWithMicrodeposits struct {
  1226  	// The timestamp when the microdeposits are expected to land.
  1227  	ArrivalDate int64 `json:"arrival_date"`
  1228  	// The URL for the hosted verification page, which allows customers to verify their bank account.
  1229  	HostedVerificationURL string `json:"hosted_verification_url"`
  1230  	// The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
  1231  	MicrodepositType SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType `json:"microdeposit_type"`
  1232  }
  1233  
  1234  // If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
  1235  type SetupIntentNextAction struct {
  1236  	CashAppHandleRedirectOrDisplayQRCode *SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCode `json:"cashapp_handle_redirect_or_display_qr_code"`
  1237  	RedirectToURL                        *SetupIntentNextActionRedirectToURL                        `json:"redirect_to_url"`
  1238  	// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.
  1239  	Type SetupIntentNextActionType `json:"type"`
  1240  	// When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
  1241  	UseStripeSDK            *SetupIntentNextActionUseStripeSDK            `json:"use_stripe_sdk"`
  1242  	VerifyWithMicrodeposits *SetupIntentNextActionVerifyWithMicrodeposits `json:"verify_with_microdeposits"`
  1243  }
  1244  
  1245  // Information about the payment method configuration used for this Setup Intent.
  1246  type SetupIntentPaymentMethodConfigurationDetails struct {
  1247  	// ID of the payment method configuration used.
  1248  	ID string `json:"id"`
  1249  	// ID of the parent payment method configuration used.
  1250  	Parent string `json:"parent"`
  1251  }
  1252  type SetupIntentPaymentMethodOptionsACSSDebitMandateOptions struct {
  1253  	// A URL for custom mandate text
  1254  	CustomMandateURL string `json:"custom_mandate_url"`
  1255  	// List of Stripe products where this mandate can be selected automatically.
  1256  	DefaultFor []SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultFor `json:"default_for"`
  1257  	// Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.
  1258  	IntervalDescription string `json:"interval_description"`
  1259  	// Payment schedule for the mandate.
  1260  	PaymentSchedule SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule `json:"payment_schedule"`
  1261  	// Transaction type of the mandate.
  1262  	TransactionType SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionType `json:"transaction_type"`
  1263  }
  1264  type SetupIntentPaymentMethodOptionsACSSDebit struct {
  1265  	// Currency supported by the bank account
  1266  	Currency       SetupIntentPaymentMethodOptionsACSSDebitCurrency        `json:"currency"`
  1267  	MandateOptions *SetupIntentPaymentMethodOptionsACSSDebitMandateOptions `json:"mandate_options"`
  1268  	// Bank account verification method.
  1269  	VerificationMethod SetupIntentPaymentMethodOptionsACSSDebitVerificationMethod `json:"verification_method"`
  1270  }
  1271  
  1272  // Configuration options for setting up an eMandate for cards issued in India.
  1273  type SetupIntentPaymentMethodOptionsCardMandateOptions struct {
  1274  	// Amount to be charged for future payments.
  1275  	Amount int64 `json:"amount"`
  1276  	// One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
  1277  	AmountType SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType `json:"amount_type"`
  1278  	// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
  1279  	Currency Currency `json:"currency"`
  1280  	// A description of the mandate or subscription that is meant to be displayed to the customer.
  1281  	Description string `json:"description"`
  1282  	// End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
  1283  	EndDate int64 `json:"end_date"`
  1284  	// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
  1285  	Interval SetupIntentPaymentMethodOptionsCardMandateOptionsInterval `json:"interval"`
  1286  	// The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.
  1287  	IntervalCount int64 `json:"interval_count"`
  1288  	// Unique identifier for the mandate or subscription.
  1289  	Reference string `json:"reference"`
  1290  	// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
  1291  	StartDate int64 `json:"start_date"`
  1292  	// Specifies the type of mandates supported. Possible values are `india`.
  1293  	SupportedTypes []SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedType `json:"supported_types"`
  1294  }
  1295  type SetupIntentPaymentMethodOptionsCard struct {
  1296  	// Configuration options for setting up an eMandate for cards issued in India.
  1297  	MandateOptions *SetupIntentPaymentMethodOptionsCardMandateOptions `json:"mandate_options"`
  1298  	// Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time.
  1299  	Network SetupIntentPaymentMethodOptionsCardNetwork `json:"network"`
  1300  	// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
  1301  	RequestThreeDSecure SetupIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"`
  1302  }
  1303  type SetupIntentPaymentMethodOptionsCardPresent struct{}
  1304  type SetupIntentPaymentMethodOptionsLink struct {
  1305  	// [Deprecated] This is a legacy parameter that no longer has any function.
  1306  	PersistentToken string `json:"persistent_token"`
  1307  }
  1308  type SetupIntentPaymentMethodOptionsPaypal struct {
  1309  	// The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
  1310  	BillingAgreementID string `json:"billing_agreement_id"`
  1311  }
  1312  type SetupIntentPaymentMethodOptionsSEPADebitMandateOptions struct{}
  1313  type SetupIntentPaymentMethodOptionsSEPADebit struct {
  1314  	MandateOptions *SetupIntentPaymentMethodOptionsSEPADebitMandateOptions `json:"mandate_options"`
  1315  }
  1316  type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnections struct {
  1317  	// The list of permissions to request. The `payment_method` permission must be included.
  1318  	Permissions []SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission `json:"permissions"`
  1319  	// Data features requested to be retrieved upon account creation.
  1320  	Prefetch []SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch `json:"prefetch"`
  1321  	// For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
  1322  	ReturnURL string `json:"return_url"`
  1323  }
  1324  type SetupIntentPaymentMethodOptionsUSBankAccountMandateOptions struct {
  1325  	// Mandate collection method
  1326  	CollectionMethod SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod `json:"collection_method"`
  1327  }
  1328  type SetupIntentPaymentMethodOptionsUSBankAccount struct {
  1329  	FinancialConnections *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnections `json:"financial_connections"`
  1330  	MandateOptions       *SetupIntentPaymentMethodOptionsUSBankAccountMandateOptions       `json:"mandate_options"`
  1331  	// Bank account verification method.
  1332  	VerificationMethod SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod `json:"verification_method"`
  1333  }
  1334  
  1335  // Payment method-specific configuration for this SetupIntent.
  1336  type SetupIntentPaymentMethodOptions struct {
  1337  	ACSSDebit     *SetupIntentPaymentMethodOptionsACSSDebit     `json:"acss_debit"`
  1338  	Card          *SetupIntentPaymentMethodOptionsCard          `json:"card"`
  1339  	CardPresent   *SetupIntentPaymentMethodOptionsCardPresent   `json:"card_present"`
  1340  	Link          *SetupIntentPaymentMethodOptionsLink          `json:"link"`
  1341  	Paypal        *SetupIntentPaymentMethodOptionsPaypal        `json:"paypal"`
  1342  	SEPADebit     *SetupIntentPaymentMethodOptionsSEPADebit     `json:"sepa_debit"`
  1343  	USBankAccount *SetupIntentPaymentMethodOptionsUSBankAccount `json:"us_bank_account"`
  1344  }
  1345  
  1346  // A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
  1347  // For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
  1348  // Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.
  1349  //
  1350  // Create a SetupIntent when you're ready to collect your customer's payment credentials.
  1351  // Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
  1352  // The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides
  1353  // you through the setup process.
  1354  //
  1355  // Successful SetupIntents result in payment credentials that are optimized for future payments.
  1356  // For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
  1357  // [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection
  1358  // to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents).
  1359  // If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
  1360  // it automatically attaches the resulting payment method to that Customer after successful setup.
  1361  // We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
  1362  // PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.
  1363  //
  1364  // By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.
  1365  //
  1366  // Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents)
  1367  type SetupIntent struct {
  1368  	APIResource
  1369  	// ID of the Connect application that created the SetupIntent.
  1370  	Application *Application `json:"application"`
  1371  	// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
  1372  	//
  1373  	// It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
  1374  	AttachToSelf bool `json:"attach_to_self"`
  1375  	// Settings for dynamic payment methods compatible with this Setup Intent
  1376  	AutomaticPaymentMethods *SetupIntentAutomaticPaymentMethods `json:"automatic_payment_methods"`
  1377  	// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
  1378  	CancellationReason SetupIntentCancellationReason `json:"cancellation_reason"`
  1379  	// The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
  1380  	//
  1381  	// The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
  1382  	ClientSecret string `json:"client_secret"`
  1383  	// Time at which the object was created. Measured in seconds since the Unix epoch.
  1384  	Created int64 `json:"created"`
  1385  	// ID of the Customer this SetupIntent belongs to, if one exists.
  1386  	//
  1387  	// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.
  1388  	Customer *Customer `json:"customer"`
  1389  	// An arbitrary string attached to the object. Often useful for displaying to users.
  1390  	Description string `json:"description"`
  1391  	// Indicates the directions of money movement for which this payment method is intended to be used.
  1392  	//
  1393  	// Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
  1394  	FlowDirections []SetupIntentFlowDirection `json:"flow_directions"`
  1395  	// Unique identifier for the object.
  1396  	ID string `json:"id"`
  1397  	// The error encountered in the previous SetupIntent confirmation.
  1398  	LastSetupError *Error `json:"last_setup_error"`
  1399  	// The most recent SetupAttempt for this SetupIntent.
  1400  	LatestAttempt *SetupAttempt `json:"latest_attempt"`
  1401  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
  1402  	Livemode bool `json:"livemode"`
  1403  	// ID of the multi use Mandate generated by the SetupIntent.
  1404  	Mandate *Mandate `json:"mandate"`
  1405  	// 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.
  1406  	Metadata map[string]string `json:"metadata"`
  1407  	// If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
  1408  	NextAction *SetupIntentNextAction `json:"next_action"`
  1409  	// String representing the object's type. Objects of the same type share the same value.
  1410  	Object string `json:"object"`
  1411  	// The account (if any) for which the setup is intended.
  1412  	OnBehalfOf *Account `json:"on_behalf_of"`
  1413  	// ID of the payment method used with this SetupIntent.
  1414  	PaymentMethod *PaymentMethod `json:"payment_method"`
  1415  	// Information about the payment method configuration used for this Setup Intent.
  1416  	PaymentMethodConfigurationDetails *SetupIntentPaymentMethodConfigurationDetails `json:"payment_method_configuration_details"`
  1417  	// Payment method-specific configuration for this SetupIntent.
  1418  	PaymentMethodOptions *SetupIntentPaymentMethodOptions `json:"payment_method_options"`
  1419  	// The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
  1420  	PaymentMethodTypes []string `json:"payment_method_types"`
  1421  	// ID of the single_use Mandate generated by the SetupIntent.
  1422  	SingleUseMandate *Mandate `json:"single_use_mandate"`
  1423  	// [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
  1424  	Status SetupIntentStatus `json:"status"`
  1425  	// Indicates how the payment method is intended to be used in the future.
  1426  	//
  1427  	// Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.
  1428  	Usage SetupIntentUsage `json:"usage"`
  1429  }
  1430  
  1431  // SetupIntentList is a list of SetupIntents as retrieved from a list endpoint.
  1432  type SetupIntentList struct {
  1433  	APIResource
  1434  	ListMeta
  1435  	Data []*SetupIntent `json:"data"`
  1436  }
  1437  
  1438  // UnmarshalJSON handles deserialization of a SetupIntent.
  1439  // This custom unmarshaling is needed because the resulting
  1440  // property may be an id or the full struct if it was expanded.
  1441  func (s *SetupIntent) UnmarshalJSON(data []byte) error {
  1442  	if id, ok := ParseID(data); ok {
  1443  		s.ID = id
  1444  		return nil
  1445  	}
  1446  
  1447  	type setupIntent SetupIntent
  1448  	var v setupIntent
  1449  	if err := json.Unmarshal(data, &v); err != nil {
  1450  		return err
  1451  	}
  1452  
  1453  	*s = SetupIntent(v)
  1454  	return nil
  1455  }