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

stripe / stripe-go / 11295426688

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

Pull #1934

github

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

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

472 existing lines in 21 files now uncovered.

6209 of 9857 relevant lines covered (62.99%)

15.67 hits per line

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

0.0
/setupintent.go
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
        SetupIntentPaymentMethodOptionsCardNetworkGirocard        SetupIntentPaymentMethodOptionsCardNetwork = "girocard"
151
        SetupIntentPaymentMethodOptionsCardNetworkInterac         SetupIntentPaymentMethodOptionsCardNetwork = "interac"
152
        SetupIntentPaymentMethodOptionsCardNetworkJCB             SetupIntentPaymentMethodOptionsCardNetwork = "jcb"
153
        SetupIntentPaymentMethodOptionsCardNetworkMastercard      SetupIntentPaymentMethodOptionsCardNetwork = "mastercard"
154
        SetupIntentPaymentMethodOptionsCardNetworkUnionpay        SetupIntentPaymentMethodOptionsCardNetwork = "unionpay"
155
        SetupIntentPaymentMethodOptionsCardNetworkUnknown         SetupIntentPaymentMethodOptionsCardNetwork = "unknown"
156
        SetupIntentPaymentMethodOptionsCardNetworkVisa            SetupIntentPaymentMethodOptionsCardNetwork = "visa"
157
)
158

159
// 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.
160
type SetupIntentPaymentMethodOptionsCardRequestThreeDSecure string
161

162
// List of values that SetupIntentPaymentMethodOptionsCardRequestThreeDSecure can take
163
const (
164
        SetupIntentPaymentMethodOptionsCardRequestThreeDSecureAny       SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "any"
165
        SetupIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic"
166
        SetupIntentPaymentMethodOptionsCardRequestThreeDSecureChallenge SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge"
167
)
168

169
// The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
170
type SetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType string
171

172
// List of values that SetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType can take
173
const (
174
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountTypeFixed   SetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType = "fixed"
175
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountTypeMaximum SetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType = "maximum"
176
)
177

178
// The periodicity at which payments will be collected.
179
type SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule string
180

181
// List of values that SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule can take
182
const (
183
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleAdhoc       SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "adhoc"
184
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleAnnual      SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "annual"
185
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleDaily       SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "daily"
186
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleFortnightly SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "fortnightly"
187
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleMonthly     SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "monthly"
188
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleQuarterly   SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "quarterly"
189
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleSemiAnnual  SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "semi_annual"
190
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentScheduleWeekly      SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule = "weekly"
191
)
192

193
// The purpose for which payments are made. Defaults to retail.
194
type SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose string
195

196
// List of values that SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose can take
197
const (
198
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeDependantSupport SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "dependant_support"
199
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeGovernment       SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "government"
200
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeLoan             SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "loan"
201
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeMortgage         SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "mortgage"
202
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeOther            SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "other"
203
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposePension          SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "pension"
204
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposePersonal         SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "personal"
205
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeRetail           SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "retail"
206
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeSalary           SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "salary"
207
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeTax              SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "tax"
208
        SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurposeUtility          SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose = "utility"
209
)
210

211
// The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
212
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersAccountSubcategory string
213

214
// List of values that SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersAccountSubcategory can take
215
const (
216
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersAccountSubcategoryChecking SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersAccountSubcategory = "checking"
217
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersAccountSubcategorySavings  SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersAccountSubcategory = "savings"
218
)
219

220
// Settings for configuring manual entry of account details.
221
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode string
222

223
// List of values that SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode can take
224
const (
225
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryModeAutomatic SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode = "automatic"
226
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryModeCustom    SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode = "custom"
227
)
228

229
// The list of permissions to request. The `payment_method` permission must be included.
230
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission string
231

232
// List of values that SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission can take
233
const (
234
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionBalances      SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "balances"
235
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionOwnership     SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "ownership"
236
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "payment_method"
237
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions  SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "transactions"
238
)
239

240
// Data features requested to be retrieved upon account creation.
241
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch string
242

243
// List of values that SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch can take
244
const (
245
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchBalances         SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "balances"
246
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchInferredBalances SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "inferred_balances"
247
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchOwnership        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "ownership"
248
        SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchTransactions     SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "transactions"
249
)
250

251
// Mandate collection method
252
type SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod string
253

254
// List of values that SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod can take
255
const (
256
        SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethodPaper SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod = "paper"
257
)
258

259
// Bank account verification method.
260
type SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod string
261

262
// List of values that SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod can take
263
const (
264
        SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethodAutomatic     SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod = "automatic"
265
        SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethodInstant       SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod = "instant"
266
        SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethodMicrodeposits SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod = "microdeposits"
267
)
268

269
// [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`.
270
type SetupIntentStatus string
271

272
// List of values that SetupIntentStatus can take
273
const (
274
        SetupIntentStatusCanceled              SetupIntentStatus = "canceled"
275
        SetupIntentStatusProcessing            SetupIntentStatus = "processing"
276
        SetupIntentStatusRequiresAction        SetupIntentStatus = "requires_action"
277
        SetupIntentStatusRequiresConfirmation  SetupIntentStatus = "requires_confirmation"
278
        SetupIntentStatusRequiresPaymentMethod SetupIntentStatus = "requires_payment_method"
279
        SetupIntentStatusSucceeded             SetupIntentStatus = "succeeded"
280
)
281

282
// Indicates how the payment method is intended to be used in the future.
283
//
284
// 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`.
285
type SetupIntentUsage string
286

287
// List of values that SetupIntentUsage can take
288
const (
289
        SetupIntentUsageOffSession SetupIntentUsage = "off_session"
290
        SetupIntentUsageOnSession  SetupIntentUsage = "on_session"
291
)
292

293
// Returns a list of SetupIntents.
294
type SetupIntentListParams struct {
295
        ListParams `form:"*"`
296
        // If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
297
        //
298
        // 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.
299
        AttachToSelf *bool `form:"attach_to_self"`
300
        // 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.
301
        Created *int64 `form:"created"`
302
        // 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.
303
        CreatedRange *RangeQueryParams `form:"created"`
304
        // Only return SetupIntents for the customer specified by this customer ID.
305
        Customer *string `form:"customer"`
306
        // Specifies which fields in the response should be expanded.
307
        Expand []*string `form:"expand"`
308
        // Only return SetupIntents that associate with the specified payment method.
309
        PaymentMethod *string `form:"payment_method"`
310
}
311

312
// AddExpand appends a new field to expand.
313
func (p *SetupIntentListParams) AddExpand(f string) {
×
314
        p.Expand = append(p.Expand, &f)
×
315
}
×
316

317
// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
318
type SetupIntentAutomaticPaymentMethodsParams struct {
319
        // Controls whether this SetupIntent will accept redirect-based payment methods.
320
        //
321
        // 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.
322
        AllowRedirects *string `form:"allow_redirects"`
323
        // Whether this feature is enabled.
324
        Enabled *bool `form:"enabled"`
325
}
326

327
// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
328
type SetupIntentMandateDataCustomerAcceptanceOfflineParams struct{}
329

330
// If this is a Mandate accepted online, this hash contains details about the online acceptance.
331
type SetupIntentMandateDataCustomerAcceptanceOnlineParams struct {
332
        // The IP address from which the Mandate was accepted by the customer.
333
        IPAddress *string `form:"ip_address"`
334
        // The user agent of the browser from which the Mandate was accepted by the customer.
335
        UserAgent *string `form:"user_agent"`
336
}
337

338
// This hash contains details about the customer acceptance of the Mandate.
339
type SetupIntentMandateDataCustomerAcceptanceParams struct {
340
        // The time at which the customer accepted the Mandate.
341
        AcceptedAt *int64 `form:"accepted_at"`
342
        // If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
343
        Offline *SetupIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline"`
344
        // If this is a Mandate accepted online, this hash contains details about the online acceptance.
345
        Online *SetupIntentMandateDataCustomerAcceptanceOnlineParams `form:"online"`
346
        // The type of customer acceptance information included with the Mandate. One of `online` or `offline`.
347
        Type MandateCustomerAcceptanceType `form:"type"`
348
}
349

350
// 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).
351
type SetupIntentMandateDataParams struct {
352
        // This hash contains details about the customer acceptance of the Mandate.
353
        CustomerAcceptance *SetupIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"`
354
}
355

356
// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
357
type SetupIntentPaymentMethodDataACSSDebitParams struct {
358
        // Customer's bank account number.
359
        AccountNumber *string `form:"account_number"`
360
        // Institution number of the customer's bank.
361
        InstitutionNumber *string `form:"institution_number"`
362
        // Transit number of the customer's bank.
363
        TransitNumber *string `form:"transit_number"`
364
}
365

366
// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
367
type SetupIntentPaymentMethodDataAffirmParams struct{}
368

369
// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
370
type SetupIntentPaymentMethodDataAfterpayClearpayParams struct{}
371

372
// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
373
type SetupIntentPaymentMethodDataAlipayParams struct{}
374

375
// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
376
type SetupIntentPaymentMethodDataAmazonPayParams struct{}
377

378
// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
379
type SetupIntentPaymentMethodDataAUBECSDebitParams struct {
380
        // The account number for the bank account.
381
        AccountNumber *string `form:"account_number"`
382
        // Bank-State-Branch number of the bank account.
383
        BSBNumber *string `form:"bsb_number"`
384
}
385

386
// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
387
type SetupIntentPaymentMethodDataBACSDebitParams struct {
388
        // Account number of the bank account that the funds will be debited from.
389
        AccountNumber *string `form:"account_number"`
390
        // Sort code of the bank account. (e.g., `10-20-30`)
391
        SortCode *string `form:"sort_code"`
392
}
393

394
// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
395
type SetupIntentPaymentMethodDataBancontactParams struct{}
396

397
// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
398
type SetupIntentPaymentMethodDataBillingDetailsParams struct {
399
        // Billing address.
400
        Address *AddressParams `form:"address"`
401
        // Email address.
402
        Email *string `form:"email"`
403
        // Full name.
404
        Name *string `form:"name"`
405
        // Billing phone number (including extension).
406
        Phone *string `form:"phone"`
407
}
408

409
// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
410
type SetupIntentPaymentMethodDataBLIKParams struct{}
411

412
// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
413
type SetupIntentPaymentMethodDataBoletoParams struct {
414
        // The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
415
        TaxID *string `form:"tax_id"`
416
}
417

418
// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
419
type SetupIntentPaymentMethodDataCashAppParams struct{}
420

421
// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
422
type SetupIntentPaymentMethodDataCustomerBalanceParams struct{}
423

424
// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
425
type SetupIntentPaymentMethodDataEPSParams struct {
426
        // The customer's bank.
427
        Bank *string `form:"bank"`
428
}
429

430
// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
431
type SetupIntentPaymentMethodDataFPXParams struct {
432
        // Account holder type for FPX transaction
433
        AccountHolderType *string `form:"account_holder_type"`
434
        // The customer's bank.
435
        Bank *string `form:"bank"`
436
}
437

438
// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
439
type SetupIntentPaymentMethodDataGiropayParams struct{}
440

441
// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
442
type SetupIntentPaymentMethodDataGrabpayParams struct{}
443

444
// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
445
type SetupIntentPaymentMethodDataIDEALParams struct {
446
        // The customer's bank.
447
        Bank *string `form:"bank"`
448
}
449

450
// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
451
type SetupIntentPaymentMethodDataInteracPresentParams struct{}
452

453
// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
454
type SetupIntentPaymentMethodDataKakaoPayParams struct{}
455

456
// Customer's date of birth
457
type SetupIntentPaymentMethodDataKlarnaDOBParams struct {
458
        // The day of birth, between 1 and 31.
459
        Day *int64 `form:"day"`
460
        // The month of birth, between 1 and 12.
461
        Month *int64 `form:"month"`
462
        // The four-digit year of birth.
463
        Year *int64 `form:"year"`
464
}
465

466
// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
467
type SetupIntentPaymentMethodDataKlarnaParams struct {
468
        // Customer's date of birth
469
        DOB *SetupIntentPaymentMethodDataKlarnaDOBParams `form:"dob"`
470
}
471

472
// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
473
type SetupIntentPaymentMethodDataKonbiniParams struct{}
474

475
// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
476
type SetupIntentPaymentMethodDataKrCardParams struct{}
477

478
// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
479
type SetupIntentPaymentMethodDataLinkParams struct{}
480

481
// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
482
type SetupIntentPaymentMethodDataMbWayParams struct{}
483

484
// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
485
type SetupIntentPaymentMethodDataMobilepayParams struct{}
486

487
// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
488
type SetupIntentPaymentMethodDataMultibancoParams struct{}
489

490
// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
491
type SetupIntentPaymentMethodDataNaverPayParams struct {
492
        // Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`.
493
        Funding *string `form:"funding"`
494
}
495

496
// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
497
type SetupIntentPaymentMethodDataOXXOParams struct{}
498

499
// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
500
type SetupIntentPaymentMethodDataP24Params struct {
501
        // The customer's bank.
502
        Bank *string `form:"bank"`
503
}
504

505
// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
506
type SetupIntentPaymentMethodDataPaycoParams struct{}
507

508
// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
509
type SetupIntentPaymentMethodDataPayNowParams struct{}
510

511
// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
512
type SetupIntentPaymentMethodDataPaypalParams struct{}
513

514
// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
515
type SetupIntentPaymentMethodDataPaytoParams struct {
516
        // The account number for the bank account.
517
        AccountNumber *string `form:"account_number"`
518
        // Bank-State-Branch number of the bank account.
519
        BSBNumber *string `form:"bsb_number"`
520
        // The PayID alias for the bank account.
521
        PayID *string `form:"pay_id"`
522
}
523

524
// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
525
type SetupIntentPaymentMethodDataPixParams struct{}
526

527
// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
528
type SetupIntentPaymentMethodDataPromptPayParams struct{}
529

530
// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
531
type SetupIntentPaymentMethodDataRadarOptionsParams struct {
532
        // 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.
533
        Session *string `form:"session"`
534
}
535

536
// Customer's date of birth
537
type SetupIntentPaymentMethodDataRechnungDOBParams struct {
538
        // The day of birth, between 1 and 31.
539
        Day *int64 `form:"day"`
540
        // The month of birth, between 1 and 12.
541
        Month *int64 `form:"month"`
542
        // The four-digit year of birth.
543
        Year *int64 `form:"year"`
544
}
545

546
// If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method.
547
type SetupIntentPaymentMethodDataRechnungParams struct {
548
        // Customer's date of birth
549
        DOB *SetupIntentPaymentMethodDataRechnungDOBParams `form:"dob"`
550
}
551

552
// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
553
type SetupIntentPaymentMethodDataRevolutPayParams struct{}
554

555
// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
556
type SetupIntentPaymentMethodDataSamsungPayParams struct{}
557

558
// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
559
type SetupIntentPaymentMethodDataSEPADebitParams struct {
560
        // IBAN of the bank account.
561
        IBAN *string `form:"iban"`
562
}
563

564
// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
565
type SetupIntentPaymentMethodDataSofortParams struct {
566
        // Two-letter ISO code representing the country the bank account is located in.
567
        Country *string `form:"country"`
568
}
569

570
// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
571
type SetupIntentPaymentMethodDataSwishParams struct{}
572

573
// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
574
type SetupIntentPaymentMethodDataTWINTParams struct{}
575

576
// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
577
type SetupIntentPaymentMethodDataUSBankAccountParams struct {
578
        // Account holder type: individual or company.
579
        AccountHolderType *string `form:"account_holder_type"`
580
        // Account number of the bank account.
581
        AccountNumber *string `form:"account_number"`
582
        // Account type: checkings or savings. Defaults to checking if omitted.
583
        AccountType *string `form:"account_type"`
584
        // The ID of a Financial Connections Account to use as a payment method.
585
        FinancialConnectionsAccount *string `form:"financial_connections_account"`
586
        // Routing number of the bank account.
587
        RoutingNumber *string `form:"routing_number"`
588
}
589

590
// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
591
type SetupIntentPaymentMethodDataWeChatPayParams struct{}
592

593
// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
594
type SetupIntentPaymentMethodDataZipParams struct{}
595

596
// 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)
597
// value in the SetupIntent.
598
type SetupIntentPaymentMethodDataParams struct {
599
        // If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
600
        ACSSDebit *SetupIntentPaymentMethodDataACSSDebitParams `form:"acss_debit"`
601
        // If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
602
        Affirm *SetupIntentPaymentMethodDataAffirmParams `form:"affirm"`
603
        // If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
604
        AfterpayClearpay *SetupIntentPaymentMethodDataAfterpayClearpayParams `form:"afterpay_clearpay"`
605
        // If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
606
        Alipay *SetupIntentPaymentMethodDataAlipayParams `form:"alipay"`
607
        // This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`.
608
        AllowRedisplay *string `form:"allow_redisplay"`
609
        // If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
610
        AmazonPay *SetupIntentPaymentMethodDataAmazonPayParams `form:"amazon_pay"`
611
        // If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
612
        AUBECSDebit *SetupIntentPaymentMethodDataAUBECSDebitParams `form:"au_becs_debit"`
613
        // If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
614
        BACSDebit *SetupIntentPaymentMethodDataBACSDebitParams `form:"bacs_debit"`
615
        // If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
616
        Bancontact *SetupIntentPaymentMethodDataBancontactParams `form:"bancontact"`
617
        // Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
618
        BillingDetails *SetupIntentPaymentMethodDataBillingDetailsParams `form:"billing_details"`
619
        // If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
620
        BLIK *SetupIntentPaymentMethodDataBLIKParams `form:"blik"`
621
        // If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
622
        Boleto *SetupIntentPaymentMethodDataBoletoParams `form:"boleto"`
623
        // If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
624
        CashApp *SetupIntentPaymentMethodDataCashAppParams `form:"cashapp"`
625
        // If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
626
        CustomerBalance *SetupIntentPaymentMethodDataCustomerBalanceParams `form:"customer_balance"`
627
        // If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
628
        EPS *SetupIntentPaymentMethodDataEPSParams `form:"eps"`
629
        // If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
630
        FPX *SetupIntentPaymentMethodDataFPXParams `form:"fpx"`
631
        // If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
632
        Giropay *SetupIntentPaymentMethodDataGiropayParams `form:"giropay"`
633
        // If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
634
        Grabpay *SetupIntentPaymentMethodDataGrabpayParams `form:"grabpay"`
635
        // If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
636
        IDEAL *SetupIntentPaymentMethodDataIDEALParams `form:"ideal"`
637
        // If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
638
        InteracPresent *SetupIntentPaymentMethodDataInteracPresentParams `form:"interac_present"`
639
        // If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
640
        KakaoPay *SetupIntentPaymentMethodDataKakaoPayParams `form:"kakao_pay"`
641
        // If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
642
        Klarna *SetupIntentPaymentMethodDataKlarnaParams `form:"klarna"`
643
        // If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
644
        Konbini *SetupIntentPaymentMethodDataKonbiniParams `form:"konbini"`
645
        // If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
646
        KrCard *SetupIntentPaymentMethodDataKrCardParams `form:"kr_card"`
647
        // If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
648
        Link *SetupIntentPaymentMethodDataLinkParams `form:"link"`
649
        // If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
650
        MbWay *SetupIntentPaymentMethodDataMbWayParams `form:"mb_way"`
651
        // 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`.
652
        Metadata map[string]string `form:"metadata"`
653
        // If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
654
        Mobilepay *SetupIntentPaymentMethodDataMobilepayParams `form:"mobilepay"`
655
        // If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
656
        Multibanco *SetupIntentPaymentMethodDataMultibancoParams `form:"multibanco"`
657
        // If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
658
        NaverPay *SetupIntentPaymentMethodDataNaverPayParams `form:"naver_pay"`
659
        // If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
660
        OXXO *SetupIntentPaymentMethodDataOXXOParams `form:"oxxo"`
661
        // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
662
        P24 *SetupIntentPaymentMethodDataP24Params `form:"p24"`
663
        // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
664
        Payco *SetupIntentPaymentMethodDataPaycoParams `form:"payco"`
665
        // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
666
        PayNow *SetupIntentPaymentMethodDataPayNowParams `form:"paynow"`
667
        // If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
668
        Paypal *SetupIntentPaymentMethodDataPaypalParams `form:"paypal"`
669
        // If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
670
        Payto *SetupIntentPaymentMethodDataPaytoParams `form:"payto"`
671
        // If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
672
        Pix *SetupIntentPaymentMethodDataPixParams `form:"pix"`
673
        // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
674
        PromptPay *SetupIntentPaymentMethodDataPromptPayParams `form:"promptpay"`
675
        // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
676
        RadarOptions *SetupIntentPaymentMethodDataRadarOptionsParams `form:"radar_options"`
677
        // If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method.
678
        Rechnung *SetupIntentPaymentMethodDataRechnungParams `form:"rechnung"`
679
        // If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
680
        RevolutPay *SetupIntentPaymentMethodDataRevolutPayParams `form:"revolut_pay"`
681
        // If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
682
        SamsungPay *SetupIntentPaymentMethodDataSamsungPayParams `form:"samsung_pay"`
683
        // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
684
        SEPADebit *SetupIntentPaymentMethodDataSEPADebitParams `form:"sepa_debit"`
685
        // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
686
        Sofort *SetupIntentPaymentMethodDataSofortParams `form:"sofort"`
687
        // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
688
        Swish *SetupIntentPaymentMethodDataSwishParams `form:"swish"`
689
        // If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
690
        TWINT *SetupIntentPaymentMethodDataTWINTParams `form:"twint"`
691
        // 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.
692
        Type *string `form:"type"`
693
        // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
694
        USBankAccount *SetupIntentPaymentMethodDataUSBankAccountParams `form:"us_bank_account"`
695
        // If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
696
        WeChatPay *SetupIntentPaymentMethodDataWeChatPayParams `form:"wechat_pay"`
697
        // If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
698
        Zip *SetupIntentPaymentMethodDataZipParams `form:"zip"`
699
}
700

701
// AddMetadata adds a new key-value pair to the Metadata.
UNCOV
702
func (p *SetupIntentPaymentMethodDataParams) AddMetadata(key string, value string) {
×
703
        if p.Metadata == nil {
×
704
                p.Metadata = make(map[string]string)
×
UNCOV
705
        }
×
706

UNCOV
707
        p.Metadata[key] = value
×
708
}
709

710
// Additional fields for Mandate creation
711
type SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams struct {
712
        // A URL for custom mandate text to render during confirmation step.
713
        // The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,
714
        // or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
715
        CustomMandateURL *string `form:"custom_mandate_url"`
716
        // List of Stripe products where this mandate can be selected automatically.
717
        DefaultFor []*string `form:"default_for"`
718
        // Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
719
        IntervalDescription *string `form:"interval_description"`
720
        // Payment schedule for the mandate.
721
        PaymentSchedule *string `form:"payment_schedule"`
722
        // Transaction type of the mandate.
723
        TransactionType *string `form:"transaction_type"`
724
}
725

726
// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
727
type SetupIntentPaymentMethodOptionsACSSDebitParams struct {
728
        // 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).
729
        Currency *string `form:"currency"`
730
        // Additional fields for Mandate creation
731
        MandateOptions *SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"`
732
        // Bank account verification method.
733
        VerificationMethod *string `form:"verification_method"`
734
}
735

736
// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
737
type SetupIntentPaymentMethodOptionsAmazonPayParams struct{}
738

739
// Additional fields for Mandate creation
740
type SetupIntentPaymentMethodOptionsBACSDebitMandateOptionsParams struct{}
741

742
// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
743
type SetupIntentPaymentMethodOptionsBACSDebitParams struct {
744
        // Additional fields for Mandate creation
745
        MandateOptions *SetupIntentPaymentMethodOptionsBACSDebitMandateOptionsParams `form:"mandate_options"`
746
}
747

748
// Configuration options for setting up an eMandate for cards issued in India.
749
type SetupIntentPaymentMethodOptionsCardMandateOptionsParams struct {
750
        // Amount to be charged for future payments.
751
        Amount *int64 `form:"amount"`
752
        // 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.
753
        AmountType *string `form:"amount_type"`
754
        // 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).
755
        Currency *string `form:"currency"`
756
        // A description of the mandate or subscription that is meant to be displayed to the customer.
757
        Description *string `form:"description"`
758
        // 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.
759
        EndDate *int64 `form:"end_date"`
760
        // Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
761
        Interval *string `form:"interval"`
762
        // 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`.
763
        IntervalCount *int64 `form:"interval_count"`
764
        // Unique identifier for the mandate or subscription.
765
        Reference *string `form:"reference"`
766
        // Start date of the mandate or subscription. Start date should not be lesser than yesterday.
767
        StartDate *int64 `form:"start_date"`
768
        // Specifies the type of mandates supported. Possible values are `india`.
769
        SupportedTypes []*string `form:"supported_types"`
770
}
771

772
// Cartes Bancaires-specific 3DS fields.
773
type SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesParams struct {
774
        // The cryptogram calculation algorithm used by the card Issuer's ACS
775
        // to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
776
        // messageExtension: CB-AVALGO
777
        CbAvalgo *string `form:"cb_avalgo"`
778
        // The exemption indicator returned from Cartes Bancaires in the ARes.
779
        // message extension: CB-EXEMPTION; string (4 characters)
780
        // This is a 3 byte bitmap (low significant byte first and most significant
781
        // bit first) that has been Base64 encoded
782
        CbExemption *string `form:"cb_exemption"`
783
        // The risk score returned from Cartes Bancaires in the ARes.
784
        // message extension: CB-SCORE; numeric value 0-99
785
        CbScore *int64 `form:"cb_score"`
786
}
787

788
// Network specific 3DS fields. Network specific arguments require an
789
// explicit card brand choice. The parameter `payment_method_options.card.network“
790
// must be populated accordingly
791
type SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsParams struct {
792
        // Cartes Bancaires-specific 3DS fields.
793
        CartesBancaires *SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesParams `form:"cartes_bancaires"`
794
}
795

796
// If 3D Secure authentication was performed with a third-party provider,
797
// the authentication details to use for this setup.
798
type SetupIntentPaymentMethodOptionsCardThreeDSecureParams struct {
799
        // The `transStatus` returned from the card Issuer's ACS in the ARes.
800
        AresTransStatus *string `form:"ares_trans_status"`
801
        // The cryptogram, also known as the "authentication value" (AAV, CAVV or
802
        // AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
803
        // (Most 3D Secure providers will return the base64-encoded version, which
804
        // is what you should specify here.)
805
        Cryptogram *string `form:"cryptogram"`
806
        // The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
807
        // provider and indicates what degree of authentication was performed.
808
        ElectronicCommerceIndicator *string `form:"electronic_commerce_indicator"`
809
        // Network specific 3DS fields. Network specific arguments require an
810
        // explicit card brand choice. The parameter `payment_method_options.card.network``
811
        // must be populated accordingly
812
        NetworkOptions *SetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsParams `form:"network_options"`
813
        // The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
814
        // AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
815
        RequestorChallengeIndicator *string `form:"requestor_challenge_indicator"`
816
        // For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
817
        // Transaction ID (dsTransID).
818
        TransactionID *string `form:"transaction_id"`
819
        // The version of 3D Secure that was performed.
820
        Version *string `form:"version"`
821
}
822

823
// Configuration for any card setup attempted on this SetupIntent.
824
type SetupIntentPaymentMethodOptionsCardParams struct {
825
        // Configuration options for setting up an eMandate for cards issued in India.
826
        MandateOptions *SetupIntentPaymentMethodOptionsCardMandateOptionsParams `form:"mandate_options"`
827
        // When specified, this parameter signals that a card has been collected
828
        // as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
829
        // parameter can only be provided during confirmation.
830
        MOTO *bool `form:"moto"`
831
        // 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.
832
        Network *string `form:"network"`
833
        // 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.
834
        RequestThreeDSecure *string `form:"request_three_d_secure"`
835
        // If 3D Secure authentication was performed with a third-party provider,
836
        // the authentication details to use for this setup.
837
        ThreeDSecure *SetupIntentPaymentMethodOptionsCardThreeDSecureParams `form:"three_d_secure"`
838
}
839

840
// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
841
type SetupIntentPaymentMethodOptionsCardPresentParams struct{}
842

843
// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
844
type SetupIntentPaymentMethodOptionsLinkParams struct {
845
        // [Deprecated] This is a legacy parameter that no longer has any function.
846
        // Deprecated:
847
        PersistentToken *string `form:"persistent_token"`
848
}
849

850
// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
851
type SetupIntentPaymentMethodOptionsPaypalParams struct {
852
        // The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
853
        BillingAgreementID *string `form:"billing_agreement_id"`
854
        Currency           *string `form:"currency"`
855
        // The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used.
856
        Subsellers []*string `form:"subsellers"`
857
}
858

859
// Additional fields for Mandate creation.
860
type SetupIntentPaymentMethodOptionsPaytoMandateOptionsParams struct {
861
        // Amount that will be collected. It is required when `amount_type` is `fixed`.
862
        Amount *int64 `form:"amount"`
863
        // The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
864
        AmountType *string `form:"amount_type"`
865
        // Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date.
866
        EndDate *string `form:"end_date"`
867
        // The periodicity at which payments will be collected.
868
        PaymentSchedule *string `form:"payment_schedule"`
869
        // The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit.
870
        PaymentsPerPeriod *int64 `form:"payments_per_period"`
871
        // The purpose for which payments are made. Defaults to retail.
872
        Purpose *string `form:"purpose"`
873
        // Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time.
874
        StartDate *string `form:"start_date"`
875
}
876

877
// If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
878
type SetupIntentPaymentMethodOptionsPaytoParams struct {
879
        // Additional fields for Mandate creation.
880
        MandateOptions *SetupIntentPaymentMethodOptionsPaytoMandateOptionsParams `form:"mandate_options"`
881
}
882

883
// Additional fields for Mandate creation
884
type SetupIntentPaymentMethodOptionsSEPADebitMandateOptionsParams struct{}
885

886
// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
887
type SetupIntentPaymentMethodOptionsSEPADebitParams struct {
888
        // Additional fields for Mandate creation
889
        MandateOptions *SetupIntentPaymentMethodOptionsSEPADebitMandateOptionsParams `form:"mandate_options"`
890
}
891

892
// Provide filters for the linked accounts that the customer can select for the payment method
893
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersParams struct {
894
        // The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
895
        AccountSubcategories []*string `form:"account_subcategories"`
896
        // ID of the institution to use to filter for selectable accounts.
897
        Institution *string `form:"institution"`
898
}
899

900
// Customize manual entry behavior
901
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryParams struct {
902
        // Settings for configuring manual entry of account details.
903
        Mode *string `form:"mode"`
904
}
905

906
// Additional fields for Financial Connections Session creation
907
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct {
908
        // Provide filters for the linked accounts that the customer can select for the payment method
909
        Filters *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersParams `form:"filters"`
910
        // Customize manual entry behavior
911
        ManualEntry *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryParams `form:"manual_entry"`
912
        // 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`.
913
        Permissions []*string `form:"permissions"`
914
        // List of data features that you would like to retrieve upon account creation.
915
        Prefetch []*string `form:"prefetch"`
916
        // 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.
917
        ReturnURL *string `form:"return_url"`
918
}
919

920
// Additional fields for Mandate creation
921
type SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsParams struct {
922
        // The method used to collect offline mandate customer acceptance.
923
        CollectionMethod *string `form:"collection_method"`
924
}
925

926
// Additional fields for network related functions
927
type SetupIntentPaymentMethodOptionsUSBankAccountNetworksParams struct {
928
        // Triggers validations to run across the selected networks
929
        Requested []*string `form:"requested"`
930
}
931

932
// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
933
type SetupIntentPaymentMethodOptionsUSBankAccountParams struct {
934
        // Additional fields for Financial Connections Session creation
935
        FinancialConnections *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams `form:"financial_connections"`
936
        // Additional fields for Mandate creation
937
        MandateOptions *SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsParams `form:"mandate_options"`
938
        // Additional fields for network related functions
939
        Networks *SetupIntentPaymentMethodOptionsUSBankAccountNetworksParams `form:"networks"`
940
        // Bank account verification method.
941
        VerificationMethod *string `form:"verification_method"`
942
}
943

944
// Payment method-specific configuration for this SetupIntent.
945
type SetupIntentPaymentMethodOptionsParams struct {
946
        // If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
947
        ACSSDebit *SetupIntentPaymentMethodOptionsACSSDebitParams `form:"acss_debit"`
948
        // If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
949
        AmazonPay *SetupIntentPaymentMethodOptionsAmazonPayParams `form:"amazon_pay"`
950
        // If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
951
        BACSDebit *SetupIntentPaymentMethodOptionsBACSDebitParams `form:"bacs_debit"`
952
        // Configuration for any card setup attempted on this SetupIntent.
953
        Card *SetupIntentPaymentMethodOptionsCardParams `form:"card"`
954
        // If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
955
        CardPresent *SetupIntentPaymentMethodOptionsCardPresentParams `form:"card_present"`
956
        // If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
957
        Link *SetupIntentPaymentMethodOptionsLinkParams `form:"link"`
958
        // If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
959
        Paypal *SetupIntentPaymentMethodOptionsPaypalParams `form:"paypal"`
960
        // If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
961
        Payto *SetupIntentPaymentMethodOptionsPaytoParams `form:"payto"`
962
        // If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
963
        SEPADebit *SetupIntentPaymentMethodOptionsSEPADebitParams `form:"sepa_debit"`
964
        // If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
965
        USBankAccount *SetupIntentPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"`
966
}
967

968
// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
969
type SetupIntentSingleUseParams struct {
970
        // 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).
971
        Amount *int64 `form:"amount"`
972
        // 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).
973
        Currency *string `form:"currency"`
974
}
975

976
// Creates a SetupIntent object.
977
//
978
// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm)
979
// it to collect any required permissions to charge the payment method later.
980
type SetupIntentParams struct {
981
        Params `form:"*"`
982
        // If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
983
        //
984
        // 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.
985
        AttachToSelf *bool `form:"attach_to_self"`
986
        // When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
987
        AutomaticPaymentMethods *SetupIntentAutomaticPaymentMethodsParams `form:"automatic_payment_methods"`
988
        // The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent.
989
        ClientSecret *string `form:"client_secret"`
990
        // 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.
991
        Confirm *bool `form:"confirm"`
992
        // ID of the ConfirmationToken used to confirm this SetupIntent.
993
        //
994
        // 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.
995
        ConfirmationToken *string `form:"confirmation_token"`
996
        // ID of the Customer this SetupIntent belongs to, if one exists.
997
        //
998
        // 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.
999
        Customer *string `form:"customer"`
1000
        // An arbitrary string attached to the object. Often useful for displaying to users.
1001
        Description *string `form:"description"`
1002
        // Specifies which fields in the response should be expanded.
1003
        Expand []*string `form:"expand"`
1004
        // Indicates the directions of money movement for which this payment method is intended to be used.
1005
        //
1006
        // 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.
1007
        FlowDirections []*string `form:"flow_directions"`
1008
        // 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).
1009
        MandateData *SetupIntentMandateDataParams `form:"mandate_data"`
1010
        // 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`.
1011
        Metadata map[string]string `form:"metadata"`
1012
        // The Stripe account ID created for this SetupIntent.
1013
        OnBehalfOf *string `form:"on_behalf_of"`
1014
        // ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. To unset this field to null, pass in an empty string.
1015
        PaymentMethod *string `form:"payment_method"`
1016
        // The ID of the payment method configuration to use with this SetupIntent.
1017
        PaymentMethodConfiguration *string `form:"payment_method_configuration"`
1018
        // 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)
1019
        // value in the SetupIntent.
1020
        PaymentMethodData *SetupIntentPaymentMethodDataParams `form:"payment_method_data"`
1021
        // Payment method-specific configuration for this SetupIntent.
1022
        PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
1023
        // 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"].
1024
        PaymentMethodTypes []*string `form:"payment_method_types"`
1025
        // 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).
1026
        ReturnURL *string `form:"return_url"`
1027
        // If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
1028
        SingleUse *SetupIntentSingleUseParams `form:"single_use"`
1029
        // Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`.
1030
        Usage *string `form:"usage"`
1031
        // Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
1032
        UseStripeSDK *bool `form:"use_stripe_sdk"`
1033
}
1034

1035
// AddExpand appends a new field to expand.
UNCOV
1036
func (p *SetupIntentParams) AddExpand(f string) {
×
UNCOV
1037
        p.Expand = append(p.Expand, &f)
×
UNCOV
1038
}
×
1039

1040
// AddMetadata adds a new key-value pair to the Metadata.
UNCOV
1041
func (p *SetupIntentParams) AddMetadata(key string, value string) {
×
UNCOV
1042
        if p.Metadata == nil {
×
UNCOV
1043
                p.Metadata = make(map[string]string)
×
UNCOV
1044
        }
×
1045

UNCOV
1046
        p.Metadata[key] = value
×
1047
}
1048

1049
// You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
1050
//
1051
// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
1052
type SetupIntentCancelParams struct {
1053
        Params `form:"*"`
1054
        // Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`
1055
        CancellationReason *string `form:"cancellation_reason"`
1056
        // Specifies which fields in the response should be expanded.
1057
        Expand []*string `form:"expand"`
1058
}
1059

1060
// AddExpand appends a new field to expand.
1061
func (p *SetupIntentCancelParams) AddExpand(f string) {
×
1062
        p.Expand = append(p.Expand, &f)
×
1063
}
×
1064

1065
// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
1066
type SetupIntentConfirmPaymentMethodDataACSSDebitParams struct {
1067
        // Customer's bank account number.
1068
        AccountNumber *string `form:"account_number"`
1069
        // Institution number of the customer's bank.
1070
        InstitutionNumber *string `form:"institution_number"`
1071
        // Transit number of the customer's bank.
1072
        TransitNumber *string `form:"transit_number"`
1073
}
1074

1075
// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
1076
type SetupIntentConfirmPaymentMethodDataAffirmParams struct{}
1077

1078
// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
1079
type SetupIntentConfirmPaymentMethodDataAfterpayClearpayParams struct{}
1080

1081
// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
1082
type SetupIntentConfirmPaymentMethodDataAlipayParams struct{}
1083

1084
// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
1085
type SetupIntentConfirmPaymentMethodDataAmazonPayParams struct{}
1086

1087
// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
1088
type SetupIntentConfirmPaymentMethodDataAUBECSDebitParams struct {
1089
        // The account number for the bank account.
1090
        AccountNumber *string `form:"account_number"`
1091
        // Bank-State-Branch number of the bank account.
1092
        BSBNumber *string `form:"bsb_number"`
1093
}
1094

1095
// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
1096
type SetupIntentConfirmPaymentMethodDataBACSDebitParams struct {
1097
        // Account number of the bank account that the funds will be debited from.
1098
        AccountNumber *string `form:"account_number"`
1099
        // Sort code of the bank account. (e.g., `10-20-30`)
1100
        SortCode *string `form:"sort_code"`
1101
}
1102

1103
// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
1104
type SetupIntentConfirmPaymentMethodDataBancontactParams struct{}
1105

1106
// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
1107
type SetupIntentConfirmPaymentMethodDataBillingDetailsParams struct {
1108
        // Billing address.
1109
        Address *AddressParams `form:"address"`
1110
        // Email address.
1111
        Email *string `form:"email"`
1112
        // Full name.
1113
        Name *string `form:"name"`
1114
        // Billing phone number (including extension).
1115
        Phone *string `form:"phone"`
1116
}
1117

1118
// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
1119
type SetupIntentConfirmPaymentMethodDataBLIKParams struct{}
1120

1121
// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
1122
type SetupIntentConfirmPaymentMethodDataBoletoParams struct {
1123
        // The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
1124
        TaxID *string `form:"tax_id"`
1125
}
1126

1127
// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
1128
type SetupIntentConfirmPaymentMethodDataCashAppParams struct{}
1129

1130
// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
1131
type SetupIntentConfirmPaymentMethodDataCustomerBalanceParams struct{}
1132

1133
// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
1134
type SetupIntentConfirmPaymentMethodDataEPSParams struct {
1135
        // The customer's bank.
1136
        Bank *string `form:"bank"`
1137
}
1138

1139
// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
1140
type SetupIntentConfirmPaymentMethodDataFPXParams struct {
1141
        // Account holder type for FPX transaction
1142
        AccountHolderType *string `form:"account_holder_type"`
1143
        // The customer's bank.
1144
        Bank *string `form:"bank"`
1145
}
1146

1147
// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
1148
type SetupIntentConfirmPaymentMethodDataGiropayParams struct{}
1149

1150
// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
1151
type SetupIntentConfirmPaymentMethodDataGrabpayParams struct{}
1152

1153
// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1154
type SetupIntentConfirmPaymentMethodDataIDEALParams struct {
1155
        // The customer's bank.
1156
        Bank *string `form:"bank"`
1157
}
1158

1159
// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
1160
type SetupIntentConfirmPaymentMethodDataInteracPresentParams struct{}
1161

1162
// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
1163
type SetupIntentConfirmPaymentMethodDataKakaoPayParams struct{}
1164

1165
// Customer's date of birth
1166
type SetupIntentConfirmPaymentMethodDataKlarnaDOBParams struct {
1167
        // The day of birth, between 1 and 31.
1168
        Day *int64 `form:"day"`
1169
        // The month of birth, between 1 and 12.
1170
        Month *int64 `form:"month"`
1171
        // The four-digit year of birth.
1172
        Year *int64 `form:"year"`
1173
}
1174

1175
// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1176
type SetupIntentConfirmPaymentMethodDataKlarnaParams struct {
1177
        // Customer's date of birth
1178
        DOB *SetupIntentConfirmPaymentMethodDataKlarnaDOBParams `form:"dob"`
1179
}
1180

1181
// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
1182
type SetupIntentConfirmPaymentMethodDataKonbiniParams struct{}
1183

1184
// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
1185
type SetupIntentConfirmPaymentMethodDataKrCardParams struct{}
1186

1187
// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
1188
type SetupIntentConfirmPaymentMethodDataLinkParams struct{}
1189

1190
// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
1191
type SetupIntentConfirmPaymentMethodDataMbWayParams struct{}
1192

1193
// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
1194
type SetupIntentConfirmPaymentMethodDataMobilepayParams struct{}
1195

1196
// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
1197
type SetupIntentConfirmPaymentMethodDataMultibancoParams struct{}
1198

1199
// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1200
type SetupIntentConfirmPaymentMethodDataNaverPayParams struct {
1201
        // Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`.
1202
        Funding *string `form:"funding"`
1203
}
1204

1205
// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
1206
type SetupIntentConfirmPaymentMethodDataOXXOParams struct{}
1207

1208
// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1209
type SetupIntentConfirmPaymentMethodDataP24Params struct {
1210
        // The customer's bank.
1211
        Bank *string `form:"bank"`
1212
}
1213

1214
// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
1215
type SetupIntentConfirmPaymentMethodDataPaycoParams struct{}
1216

1217
// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
1218
type SetupIntentConfirmPaymentMethodDataPayNowParams struct{}
1219

1220
// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
1221
type SetupIntentConfirmPaymentMethodDataPaypalParams struct{}
1222

1223
// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
1224
type SetupIntentConfirmPaymentMethodDataPaytoParams struct {
1225
        // The account number for the bank account.
1226
        AccountNumber *string `form:"account_number"`
1227
        // Bank-State-Branch number of the bank account.
1228
        BSBNumber *string `form:"bsb_number"`
1229
        // The PayID alias for the bank account.
1230
        PayID *string `form:"pay_id"`
1231
}
1232

1233
// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
1234
type SetupIntentConfirmPaymentMethodDataPixParams struct{}
1235

1236
// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
1237
type SetupIntentConfirmPaymentMethodDataPromptPayParams struct{}
1238

1239
// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
1240
type SetupIntentConfirmPaymentMethodDataRadarOptionsParams struct {
1241
        // 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.
1242
        Session *string `form:"session"`
1243
}
1244

1245
// Customer's date of birth
1246
type SetupIntentConfirmPaymentMethodDataRechnungDOBParams struct {
1247
        // The day of birth, between 1 and 31.
1248
        Day *int64 `form:"day"`
1249
        // The month of birth, between 1 and 12.
1250
        Month *int64 `form:"month"`
1251
        // The four-digit year of birth.
1252
        Year *int64 `form:"year"`
1253
}
1254

1255
// If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method.
1256
type SetupIntentConfirmPaymentMethodDataRechnungParams struct {
1257
        // Customer's date of birth
1258
        DOB *SetupIntentConfirmPaymentMethodDataRechnungDOBParams `form:"dob"`
1259
}
1260

1261
// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
1262
type SetupIntentConfirmPaymentMethodDataRevolutPayParams struct{}
1263

1264
// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
1265
type SetupIntentConfirmPaymentMethodDataSamsungPayParams struct{}
1266

1267
// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1268
type SetupIntentConfirmPaymentMethodDataSEPADebitParams struct {
1269
        // IBAN of the bank account.
1270
        IBAN *string `form:"iban"`
1271
}
1272

1273
// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1274
type SetupIntentConfirmPaymentMethodDataSofortParams struct {
1275
        // Two-letter ISO code representing the country the bank account is located in.
1276
        Country *string `form:"country"`
1277
}
1278

1279
// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
1280
type SetupIntentConfirmPaymentMethodDataSwishParams struct{}
1281

1282
// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
1283
type SetupIntentConfirmPaymentMethodDataTWINTParams struct{}
1284

1285
// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1286
type SetupIntentConfirmPaymentMethodDataUSBankAccountParams struct {
1287
        // Account holder type: individual or company.
1288
        AccountHolderType *string `form:"account_holder_type"`
1289
        // Account number of the bank account.
1290
        AccountNumber *string `form:"account_number"`
1291
        // Account type: checkings or savings. Defaults to checking if omitted.
1292
        AccountType *string `form:"account_type"`
1293
        // The ID of a Financial Connections Account to use as a payment method.
1294
        FinancialConnectionsAccount *string `form:"financial_connections_account"`
1295
        // Routing number of the bank account.
1296
        RoutingNumber *string `form:"routing_number"`
1297
}
1298

1299
// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
1300
type SetupIntentConfirmPaymentMethodDataWeChatPayParams struct{}
1301

1302
// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
1303
type SetupIntentConfirmPaymentMethodDataZipParams struct{}
1304

1305
// 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)
1306
// value in the SetupIntent.
1307
type SetupIntentConfirmPaymentMethodDataParams struct {
1308
        // If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
1309
        ACSSDebit *SetupIntentConfirmPaymentMethodDataACSSDebitParams `form:"acss_debit"`
1310
        // If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
1311
        Affirm *SetupIntentConfirmPaymentMethodDataAffirmParams `form:"affirm"`
1312
        // If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
1313
        AfterpayClearpay *SetupIntentConfirmPaymentMethodDataAfterpayClearpayParams `form:"afterpay_clearpay"`
1314
        // If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
1315
        Alipay *SetupIntentConfirmPaymentMethodDataAlipayParams `form:"alipay"`
1316
        // This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`.
1317
        AllowRedisplay *string `form:"allow_redisplay"`
1318
        // If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
1319
        AmazonPay *SetupIntentConfirmPaymentMethodDataAmazonPayParams `form:"amazon_pay"`
1320
        // If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
1321
        AUBECSDebit *SetupIntentConfirmPaymentMethodDataAUBECSDebitParams `form:"au_becs_debit"`
1322
        // If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
1323
        BACSDebit *SetupIntentConfirmPaymentMethodDataBACSDebitParams `form:"bacs_debit"`
1324
        // If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
1325
        Bancontact *SetupIntentConfirmPaymentMethodDataBancontactParams `form:"bancontact"`
1326
        // Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
1327
        BillingDetails *SetupIntentConfirmPaymentMethodDataBillingDetailsParams `form:"billing_details"`
1328
        // If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
1329
        BLIK *SetupIntentConfirmPaymentMethodDataBLIKParams `form:"blik"`
1330
        // If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
1331
        Boleto *SetupIntentConfirmPaymentMethodDataBoletoParams `form:"boleto"`
1332
        // If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
1333
        CashApp *SetupIntentConfirmPaymentMethodDataCashAppParams `form:"cashapp"`
1334
        // If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
1335
        CustomerBalance *SetupIntentConfirmPaymentMethodDataCustomerBalanceParams `form:"customer_balance"`
1336
        // If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
1337
        EPS *SetupIntentConfirmPaymentMethodDataEPSParams `form:"eps"`
1338
        // If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
1339
        FPX *SetupIntentConfirmPaymentMethodDataFPXParams `form:"fpx"`
1340
        // If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
1341
        Giropay *SetupIntentConfirmPaymentMethodDataGiropayParams `form:"giropay"`
1342
        // If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
1343
        Grabpay *SetupIntentConfirmPaymentMethodDataGrabpayParams `form:"grabpay"`
1344
        // If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1345
        IDEAL *SetupIntentConfirmPaymentMethodDataIDEALParams `form:"ideal"`
1346
        // If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
1347
        InteracPresent *SetupIntentConfirmPaymentMethodDataInteracPresentParams `form:"interac_present"`
1348
        // If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
1349
        KakaoPay *SetupIntentConfirmPaymentMethodDataKakaoPayParams `form:"kakao_pay"`
1350
        // If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1351
        Klarna *SetupIntentConfirmPaymentMethodDataKlarnaParams `form:"klarna"`
1352
        // If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
1353
        Konbini *SetupIntentConfirmPaymentMethodDataKonbiniParams `form:"konbini"`
1354
        // If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
1355
        KrCard *SetupIntentConfirmPaymentMethodDataKrCardParams `form:"kr_card"`
1356
        // If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
1357
        Link *SetupIntentConfirmPaymentMethodDataLinkParams `form:"link"`
1358
        // If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
1359
        MbWay *SetupIntentConfirmPaymentMethodDataMbWayParams `form:"mb_way"`
1360
        // 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`.
1361
        Metadata map[string]string `form:"metadata"`
1362
        // If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
1363
        Mobilepay *SetupIntentConfirmPaymentMethodDataMobilepayParams `form:"mobilepay"`
1364
        // If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
1365
        Multibanco *SetupIntentConfirmPaymentMethodDataMultibancoParams `form:"multibanco"`
1366
        // If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1367
        NaverPay *SetupIntentConfirmPaymentMethodDataNaverPayParams `form:"naver_pay"`
1368
        // If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
1369
        OXXO *SetupIntentConfirmPaymentMethodDataOXXOParams `form:"oxxo"`
1370
        // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1371
        P24 *SetupIntentConfirmPaymentMethodDataP24Params `form:"p24"`
1372
        // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
1373
        Payco *SetupIntentConfirmPaymentMethodDataPaycoParams `form:"payco"`
1374
        // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
1375
        PayNow *SetupIntentConfirmPaymentMethodDataPayNowParams `form:"paynow"`
1376
        // If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
1377
        Paypal *SetupIntentConfirmPaymentMethodDataPaypalParams `form:"paypal"`
1378
        // If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
1379
        Payto *SetupIntentConfirmPaymentMethodDataPaytoParams `form:"payto"`
1380
        // If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
1381
        Pix *SetupIntentConfirmPaymentMethodDataPixParams `form:"pix"`
1382
        // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
1383
        PromptPay *SetupIntentConfirmPaymentMethodDataPromptPayParams `form:"promptpay"`
1384
        // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
1385
        RadarOptions *SetupIntentConfirmPaymentMethodDataRadarOptionsParams `form:"radar_options"`
1386
        // If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method.
1387
        Rechnung *SetupIntentConfirmPaymentMethodDataRechnungParams `form:"rechnung"`
1388
        // If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
1389
        RevolutPay *SetupIntentConfirmPaymentMethodDataRevolutPayParams `form:"revolut_pay"`
1390
        // If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
1391
        SamsungPay *SetupIntentConfirmPaymentMethodDataSamsungPayParams `form:"samsung_pay"`
1392
        // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1393
        SEPADebit *SetupIntentConfirmPaymentMethodDataSEPADebitParams `form:"sepa_debit"`
1394
        // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1395
        Sofort *SetupIntentConfirmPaymentMethodDataSofortParams `form:"sofort"`
1396
        // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
1397
        Swish *SetupIntentConfirmPaymentMethodDataSwishParams `form:"swish"`
1398
        // If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
1399
        TWINT *SetupIntentConfirmPaymentMethodDataTWINTParams `form:"twint"`
1400
        // 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.
1401
        Type *string `form:"type"`
1402
        // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1403
        USBankAccount *SetupIntentConfirmPaymentMethodDataUSBankAccountParams `form:"us_bank_account"`
1404
        // If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
1405
        WeChatPay *SetupIntentConfirmPaymentMethodDataWeChatPayParams `form:"wechat_pay"`
1406
        // If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
1407
        Zip *SetupIntentConfirmPaymentMethodDataZipParams `form:"zip"`
1408
}
1409

1410
// AddMetadata adds a new key-value pair to the Metadata.
UNCOV
1411
func (p *SetupIntentConfirmPaymentMethodDataParams) AddMetadata(key string, value string) {
×
UNCOV
1412
        if p.Metadata == nil {
×
UNCOV
1413
                p.Metadata = make(map[string]string)
×
UNCOV
1414
        }
×
1415

UNCOV
1416
        p.Metadata[key] = value
×
1417
}
1418

1419
// Confirm that your customer intends to set up the current or
1420
// provided payment method. For example, you would confirm a SetupIntent
1421
// when a customer hits the “Save” button on a payment method management
1422
// page on your website.
1423
//
1424
// If the selected payment method does not require any additional
1425
// steps from the customer, the SetupIntent will transition to the
1426
// succeeded status.
1427
//
1428
// Otherwise, it will transition to the requires_action status and
1429
// suggest additional actions via next_action. If setup fails,
1430
// the SetupIntent will transition to the
1431
// requires_payment_method status or the canceled status if the
1432
// confirmation limit is reached.
1433
type SetupIntentConfirmParams struct {
1434
        Params `form:"*"`
1435
        // ID of the ConfirmationToken used to confirm this SetupIntent.
1436
        //
1437
        // 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.
1438
        ConfirmationToken *string `form:"confirmation_token"`
1439
        // Specifies which fields in the response should be expanded.
1440
        Expand      []*string                     `form:"expand"`
1441
        MandateData *SetupIntentMandateDataParams `form:"mandate_data"`
1442
        // ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
1443
        PaymentMethod *string `form:"payment_method"`
1444
        // 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)
1445
        // value in the SetupIntent.
1446
        PaymentMethodData *SetupIntentConfirmPaymentMethodDataParams `form:"payment_method_data"`
1447
        // Payment method-specific configuration for this SetupIntent.
1448
        PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
1449
        // The URL to redirect your customer back to after they authenticate on the payment method's app or site.
1450
        // If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
1451
        // This parameter is only used for cards and other redirect-based payment methods.
1452
        ReturnURL *string `form:"return_url"`
1453
        // Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
1454
        UseStripeSDK *bool `form:"use_stripe_sdk"`
1455
}
1456

1457
// AddExpand appends a new field to expand.
UNCOV
1458
func (p *SetupIntentConfirmParams) AddExpand(f string) {
×
UNCOV
1459
        p.Expand = append(p.Expand, &f)
×
UNCOV
1460
}
×
1461

1462
// Verifies microdeposits on a SetupIntent object.
1463
type SetupIntentVerifyMicrodepositsParams struct {
1464
        Params `form:"*"`
1465
        // Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
1466
        Amounts []*int64 `form:"amounts"`
1467
        // A six-character code starting with SM present in the microdeposit sent to the bank account.
1468
        DescriptorCode *string `form:"descriptor_code"`
1469
        // Specifies which fields in the response should be expanded.
1470
        Expand []*string `form:"expand"`
1471
}
1472

1473
// AddExpand appends a new field to expand.
UNCOV
1474
func (p *SetupIntentVerifyMicrodepositsParams) AddExpand(f string) {
×
UNCOV
1475
        p.Expand = append(p.Expand, &f)
×
UNCOV
1476
}
×
1477

1478
// Settings for dynamic payment methods compatible with this Setup Intent
1479
type SetupIntentAutomaticPaymentMethods struct {
1480
        // Controls whether this SetupIntent will accept redirect-based payment methods.
1481
        //
1482
        // 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.
1483
        AllowRedirects SetupIntentAutomaticPaymentMethodsAllowRedirects `json:"allow_redirects"`
1484
        // Automatically calculates compatible payment methods
1485
        Enabled bool `json:"enabled"`
1486
}
1487
type SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCodeQRCode struct {
1488
        // The date (unix timestamp) when the QR code expires.
1489
        ExpiresAt int64 `json:"expires_at"`
1490
        // The image_url_png string used to render QR code
1491
        ImageURLPNG string `json:"image_url_png"`
1492
        // The image_url_svg string used to render QR code
1493
        ImageURLSVG string `json:"image_url_svg"`
1494
}
1495
type SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCode struct {
1496
        // 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.
1497
        HostedInstructionsURL string `json:"hosted_instructions_url"`
1498
        // The url for mobile redirect based auth
1499
        MobileAuthURL string                                                           `json:"mobile_auth_url"`
1500
        QRCode        *SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCodeQRCode `json:"qr_code"`
1501
}
1502
type SetupIntentNextActionRedirectToURL struct {
1503
        // If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
1504
        ReturnURL string `json:"return_url"`
1505
        // The URL you must redirect your customer to in order to authenticate.
1506
        URL string `json:"url"`
1507
}
1508

1509
// 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.
1510
type SetupIntentNextActionUseStripeSDK struct{}
1511
type SetupIntentNextActionVerifyWithMicrodeposits struct {
1512
        // The timestamp when the microdeposits are expected to land.
1513
        ArrivalDate int64 `json:"arrival_date"`
1514
        // The URL for the hosted verification page, which allows customers to verify their bank account.
1515
        HostedVerificationURL string `json:"hosted_verification_url"`
1516
        // The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
1517
        MicrodepositType SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType `json:"microdeposit_type"`
1518
}
1519

1520
// If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
1521
type SetupIntentNextAction struct {
1522
        CashAppHandleRedirectOrDisplayQRCode *SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCode `json:"cashapp_handle_redirect_or_display_qr_code"`
1523
        RedirectToURL                        *SetupIntentNextActionRedirectToURL                        `json:"redirect_to_url"`
1524
        // 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`.
1525
        Type SetupIntentNextActionType `json:"type"`
1526
        // 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.
1527
        UseStripeSDK            *SetupIntentNextActionUseStripeSDK            `json:"use_stripe_sdk"`
1528
        VerifyWithMicrodeposits *SetupIntentNextActionVerifyWithMicrodeposits `json:"verify_with_microdeposits"`
1529
}
1530

1531
// Information about the payment method configuration used for this Setup Intent.
1532
type SetupIntentPaymentMethodConfigurationDetails struct {
1533
        // ID of the payment method configuration used.
1534
        ID string `json:"id"`
1535
        // ID of the parent payment method configuration used.
1536
        Parent string `json:"parent"`
1537
}
1538
type SetupIntentPaymentMethodOptionsACSSDebitMandateOptions struct {
1539
        // A URL for custom mandate text
1540
        CustomMandateURL string `json:"custom_mandate_url"`
1541
        // List of Stripe products where this mandate can be selected automatically.
1542
        DefaultFor []SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsDefaultFor `json:"default_for"`
1543
        // Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.
1544
        IntervalDescription string `json:"interval_description"`
1545
        // Payment schedule for the mandate.
1546
        PaymentSchedule SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule `json:"payment_schedule"`
1547
        // Transaction type of the mandate.
1548
        TransactionType SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsTransactionType `json:"transaction_type"`
1549
}
1550
type SetupIntentPaymentMethodOptionsACSSDebit struct {
1551
        // Currency supported by the bank account
1552
        Currency       SetupIntentPaymentMethodOptionsACSSDebitCurrency        `json:"currency"`
1553
        MandateOptions *SetupIntentPaymentMethodOptionsACSSDebitMandateOptions `json:"mandate_options"`
1554
        // Bank account verification method.
1555
        VerificationMethod SetupIntentPaymentMethodOptionsACSSDebitVerificationMethod `json:"verification_method"`
1556
}
1557
type SetupIntentPaymentMethodOptionsAmazonPay struct{}
1558
type SetupIntentPaymentMethodOptionsBACSDebitMandateOptions struct{}
1559
type SetupIntentPaymentMethodOptionsBACSDebit struct {
1560
        MandateOptions *SetupIntentPaymentMethodOptionsBACSDebitMandateOptions `json:"mandate_options"`
1561
}
1562

1563
// Configuration options for setting up an eMandate for cards issued in India.
1564
type SetupIntentPaymentMethodOptionsCardMandateOptions struct {
1565
        // Amount to be charged for future payments.
1566
        Amount int64 `json:"amount"`
1567
        // 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.
1568
        AmountType SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType `json:"amount_type"`
1569
        // 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).
1570
        Currency Currency `json:"currency"`
1571
        // A description of the mandate or subscription that is meant to be displayed to the customer.
1572
        Description string `json:"description"`
1573
        // 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.
1574
        EndDate int64 `json:"end_date"`
1575
        // Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
1576
        Interval SetupIntentPaymentMethodOptionsCardMandateOptionsInterval `json:"interval"`
1577
        // 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`.
1578
        IntervalCount int64 `json:"interval_count"`
1579
        // Unique identifier for the mandate or subscription.
1580
        Reference string `json:"reference"`
1581
        // Start date of the mandate or subscription. Start date should not be lesser than yesterday.
1582
        StartDate int64 `json:"start_date"`
1583
        // Specifies the type of mandates supported. Possible values are `india`.
1584
        SupportedTypes []SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedType `json:"supported_types"`
1585
}
1586
type SetupIntentPaymentMethodOptionsCard struct {
1587
        // Configuration options for setting up an eMandate for cards issued in India.
1588
        MandateOptions *SetupIntentPaymentMethodOptionsCardMandateOptions `json:"mandate_options"`
1589
        // 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.
1590
        Network SetupIntentPaymentMethodOptionsCardNetwork `json:"network"`
1591
        // 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.
1592
        RequestThreeDSecure SetupIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"`
1593
}
1594
type SetupIntentPaymentMethodOptionsCardPresent struct{}
1595
type SetupIntentPaymentMethodOptionsLink struct {
1596
        // [Deprecated] This is a legacy parameter that no longer has any function.
1597
        // Deprecated:
1598
        PersistentToken string `json:"persistent_token"`
1599
}
1600
type SetupIntentPaymentMethodOptionsPaypal struct {
1601
        // The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
1602
        BillingAgreementID string `json:"billing_agreement_id"`
1603
        // 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).
1604
        Currency Currency `json:"currency"`
1605
        // The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used.
1606
        Subsellers []string `json:"subsellers"`
1607
}
1608
type SetupIntentPaymentMethodOptionsPaytoMandateOptions struct {
1609
        // Amount that will be collected. It is required when `amount_type` is `fixed`.
1610
        Amount int64 `json:"amount"`
1611
        // The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
1612
        AmountType SetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType `json:"amount_type"`
1613
        // Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date.
1614
        EndDate string `json:"end_date"`
1615
        // The periodicity at which payments will be collected.
1616
        PaymentSchedule SetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule `json:"payment_schedule"`
1617
        // The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit.
1618
        PaymentsPerPeriod int64 `json:"payments_per_period"`
1619
        // The purpose for which payments are made. Defaults to retail.
1620
        Purpose SetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose `json:"purpose"`
1621
        // Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time.
1622
        StartDate string `json:"start_date"`
1623
}
1624
type SetupIntentPaymentMethodOptionsPayto struct {
1625
        MandateOptions *SetupIntentPaymentMethodOptionsPaytoMandateOptions `json:"mandate_options"`
1626
}
1627
type SetupIntentPaymentMethodOptionsSEPADebitMandateOptions struct{}
1628
type SetupIntentPaymentMethodOptionsSEPADebit struct {
1629
        MandateOptions *SetupIntentPaymentMethodOptionsSEPADebitMandateOptions `json:"mandate_options"`
1630
}
1631
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFilters struct {
1632
        // The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
1633
        AccountSubcategories []SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFiltersAccountSubcategory `json:"account_subcategories"`
1634
        // The institution to use to filter for possible accounts to link.
1635
        Institution string `json:"institution"`
1636
}
1637
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntry struct {
1638
        // Settings for configuring manual entry of account details.
1639
        Mode SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode `json:"mode"`
1640
}
1641
type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnections struct {
1642
        Filters     *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsFilters     `json:"filters"`
1643
        ManualEntry *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntry `json:"manual_entry"`
1644
        // The list of permissions to request. The `payment_method` permission must be included.
1645
        Permissions []SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission `json:"permissions"`
1646
        // Data features requested to be retrieved upon account creation.
1647
        Prefetch []SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch `json:"prefetch"`
1648
        // 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.
1649
        ReturnURL string `json:"return_url"`
1650
}
1651
type SetupIntentPaymentMethodOptionsUSBankAccountMandateOptions struct {
1652
        // Mandate collection method
1653
        CollectionMethod SetupIntentPaymentMethodOptionsUSBankAccountMandateOptionsCollectionMethod `json:"collection_method"`
1654
}
1655
type SetupIntentPaymentMethodOptionsUSBankAccount struct {
1656
        FinancialConnections *SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnections `json:"financial_connections"`
1657
        MandateOptions       *SetupIntentPaymentMethodOptionsUSBankAccountMandateOptions       `json:"mandate_options"`
1658
        // Bank account verification method.
1659
        VerificationMethod SetupIntentPaymentMethodOptionsUSBankAccountVerificationMethod `json:"verification_method"`
1660
}
1661

1662
// Payment method-specific configuration for this SetupIntent.
1663
type SetupIntentPaymentMethodOptions struct {
1664
        ACSSDebit     *SetupIntentPaymentMethodOptionsACSSDebit     `json:"acss_debit"`
1665
        AmazonPay     *SetupIntentPaymentMethodOptionsAmazonPay     `json:"amazon_pay"`
1666
        BACSDebit     *SetupIntentPaymentMethodOptionsBACSDebit     `json:"bacs_debit"`
1667
        Card          *SetupIntentPaymentMethodOptionsCard          `json:"card"`
1668
        CardPresent   *SetupIntentPaymentMethodOptionsCardPresent   `json:"card_present"`
1669
        Link          *SetupIntentPaymentMethodOptionsLink          `json:"link"`
1670
        Paypal        *SetupIntentPaymentMethodOptionsPaypal        `json:"paypal"`
1671
        Payto         *SetupIntentPaymentMethodOptionsPayto         `json:"payto"`
1672
        SEPADebit     *SetupIntentPaymentMethodOptionsSEPADebit     `json:"sepa_debit"`
1673
        USBankAccount *SetupIntentPaymentMethodOptionsUSBankAccount `json:"us_bank_account"`
1674
}
1675

1676
// A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
1677
// For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
1678
// Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.
1679
//
1680
// Create a SetupIntent when you're ready to collect your customer's payment credentials.
1681
// Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
1682
// The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides
1683
// you through the setup process.
1684
//
1685
// Successful SetupIntents result in payment credentials that are optimized for future payments.
1686
// For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
1687
// [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection
1688
// to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).
1689
// If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
1690
// it automatically attaches the resulting payment method to that Customer after successful setup.
1691
// We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
1692
// PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.
1693
//
1694
// By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.
1695
//
1696
// Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
1697
type SetupIntent struct {
1698
        APIResource
1699
        // ID of the Connect application that created the SetupIntent.
1700
        Application *Application `json:"application"`
1701
        // If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
1702
        //
1703
        // 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.
1704
        AttachToSelf bool `json:"attach_to_self"`
1705
        // Settings for dynamic payment methods compatible with this Setup Intent
1706
        AutomaticPaymentMethods *SetupIntentAutomaticPaymentMethods `json:"automatic_payment_methods"`
1707
        // Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
1708
        CancellationReason SetupIntentCancellationReason `json:"cancellation_reason"`
1709
        // The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
1710
        //
1711
        // 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.
1712
        ClientSecret string `json:"client_secret"`
1713
        // Time at which the object was created. Measured in seconds since the Unix epoch.
1714
        Created int64 `json:"created"`
1715
        // ID of the Customer this SetupIntent belongs to, if one exists.
1716
        //
1717
        // 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.
1718
        Customer *Customer `json:"customer"`
1719
        // An arbitrary string attached to the object. Often useful for displaying to users.
1720
        Description string `json:"description"`
1721
        // Indicates the directions of money movement for which this payment method is intended to be used.
1722
        //
1723
        // 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.
1724
        FlowDirections []SetupIntentFlowDirection `json:"flow_directions"`
1725
        // Unique identifier for the object.
1726
        ID string `json:"id"`
1727
        // The error encountered in the previous SetupIntent confirmation.
1728
        LastSetupError *Error `json:"last_setup_error"`
1729
        // The most recent SetupAttempt for this SetupIntent.
1730
        LatestAttempt *SetupAttempt `json:"latest_attempt"`
1731
        // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
1732
        Livemode bool `json:"livemode"`
1733
        // ID of the multi use Mandate generated by the SetupIntent.
1734
        Mandate *Mandate `json:"mandate"`
1735
        // 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.
1736
        Metadata map[string]string `json:"metadata"`
1737
        // If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
1738
        NextAction *SetupIntentNextAction `json:"next_action"`
1739
        // String representing the object's type. Objects of the same type share the same value.
1740
        Object string `json:"object"`
1741
        // The account (if any) for which the setup is intended.
1742
        OnBehalfOf *Account `json:"on_behalf_of"`
1743
        // ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead.
1744
        PaymentMethod *PaymentMethod `json:"payment_method"`
1745
        // Information about the payment method configuration used for this Setup Intent.
1746
        PaymentMethodConfigurationDetails *SetupIntentPaymentMethodConfigurationDetails `json:"payment_method_configuration_details"`
1747
        // Payment method-specific configuration for this SetupIntent.
1748
        PaymentMethodOptions *SetupIntentPaymentMethodOptions `json:"payment_method_options"`
1749
        // The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
1750
        PaymentMethodTypes []string `json:"payment_method_types"`
1751
        // ID of the single_use Mandate generated by the SetupIntent.
1752
        SingleUseMandate *Mandate `json:"single_use_mandate"`
1753
        // [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`.
1754
        Status SetupIntentStatus `json:"status"`
1755
        // Indicates how the payment method is intended to be used in the future.
1756
        //
1757
        // 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`.
1758
        Usage SetupIntentUsage `json:"usage"`
1759
}
1760

1761
// SetupIntentList is a list of SetupIntents as retrieved from a list endpoint.
1762
type SetupIntentList struct {
1763
        APIResource
1764
        ListMeta
1765
        Data []*SetupIntent `json:"data"`
1766
}
1767

1768
// UnmarshalJSON handles deserialization of a SetupIntent.
1769
// This custom unmarshaling is needed because the resulting
1770
// property may be an id or the full struct if it was expanded.
UNCOV
1771
func (s *SetupIntent) UnmarshalJSON(data []byte) error {
×
UNCOV
1772
        if id, ok := ParseID(data); ok {
×
UNCOV
1773
                s.ID = id
×
UNCOV
1774
                return nil
×
UNCOV
1775
        }
×
1776

UNCOV
1777
        type setupIntent SetupIntent
×
UNCOV
1778
        var v setupIntent
×
UNCOV
1779
        if err := json.Unmarshal(data, &v); err != nil {
×
UNCOV
1780
                return err
×
UNCOV
1781
        }
×
1782

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

© 2025 Coveralls, Inc