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

stripe / stripe-go / 11296113556

11 Oct 2024 04:42PM UTC coverage: 62.991% (-0.02%) from 63.015%
11296113556

Pull #1934

github

stripe-openapi[bot]
Update generated code for v1291
Pull Request #1934: Update generated code for beta

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

469 existing lines in 20 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
/paymentlink.go
1
//
2
//
3
// File generated from our OpenAPI spec
4
//
5
//
6

7
package stripe
8

9
import "encoding/json"
10

11
// The specified behavior after the purchase is complete.
12
type PaymentLinkAfterCompletionType string
13

14
// List of values that PaymentLinkAfterCompletionType can take
15
const (
16
        PaymentLinkAfterCompletionTypeHostedConfirmation PaymentLinkAfterCompletionType = "hosted_confirmation"
17
        PaymentLinkAfterCompletionTypeRedirect           PaymentLinkAfterCompletionType = "redirect"
18
)
19

20
// Type of the account referenced.
21
type PaymentLinkAutomaticTaxLiabilityType string
22

23
// List of values that PaymentLinkAutomaticTaxLiabilityType can take
24
const (
25
        PaymentLinkAutomaticTaxLiabilityTypeAccount PaymentLinkAutomaticTaxLiabilityType = "account"
26
        PaymentLinkAutomaticTaxLiabilityTypeSelf    PaymentLinkAutomaticTaxLiabilityType = "self"
27
)
28

29
// Configuration for collecting the customer's billing address. Defaults to `auto`.
30
type PaymentLinkBillingAddressCollection string
31

32
// List of values that PaymentLinkBillingAddressCollection can take
33
const (
34
        PaymentLinkBillingAddressCollectionAuto     PaymentLinkBillingAddressCollection = "auto"
35
        PaymentLinkBillingAddressCollectionRequired PaymentLinkBillingAddressCollection = "required"
36
)
37

38
// Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used.
39
//
40
// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
41
type PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition string
42

43
// List of values that PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition can take
44
const (
45
        PaymentLinkConsentCollectionPaymentMethodReuseAgreementPositionAuto   PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition = "auto"
46
        PaymentLinkConsentCollectionPaymentMethodReuseAgreementPositionHidden PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition = "hidden"
47
)
48

49
// If set to `auto`, enables the collection of customer consent for promotional communications.
50
type PaymentLinkConsentCollectionPromotions string
51

52
// List of values that PaymentLinkConsentCollectionPromotions can take
53
const (
54
        PaymentLinkConsentCollectionPromotionsAuto PaymentLinkConsentCollectionPromotions = "auto"
55
        PaymentLinkConsentCollectionPromotionsNone PaymentLinkConsentCollectionPromotions = "none"
56
)
57

58
// If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service.
59
type PaymentLinkConsentCollectionTermsOfService string
60

61
// List of values that PaymentLinkConsentCollectionTermsOfService can take
62
const (
63
        PaymentLinkConsentCollectionTermsOfServiceNone     PaymentLinkConsentCollectionTermsOfService = "none"
64
        PaymentLinkConsentCollectionTermsOfServiceRequired PaymentLinkConsentCollectionTermsOfService = "required"
65
)
66

67
// The type of the label.
68
type PaymentLinkCustomFieldLabelType string
69

70
// List of values that PaymentLinkCustomFieldLabelType can take
71
const (
72
        PaymentLinkCustomFieldLabelTypeCustom PaymentLinkCustomFieldLabelType = "custom"
73
)
74

75
// The type of the field.
76
type PaymentLinkCustomFieldType string
77

78
// List of values that PaymentLinkCustomFieldType can take
79
const (
80
        PaymentLinkCustomFieldTypeDropdown PaymentLinkCustomFieldType = "dropdown"
81
        PaymentLinkCustomFieldTypeNumeric  PaymentLinkCustomFieldType = "numeric"
82
        PaymentLinkCustomFieldTypeText     PaymentLinkCustomFieldType = "text"
83
)
84

85
// Configuration for Customer creation during checkout.
86
type PaymentLinkCustomerCreation string
87

88
// List of values that PaymentLinkCustomerCreation can take
89
const (
90
        PaymentLinkCustomerCreationAlways     PaymentLinkCustomerCreation = "always"
91
        PaymentLinkCustomerCreationIfRequired PaymentLinkCustomerCreation = "if_required"
92
)
93

94
// Type of the account referenced.
95
type PaymentLinkInvoiceCreationInvoiceDataIssuerType string
96

97
// List of values that PaymentLinkInvoiceCreationInvoiceDataIssuerType can take
98
const (
99
        PaymentLinkInvoiceCreationInvoiceDataIssuerTypeAccount PaymentLinkInvoiceCreationInvoiceDataIssuerType = "account"
100
        PaymentLinkInvoiceCreationInvoiceDataIssuerTypeSelf    PaymentLinkInvoiceCreationInvoiceDataIssuerType = "self"
101
)
102

103
// Indicates when the funds will be captured from the customer's account.
104
type PaymentLinkPaymentIntentDataCaptureMethod string
105

106
// List of values that PaymentLinkPaymentIntentDataCaptureMethod can take
107
const (
108
        PaymentLinkPaymentIntentDataCaptureMethodAutomatic      PaymentLinkPaymentIntentDataCaptureMethod = "automatic"
109
        PaymentLinkPaymentIntentDataCaptureMethodAutomaticAsync PaymentLinkPaymentIntentDataCaptureMethod = "automatic_async"
110
        PaymentLinkPaymentIntentDataCaptureMethodManual         PaymentLinkPaymentIntentDataCaptureMethod = "manual"
111
)
112

113
// Indicates that you intend to make future payments with the payment method collected during checkout.
114
type PaymentLinkPaymentIntentDataSetupFutureUsage string
115

116
// List of values that PaymentLinkPaymentIntentDataSetupFutureUsage can take
117
const (
118
        PaymentLinkPaymentIntentDataSetupFutureUsageOffSession PaymentLinkPaymentIntentDataSetupFutureUsage = "off_session"
119
        PaymentLinkPaymentIntentDataSetupFutureUsageOnSession  PaymentLinkPaymentIntentDataSetupFutureUsage = "on_session"
120
)
121

122
// Configuration for collecting a payment method during checkout. Defaults to `always`.
123
type PaymentLinkPaymentMethodCollection string
124

125
// List of values that PaymentLinkPaymentMethodCollection can take
126
const (
127
        PaymentLinkPaymentMethodCollectionAlways     PaymentLinkPaymentMethodCollection = "always"
128
        PaymentLinkPaymentMethodCollectionIfRequired PaymentLinkPaymentMethodCollection = "if_required"
129
)
130

131
// The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
132
type PaymentLinkPaymentMethodType string
133

134
// List of values that PaymentLinkPaymentMethodType can take
135
const (
136
        PaymentLinkPaymentMethodTypeAffirm           PaymentLinkPaymentMethodType = "affirm"
137
        PaymentLinkPaymentMethodTypeAfterpayClearpay PaymentLinkPaymentMethodType = "afterpay_clearpay"
138
        PaymentLinkPaymentMethodTypeAlipay           PaymentLinkPaymentMethodType = "alipay"
139
        PaymentLinkPaymentMethodTypeAUBECSDebit      PaymentLinkPaymentMethodType = "au_becs_debit"
140
        PaymentLinkPaymentMethodTypeBACSDebit        PaymentLinkPaymentMethodType = "bacs_debit"
141
        PaymentLinkPaymentMethodTypeBancontact       PaymentLinkPaymentMethodType = "bancontact"
142
        PaymentLinkPaymentMethodTypeBLIK             PaymentLinkPaymentMethodType = "blik"
143
        PaymentLinkPaymentMethodTypeBoleto           PaymentLinkPaymentMethodType = "boleto"
144
        PaymentLinkPaymentMethodTypeCard             PaymentLinkPaymentMethodType = "card"
145
        PaymentLinkPaymentMethodTypeCashApp          PaymentLinkPaymentMethodType = "cashapp"
146
        PaymentLinkPaymentMethodTypeEPS              PaymentLinkPaymentMethodType = "eps"
147
        PaymentLinkPaymentMethodTypeFPX              PaymentLinkPaymentMethodType = "fpx"
148
        PaymentLinkPaymentMethodTypeGiropay          PaymentLinkPaymentMethodType = "giropay"
149
        PaymentLinkPaymentMethodTypeGrabpay          PaymentLinkPaymentMethodType = "grabpay"
150
        PaymentLinkPaymentMethodTypeIDEAL            PaymentLinkPaymentMethodType = "ideal"
151
        PaymentLinkPaymentMethodTypeKlarna           PaymentLinkPaymentMethodType = "klarna"
152
        PaymentLinkPaymentMethodTypeKonbini          PaymentLinkPaymentMethodType = "konbini"
153
        PaymentLinkPaymentMethodTypeLink             PaymentLinkPaymentMethodType = "link"
154
        PaymentLinkPaymentMethodTypeMbWay            PaymentLinkPaymentMethodType = "mb_way"
155
        PaymentLinkPaymentMethodTypeMobilepay        PaymentLinkPaymentMethodType = "mobilepay"
156
        PaymentLinkPaymentMethodTypeMultibanco       PaymentLinkPaymentMethodType = "multibanco"
157
        PaymentLinkPaymentMethodTypeOXXO             PaymentLinkPaymentMethodType = "oxxo"
158
        PaymentLinkPaymentMethodTypeP24              PaymentLinkPaymentMethodType = "p24"
159
        PaymentLinkPaymentMethodTypePayNow           PaymentLinkPaymentMethodType = "paynow"
160
        PaymentLinkPaymentMethodTypePaypal           PaymentLinkPaymentMethodType = "paypal"
161
        PaymentLinkPaymentMethodTypePayto            PaymentLinkPaymentMethodType = "payto"
162
        PaymentLinkPaymentMethodTypePix              PaymentLinkPaymentMethodType = "pix"
163
        PaymentLinkPaymentMethodTypePromptPay        PaymentLinkPaymentMethodType = "promptpay"
164
        PaymentLinkPaymentMethodTypeRechnung         PaymentLinkPaymentMethodType = "rechnung"
165
        PaymentLinkPaymentMethodTypeSEPADebit        PaymentLinkPaymentMethodType = "sepa_debit"
166
        PaymentLinkPaymentMethodTypeSofort           PaymentLinkPaymentMethodType = "sofort"
167
        PaymentLinkPaymentMethodTypeSwish            PaymentLinkPaymentMethodType = "swish"
168
        PaymentLinkPaymentMethodTypeTWINT            PaymentLinkPaymentMethodType = "twint"
169
        PaymentLinkPaymentMethodTypeUSBankAccount    PaymentLinkPaymentMethodType = "us_bank_account"
170
        PaymentLinkPaymentMethodTypeWeChatPay        PaymentLinkPaymentMethodType = "wechat_pay"
171
        PaymentLinkPaymentMethodTypeZip              PaymentLinkPaymentMethodType = "zip"
172
)
173

174
// Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.
175
type PaymentLinkSubmitType string
176

177
// List of values that PaymentLinkSubmitType can take
178
const (
179
        PaymentLinkSubmitTypeAuto   PaymentLinkSubmitType = "auto"
180
        PaymentLinkSubmitTypeBook   PaymentLinkSubmitType = "book"
181
        PaymentLinkSubmitTypeDonate PaymentLinkSubmitType = "donate"
182
        PaymentLinkSubmitTypePay    PaymentLinkSubmitType = "pay"
183
)
184

185
// Type of the account referenced.
186
type PaymentLinkSubscriptionDataInvoiceSettingsIssuerType string
187

188
// List of values that PaymentLinkSubscriptionDataInvoiceSettingsIssuerType can take
189
const (
190
        PaymentLinkSubscriptionDataInvoiceSettingsIssuerTypeAccount PaymentLinkSubscriptionDataInvoiceSettingsIssuerType = "account"
191
        PaymentLinkSubscriptionDataInvoiceSettingsIssuerTypeSelf    PaymentLinkSubscriptionDataInvoiceSettingsIssuerType = "self"
192
)
193

194
// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
195
type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod string
196

197
// List of values that PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod can take
198
const (
199
        PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCancel        PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "cancel"
200
        PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCreateInvoice PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "create_invoice"
201
        PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodPause         PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "pause"
202
)
203

204
type PaymentLinkTaxIDCollectionRequired string
205

206
// List of values that PaymentLinkTaxIDCollectionRequired can take
207
const (
208
        PaymentLinkTaxIDCollectionRequiredIfSupported PaymentLinkTaxIDCollectionRequired = "if_supported"
209
        PaymentLinkTaxIDCollectionRequiredNever       PaymentLinkTaxIDCollectionRequired = "never"
210
)
211

212
// Returns a list of your payment links.
213
type PaymentLinkListParams struct {
214
        ListParams `form:"*"`
215
        // Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links).
216
        Active *bool `form:"active"`
217
        // Specifies which fields in the response should be expanded.
218
        Expand []*string `form:"expand"`
219
}
220

221
// AddExpand appends a new field to expand.
UNCOV
222
func (p *PaymentLinkListParams) AddExpand(f string) {
×
UNCOV
223
        p.Expand = append(p.Expand, &f)
×
UNCOV
224
}
×
225

226
// Configuration when `type=hosted_confirmation`.
227
type PaymentLinkAfterCompletionHostedConfirmationParams struct {
228
        // A custom message to display to the customer after the purchase is complete.
229
        CustomMessage *string `form:"custom_message"`
230
}
231

232
// Configuration when `type=redirect`.
233
type PaymentLinkAfterCompletionRedirectParams struct {
234
        // The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included.
235
        URL *string `form:"url"`
236
}
237

238
// Behavior after the purchase is complete.
239
type PaymentLinkAfterCompletionParams struct {
240
        // Configuration when `type=hosted_confirmation`.
241
        HostedConfirmation *PaymentLinkAfterCompletionHostedConfirmationParams `form:"hosted_confirmation"`
242
        // Configuration when `type=redirect`.
243
        Redirect *PaymentLinkAfterCompletionRedirectParams `form:"redirect"`
244
        // The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`.
245
        Type *string `form:"type"`
246
}
247

248
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
249
type PaymentLinkAutomaticTaxLiabilityParams struct {
250
        // The connected account being referenced when `type` is `account`.
251
        Account *string `form:"account"`
252
        // Type of the account referenced in the request.
253
        Type *string `form:"type"`
254
}
255

256
// Configuration for automatic tax collection.
257
type PaymentLinkAutomaticTaxParams struct {
258
        // If `true`, tax will be calculated automatically using the customer's location.
259
        Enabled *bool `form:"enabled"`
260
        // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
261
        Liability *PaymentLinkAutomaticTaxLiabilityParams `form:"liability"`
262
}
263

264
// Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method.
265
type PaymentLinkConsentCollectionPaymentMethodReuseAgreementParams struct {
266
        // Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
267
        // defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
268
        Position *string `form:"position"`
269
}
270

271
// Configure fields to gather active consent from customers.
272
type PaymentLinkConsentCollectionParams struct {
273
        // Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method.
274
        PaymentMethodReuseAgreement *PaymentLinkConsentCollectionPaymentMethodReuseAgreementParams `form:"payment_method_reuse_agreement"`
275
        // If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
276
        // Session will determine whether to display an option to opt into promotional communication
277
        // from the merchant depending on the customer's locale. Only available to US merchants.
278
        Promotions *string `form:"promotions"`
279
        // If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.
280
        // There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).
281
        TermsOfService *string `form:"terms_of_service"`
282
}
283

284
// The options available for the customer to select. Up to 200 options allowed.
285
type PaymentLinkCustomFieldDropdownOptionParams struct {
286
        // The label for the option, displayed to the customer. Up to 100 characters.
287
        Label *string `form:"label"`
288
        // The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters.
289
        Value *string `form:"value"`
290
}
291

292
// Configuration for `type=dropdown` fields.
293
type PaymentLinkCustomFieldDropdownParams struct {
294
        // The options available for the customer to select. Up to 200 options allowed.
295
        Options []*PaymentLinkCustomFieldDropdownOptionParams `form:"options"`
296
}
297

298
// The label for the field, displayed to the customer.
299
type PaymentLinkCustomFieldLabelParams struct {
300
        // Custom text for the label, displayed to the customer. Up to 50 characters.
301
        Custom *string `form:"custom"`
302
        // The type of the label.
303
        Type *string `form:"type"`
304
}
305

306
// Configuration for `type=numeric` fields.
307
type PaymentLinkCustomFieldNumericParams struct {
308
        // The maximum character length constraint for the customer's input.
309
        MaximumLength *int64 `form:"maximum_length"`
310
        // The minimum character length requirement for the customer's input.
311
        MinimumLength *int64 `form:"minimum_length"`
312
}
313

314
// Configuration for `type=text` fields.
315
type PaymentLinkCustomFieldTextParams struct {
316
        // The maximum character length constraint for the customer's input.
317
        MaximumLength *int64 `form:"maximum_length"`
318
        // The minimum character length requirement for the customer's input.
319
        MinimumLength *int64 `form:"minimum_length"`
320
}
321

322
// Collect additional information from your customer using custom fields. Up to 3 fields are supported.
323
type PaymentLinkCustomFieldParams struct {
324
        // Configuration for `type=dropdown` fields.
325
        Dropdown *PaymentLinkCustomFieldDropdownParams `form:"dropdown"`
326
        // String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters.
327
        Key *string `form:"key"`
328
        // The label for the field, displayed to the customer.
329
        Label *PaymentLinkCustomFieldLabelParams `form:"label"`
330
        // Configuration for `type=numeric` fields.
331
        Numeric *PaymentLinkCustomFieldNumericParams `form:"numeric"`
332
        // Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`.
333
        Optional *bool `form:"optional"`
334
        // Configuration for `type=text` fields.
335
        Text *PaymentLinkCustomFieldTextParams `form:"text"`
336
        // The type of the field.
337
        Type *string `form:"type"`
338
}
339

340
// Custom text that should be displayed after the payment confirmation button.
341
type PaymentLinkCustomTextAfterSubmitParams struct {
342
        // Text may be up to 1200 characters in length.
343
        Message *string `form:"message"`
344
}
345

346
// Custom text that should be displayed alongside shipping address collection.
347
type PaymentLinkCustomTextShippingAddressParams struct {
348
        // Text may be up to 1200 characters in length.
349
        Message *string `form:"message"`
350
}
351

352
// Custom text that should be displayed alongside the payment confirmation button.
353
type PaymentLinkCustomTextSubmitParams struct {
354
        // Text may be up to 1200 characters in length.
355
        Message *string `form:"message"`
356
}
357

358
// Custom text that should be displayed in place of the default terms of service agreement text.
359
type PaymentLinkCustomTextTermsOfServiceAcceptanceParams struct {
360
        // Text may be up to 1200 characters in length.
361
        Message *string `form:"message"`
362
}
363

364
// Display additional text for your customers using custom text.
365
type PaymentLinkCustomTextParams struct {
366
        // Custom text that should be displayed after the payment confirmation button.
367
        AfterSubmit *PaymentLinkCustomTextAfterSubmitParams `form:"after_submit"`
368
        // Custom text that should be displayed alongside shipping address collection.
369
        ShippingAddress *PaymentLinkCustomTextShippingAddressParams `form:"shipping_address"`
370
        // Custom text that should be displayed alongside the payment confirmation button.
371
        Submit *PaymentLinkCustomTextSubmitParams `form:"submit"`
372
        // Custom text that should be displayed in place of the default terms of service agreement text.
373
        TermsOfServiceAcceptance *PaymentLinkCustomTextTermsOfServiceAcceptanceParams `form:"terms_of_service_acceptance"`
374
}
375

376
// Default custom fields to be displayed on invoices for this customer.
377
type PaymentLinkInvoiceCreationInvoiceDataCustomFieldParams struct {
378
        // The name of the custom field. This may be up to 40 characters.
379
        Name *string `form:"name"`
380
        // The value of the custom field. This may be up to 140 characters.
381
        Value *string `form:"value"`
382
}
383

384
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
385
type PaymentLinkInvoiceCreationInvoiceDataIssuerParams struct {
386
        // The connected account being referenced when `type` is `account`.
387
        Account *string `form:"account"`
388
        // Type of the account referenced in the request.
389
        Type *string `form:"type"`
390
}
391

392
// Default options for invoice PDF rendering for this customer.
393
type PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsParams struct {
394
        // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
395
        AmountTaxDisplay *string `form:"amount_tax_display"`
396
}
397

398
// Invoice PDF configuration.
399
type PaymentLinkInvoiceCreationInvoiceDataParams struct {
400
        // The account tax IDs associated with the invoice.
401
        AccountTaxIDs []*string `form:"account_tax_ids"`
402
        // Default custom fields to be displayed on invoices for this customer.
403
        CustomFields []*PaymentLinkInvoiceCreationInvoiceDataCustomFieldParams `form:"custom_fields"`
404
        // An arbitrary string attached to the object. Often useful for displaying to users.
405
        Description *string `form:"description"`
406
        // Default footer to be displayed on invoices for this customer.
407
        Footer *string `form:"footer"`
408
        // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
409
        Issuer *PaymentLinkInvoiceCreationInvoiceDataIssuerParams `form:"issuer"`
410
        // 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`.
411
        Metadata map[string]string `form:"metadata"`
412
        // Default options for invoice PDF rendering for this customer.
413
        RenderingOptions *PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsParams `form:"rendering_options"`
414
}
415

416
// AddMetadata adds a new key-value pair to the Metadata.
UNCOV
417
func (p *PaymentLinkInvoiceCreationInvoiceDataParams) AddMetadata(key string, value string) {
×
UNCOV
418
        if p.Metadata == nil {
×
UNCOV
419
                p.Metadata = make(map[string]string)
×
UNCOV
420
        }
×
421

422
        p.Metadata[key] = value
×
423
}
424

425
// Generate a post-purchase Invoice for one-time payments.
426
type PaymentLinkInvoiceCreationParams struct {
427
        // Whether the feature is enabled
428
        Enabled *bool `form:"enabled"`
429
        // Invoice PDF configuration.
430
        InvoiceData *PaymentLinkInvoiceCreationInvoiceDataParams `form:"invoice_data"`
431
}
432

433
// When set, provides configuration for this item's quantity to be adjusted by the customer during checkout.
434
type PaymentLinkLineItemAdjustableQuantityParams struct {
435
        // Set to true if the quantity can be adjusted to any non-negative Integer.
436
        Enabled *bool `form:"enabled"`
437
        // The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.
438
        Maximum *int64 `form:"maximum"`
439
        // The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.
440
        Minimum *int64 `form:"minimum"`
441
}
442

443
// The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
444
type PaymentLinkLineItemParams struct {
445
        // When set, provides configuration for this item's quantity to be adjusted by the customer during checkout.
446
        AdjustableQuantity *PaymentLinkLineItemAdjustableQuantityParams `form:"adjustable_quantity"`
447
        // The ID of an existing line item on the payment link.
448
        ID *string `form:"id"`
449
        // The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object.
450
        Price *string `form:"price"`
451
        // The quantity of the line item being purchased.
452
        Quantity *int64 `form:"quantity"`
453
}
454

455
// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
456
type PaymentLinkPaymentIntentDataParams struct {
457
        // Controls when the funds will be captured from the customer's account.
458
        CaptureMethod *string `form:"capture_method"`
459
        // An arbitrary string attached to the object. Often useful for displaying to users.
460
        Description *string `form:"description"`
461
        // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
462
        Metadata map[string]string `form:"metadata"`
463
        // Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session.
464
        //
465
        // When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved.
466
        //
467
        // When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments.
468
        //
469
        // If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer.
470
        //
471
        // If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent.
472
        //
473
        // When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.
474
        SetupFutureUsage *string `form:"setup_future_usage"`
475
        // Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
476
        //
477
        // Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
478
        StatementDescriptor *string `form:"statement_descriptor"`
479
        // Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement.
480
        StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"`
481
        // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
482
        TransferGroup *string `form:"transfer_group"`
483
}
484

485
// AddMetadata adds a new key-value pair to the Metadata.
UNCOV
486
func (p *PaymentLinkPaymentIntentDataParams) AddMetadata(key string, value string) {
×
UNCOV
487
        if p.Metadata == nil {
×
UNCOV
488
                p.Metadata = make(map[string]string)
×
UNCOV
489
        }
×
490

491
        p.Metadata[key] = value
×
492
}
493

494
// Controls phone number collection settings during checkout.
495
//
496
// We recommend that you review your privacy policy and check with your legal contacts.
497
type PaymentLinkPhoneNumberCollectionParams struct {
498
        // Set to `true` to enable phone number collection.
499
        Enabled *bool `form:"enabled"`
500
}
501

502
// Configuration for the `completed_sessions` restriction type.
503
type PaymentLinkRestrictionsCompletedSessionsParams struct {
504
        // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met.
505
        Limit *int64 `form:"limit"`
506
}
507

508
// Settings that restrict the usage of a payment link.
509
type PaymentLinkRestrictionsParams struct {
510
        // Configuration for the `completed_sessions` restriction type.
511
        CompletedSessions *PaymentLinkRestrictionsCompletedSessionsParams `form:"completed_sessions"`
512
}
513

514
// Configuration for collecting the customer's shipping address.
515
type PaymentLinkShippingAddressCollectionParams struct {
516
        // An array of two-letter ISO country codes representing which countries Checkout should provide as options for
517
        // shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.
518
        AllowedCountries []*string `form:"allowed_countries"`
519
}
520

521
// The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.
522
type PaymentLinkShippingOptionParams struct {
523
        // The ID of the Shipping Rate to use for this shipping option.
524
        ShippingRate *string `form:"shipping_rate"`
525
}
526

527
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
528
type PaymentLinkSubscriptionDataInvoiceSettingsIssuerParams struct {
529
        // The connected account being referenced when `type` is `account`.
530
        Account *string `form:"account"`
531
        // Type of the account referenced in the request.
532
        Type *string `form:"type"`
533
}
534

535
// All invoices will be billed using the specified settings.
536
type PaymentLinkSubscriptionDataInvoiceSettingsParams struct {
537
        // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
538
        Issuer *PaymentLinkSubscriptionDataInvoiceSettingsIssuerParams `form:"issuer"`
539
}
540

541
// Defines how the subscription should behave when the user's free trial ends.
542
type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams struct {
543
        // Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
544
        MissingPaymentMethod *string `form:"missing_payment_method"`
545
}
546

547
// Settings related to subscription trials.
548
type PaymentLinkSubscriptionDataTrialSettingsParams struct {
549
        // Defines how the subscription should behave when the user's free trial ends.
550
        EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams `form:"end_behavior"`
551
}
552

553
// When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
554
type PaymentLinkSubscriptionDataParams struct {
555
        // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
556
        Description *string `form:"description"`
557
        // All invoices will be billed using the specified settings.
558
        InvoiceSettings *PaymentLinkSubscriptionDataInvoiceSettingsParams `form:"invoice_settings"`
559
        // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
560
        Metadata map[string]string `form:"metadata"`
561
        // Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.
562
        TrialPeriodDays *int64 `form:"trial_period_days"`
563
        // Settings related to subscription trials.
564
        TrialSettings *PaymentLinkSubscriptionDataTrialSettingsParams `form:"trial_settings"`
565
}
566

567
// AddMetadata adds a new key-value pair to the Metadata.
UNCOV
568
func (p *PaymentLinkSubscriptionDataParams) AddMetadata(key string, value string) {
×
UNCOV
569
        if p.Metadata == nil {
×
UNCOV
570
                p.Metadata = make(map[string]string)
×
UNCOV
571
        }
×
572

573
        p.Metadata[key] = value
×
574
}
575

576
// Controls tax ID collection during checkout.
577
type PaymentLinkTaxIDCollectionParams struct {
578
        // Enable tax ID collection during checkout. Defaults to `false`.
579
        Enabled *bool `form:"enabled"`
580
        // Describes whether a tax ID is required during checkout. Defaults to `never`.
581
        Required *string `form:"required"`
582
}
583

584
// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
585
type PaymentLinkTransferDataParams struct {
586
        // The amount that will be transferred automatically when a charge succeeds.
587
        Amount *int64 `form:"amount"`
588
        // If specified, successful charges will be attributed to the destination
589
        // account for tax reporting, and the funds from charges will be transferred
590
        // to the destination account. The ID of the resulting transfer will be
591
        // returned on the successful charge's `transfer` field.
592
        Destination *string `form:"destination"`
593
}
594

595
// Creates a payment link.
596
type PaymentLinkParams struct {
597
        Params `form:"*"`
598
        // Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated.
599
        Active *bool `form:"active"`
600
        // Behavior after the purchase is complete.
601
        AfterCompletion *PaymentLinkAfterCompletionParams `form:"after_completion"`
602
        // Enables user redeemable promotion codes.
603
        AllowPromotionCodes *bool `form:"allow_promotion_codes"`
604
        // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices.
605
        ApplicationFeeAmount *int64 `form:"application_fee_amount"`
606
        // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field.
607
        ApplicationFeePercent *float64 `form:"application_fee_percent"`
608
        // Configuration for automatic tax collection.
609
        AutomaticTax *PaymentLinkAutomaticTaxParams `form:"automatic_tax"`
610
        // Configuration for collecting the customer's billing address. Defaults to `auto`.
611
        BillingAddressCollection *string `form:"billing_address_collection"`
612
        // Configure fields to gather active consent from customers.
613
        ConsentCollection *PaymentLinkConsentCollectionParams `form:"consent_collection"`
614
        // 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) and supported by each line item's price.
615
        Currency *string `form:"currency"`
616
        // Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers).
617
        CustomerCreation *string `form:"customer_creation"`
618
        // Collect additional information from your customer using custom fields. Up to 3 fields are supported.
619
        CustomFields []*PaymentLinkCustomFieldParams `form:"custom_fields"`
620
        // Display additional text for your customers using custom text.
621
        CustomText *PaymentLinkCustomTextParams `form:"custom_text"`
622
        // Specifies which fields in the response should be expanded.
623
        Expand []*string `form:"expand"`
624
        // The custom message to be displayed to a customer when a payment link is no longer active.
625
        InactiveMessage *string `form:"inactive_message"`
626
        // Generate a post-purchase Invoice for one-time payments.
627
        InvoiceCreation *PaymentLinkInvoiceCreationParams `form:"invoice_creation"`
628
        // The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
629
        LineItems []*PaymentLinkLineItemParams `form:"line_items"`
630
        // 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`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.
631
        Metadata map[string]string `form:"metadata"`
632
        // The account on behalf of which to charge.
633
        OnBehalfOf *string `form:"on_behalf_of"`
634
        // A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
635
        PaymentIntentData *PaymentLinkPaymentIntentDataParams `form:"payment_intent_data"`
636
        // Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.
637
        //
638
        // Can only be set in `subscription` mode. Defaults to `always`.
639
        //
640
        // If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials).
641
        PaymentMethodCollection *string `form:"payment_method_collection"`
642
        // The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)).
643
        PaymentMethodTypes []*string `form:"payment_method_types"`
644
        // Controls phone number collection settings during checkout.
645
        //
646
        // We recommend that you review your privacy policy and check with your legal contacts.
647
        PhoneNumberCollection *PaymentLinkPhoneNumberCollectionParams `form:"phone_number_collection"`
648
        // Settings that restrict the usage of a payment link.
649
        Restrictions *PaymentLinkRestrictionsParams `form:"restrictions"`
650
        // Configuration for collecting the customer's shipping address.
651
        ShippingAddressCollection *PaymentLinkShippingAddressCollectionParams `form:"shipping_address_collection"`
652
        // The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.
653
        ShippingOptions []*PaymentLinkShippingOptionParams `form:"shipping_options"`
654
        // Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`).
655
        SubmitType *string `form:"submit_type"`
656
        // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
657
        SubscriptionData *PaymentLinkSubscriptionDataParams `form:"subscription_data"`
658
        // Controls tax ID collection during checkout.
659
        TaxIDCollection *PaymentLinkTaxIDCollectionParams `form:"tax_id_collection"`
660
        // The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
661
        TransferData *PaymentLinkTransferDataParams `form:"transfer_data"`
662
}
663

664
// AddExpand appends a new field to expand.
UNCOV
665
func (p *PaymentLinkParams) AddExpand(f string) {
×
UNCOV
666
        p.Expand = append(p.Expand, &f)
×
UNCOV
667
}
×
668

669
// AddMetadata adds a new key-value pair to the Metadata.
670
func (p *PaymentLinkParams) AddMetadata(key string, value string) {
×
671
        if p.Metadata == nil {
×
UNCOV
672
                p.Metadata = make(map[string]string)
×
UNCOV
673
        }
×
674

675
        p.Metadata[key] = value
×
676
}
677

678
// When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
679
type PaymentLinkListLineItemsParams struct {
680
        ListParams  `form:"*"`
681
        PaymentLink *string `form:"-"` // Included in URL
682
        // Specifies which fields in the response should be expanded.
683
        Expand []*string `form:"expand"`
684
}
685

686
// AddExpand appends a new field to expand.
UNCOV
687
func (p *PaymentLinkListLineItemsParams) AddExpand(f string) {
×
UNCOV
688
        p.Expand = append(p.Expand, &f)
×
UNCOV
689
}
×
690

691
type PaymentLinkAfterCompletionHostedConfirmation struct {
692
        // The custom message that is displayed to the customer after the purchase is complete.
693
        CustomMessage string `json:"custom_message"`
694
}
695
type PaymentLinkAfterCompletionRedirect struct {
696
        // The URL the customer will be redirected to after the purchase is complete.
697
        URL string `json:"url"`
698
}
699
type PaymentLinkAfterCompletion struct {
700
        HostedConfirmation *PaymentLinkAfterCompletionHostedConfirmation `json:"hosted_confirmation"`
701
        Redirect           *PaymentLinkAfterCompletionRedirect           `json:"redirect"`
702
        // The specified behavior after the purchase is complete.
703
        Type PaymentLinkAfterCompletionType `json:"type"`
704
}
705

706
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
707
type PaymentLinkAutomaticTaxLiability struct {
708
        // The connected account being referenced when `type` is `account`.
709
        Account *Account `json:"account"`
710
        // Type of the account referenced.
711
        Type PaymentLinkAutomaticTaxLiabilityType `json:"type"`
712
}
713
type PaymentLinkAutomaticTax struct {
714
        // If `true`, tax will be calculated automatically using the customer's location.
715
        Enabled bool `json:"enabled"`
716
        // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
717
        Liability *PaymentLinkAutomaticTaxLiability `json:"liability"`
718
}
719

720
// Settings related to the payment method reuse text shown in the Checkout UI.
721
type PaymentLinkConsentCollectionPaymentMethodReuseAgreement struct {
722
        // Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used.
723
        //
724
        // When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
725
        Position PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition `json:"position"`
726
}
727

728
// When set, provides configuration to gather active consent from customers.
729
type PaymentLinkConsentCollection struct {
730
        // Settings related to the payment method reuse text shown in the Checkout UI.
731
        PaymentMethodReuseAgreement *PaymentLinkConsentCollectionPaymentMethodReuseAgreement `json:"payment_method_reuse_agreement"`
732
        // If set to `auto`, enables the collection of customer consent for promotional communications.
733
        Promotions PaymentLinkConsentCollectionPromotions `json:"promotions"`
734
        // If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service.
735
        TermsOfService PaymentLinkConsentCollectionTermsOfService `json:"terms_of_service"`
736
}
737

738
// The options available for the customer to select. Up to 200 options allowed.
739
type PaymentLinkCustomFieldDropdownOption struct {
740
        // The label for the option, displayed to the customer. Up to 100 characters.
741
        Label string `json:"label"`
742
        // The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters.
743
        Value string `json:"value"`
744
}
745
type PaymentLinkCustomFieldDropdown struct {
746
        // The options available for the customer to select. Up to 200 options allowed.
747
        Options []*PaymentLinkCustomFieldDropdownOption `json:"options"`
748
}
749
type PaymentLinkCustomFieldLabel struct {
750
        // Custom text for the label, displayed to the customer. Up to 50 characters.
751
        Custom string `json:"custom"`
752
        // The type of the label.
753
        Type PaymentLinkCustomFieldLabelType `json:"type"`
754
}
755
type PaymentLinkCustomFieldNumeric struct {
756
        // The maximum character length constraint for the customer's input.
757
        MaximumLength int64 `json:"maximum_length"`
758
        // The minimum character length requirement for the customer's input.
759
        MinimumLength int64 `json:"minimum_length"`
760
}
761
type PaymentLinkCustomFieldText struct {
762
        // The maximum character length constraint for the customer's input.
763
        MaximumLength int64 `json:"maximum_length"`
764
        // The minimum character length requirement for the customer's input.
765
        MinimumLength int64 `json:"minimum_length"`
766
}
767

768
// Collect additional information from your customer using custom fields. Up to 3 fields are supported.
769
type PaymentLinkCustomField struct {
770
        Dropdown *PaymentLinkCustomFieldDropdown `json:"dropdown"`
771
        // String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters.
772
        Key     string                         `json:"key"`
773
        Label   *PaymentLinkCustomFieldLabel   `json:"label"`
774
        Numeric *PaymentLinkCustomFieldNumeric `json:"numeric"`
775
        // Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`.
776
        Optional bool                        `json:"optional"`
777
        Text     *PaymentLinkCustomFieldText `json:"text"`
778
        // The type of the field.
779
        Type PaymentLinkCustomFieldType `json:"type"`
780
}
781

782
// Custom text that should be displayed after the payment confirmation button.
783
type PaymentLinkCustomTextAfterSubmit struct {
784
        // Text may be up to 1200 characters in length.
785
        Message string `json:"message"`
786
}
787

788
// Custom text that should be displayed alongside shipping address collection.
789
type PaymentLinkCustomTextShippingAddress struct {
790
        // Text may be up to 1200 characters in length.
791
        Message string `json:"message"`
792
}
793

794
// Custom text that should be displayed alongside the payment confirmation button.
795
type PaymentLinkCustomTextSubmit struct {
796
        // Text may be up to 1200 characters in length.
797
        Message string `json:"message"`
798
}
799

800
// Custom text that should be displayed in place of the default terms of service agreement text.
801
type PaymentLinkCustomTextTermsOfServiceAcceptance struct {
802
        // Text may be up to 1200 characters in length.
803
        Message string `json:"message"`
804
}
805
type PaymentLinkCustomText struct {
806
        // Custom text that should be displayed after the payment confirmation button.
807
        AfterSubmit *PaymentLinkCustomTextAfterSubmit `json:"after_submit"`
808
        // Custom text that should be displayed alongside shipping address collection.
809
        ShippingAddress *PaymentLinkCustomTextShippingAddress `json:"shipping_address"`
810
        // Custom text that should be displayed alongside the payment confirmation button.
811
        Submit *PaymentLinkCustomTextSubmit `json:"submit"`
812
        // Custom text that should be displayed in place of the default terms of service agreement text.
813
        TermsOfServiceAcceptance *PaymentLinkCustomTextTermsOfServiceAcceptance `json:"terms_of_service_acceptance"`
814
}
815

816
// A list of up to 4 custom fields to be displayed on the invoice.
817
type PaymentLinkInvoiceCreationInvoiceDataCustomField struct {
818
        // The name of the custom field.
819
        Name string `json:"name"`
820
        // The value of the custom field.
821
        Value string `json:"value"`
822
}
823

824
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
825
type PaymentLinkInvoiceCreationInvoiceDataIssuer struct {
826
        // The connected account being referenced when `type` is `account`.
827
        Account *Account `json:"account"`
828
        // Type of the account referenced.
829
        Type PaymentLinkInvoiceCreationInvoiceDataIssuerType `json:"type"`
830
}
831

832
// Options for invoice PDF rendering.
833
type PaymentLinkInvoiceCreationInvoiceDataRenderingOptions struct {
834
        // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
835
        AmountTaxDisplay string `json:"amount_tax_display"`
836
}
837

838
// Configuration for the invoice. Default invoice values will be used if unspecified.
839
type PaymentLinkInvoiceCreationInvoiceData struct {
840
        // The account tax IDs associated with the invoice.
841
        AccountTaxIDs []*TaxID `json:"account_tax_ids"`
842
        // A list of up to 4 custom fields to be displayed on the invoice.
843
        CustomFields []*PaymentLinkInvoiceCreationInvoiceDataCustomField `json:"custom_fields"`
844
        // An arbitrary string attached to the object. Often useful for displaying to users.
845
        Description string `json:"description"`
846
        // Footer to be displayed on the invoice.
847
        Footer string `json:"footer"`
848
        // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
849
        Issuer *PaymentLinkInvoiceCreationInvoiceDataIssuer `json:"issuer"`
850
        // 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.
851
        Metadata map[string]string `json:"metadata"`
852
        // Options for invoice PDF rendering.
853
        RenderingOptions *PaymentLinkInvoiceCreationInvoiceDataRenderingOptions `json:"rendering_options"`
854
}
855

856
// Configuration for creating invoice for payment mode payment links.
857
type PaymentLinkInvoiceCreation struct {
858
        // Enable creating an invoice on successful payment.
859
        Enabled bool `json:"enabled"`
860
        // Configuration for the invoice. Default invoice values will be used if unspecified.
861
        InvoiceData *PaymentLinkInvoiceCreationInvoiceData `json:"invoice_data"`
862
}
863

864
// Indicates the parameters to be passed to PaymentIntent creation during checkout.
865
type PaymentLinkPaymentIntentData struct {
866
        // Indicates when the funds will be captured from the customer's account.
867
        CaptureMethod PaymentLinkPaymentIntentDataCaptureMethod `json:"capture_method"`
868
        // An arbitrary string attached to the object. Often useful for displaying to users.
869
        Description string `json:"description"`
870
        // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link.
871
        Metadata map[string]string `json:"metadata"`
872
        // Indicates that you intend to make future payments with the payment method collected during checkout.
873
        SetupFutureUsage PaymentLinkPaymentIntentDataSetupFutureUsage `json:"setup_future_usage"`
874
        // For a non-card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge.
875
        StatementDescriptor string `json:"statement_descriptor"`
876
        // For a card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. Concatenated with the account's statement descriptor prefix to form the complete statement descriptor.
877
        StatementDescriptorSuffix string `json:"statement_descriptor_suffix"`
878
        // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
879
        TransferGroup string `json:"transfer_group"`
880
}
881
type PaymentLinkPhoneNumberCollection struct {
882
        // If `true`, a phone number will be collected during checkout.
883
        Enabled bool `json:"enabled"`
884
}
885
type PaymentLinkRestrictionsCompletedSessions struct {
886
        // The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met.
887
        Count int64 `json:"count"`
888
        // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met.
889
        Limit int64 `json:"limit"`
890
}
891

892
// Settings that restrict the usage of a payment link.
893
type PaymentLinkRestrictions struct {
894
        CompletedSessions *PaymentLinkRestrictionsCompletedSessions `json:"completed_sessions"`
895
}
896

897
// Configuration for collecting the customer's shipping address.
898
type PaymentLinkShippingAddressCollection struct {
899
        // An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.
900
        AllowedCountries []string `json:"allowed_countries"`
901
}
902

903
// The shipping rate options applied to the session.
904
type PaymentLinkShippingOption struct {
905
        // A non-negative integer in cents representing how much to charge.
906
        ShippingAmount int64 `json:"shipping_amount"`
907
        // The ID of the Shipping Rate to use for this shipping option.
908
        ShippingRate *ShippingRate `json:"shipping_rate"`
909
}
910
type PaymentLinkSubscriptionDataInvoiceSettingsIssuer struct {
911
        // The connected account being referenced when `type` is `account`.
912
        Account *Account `json:"account"`
913
        // Type of the account referenced.
914
        Type PaymentLinkSubscriptionDataInvoiceSettingsIssuerType `json:"type"`
915
}
916
type PaymentLinkSubscriptionDataInvoiceSettings struct {
917
        Issuer *PaymentLinkSubscriptionDataInvoiceSettingsIssuer `json:"issuer"`
918
}
919

920
// Defines how a subscription behaves when a free trial ends.
921
type PaymentLinkSubscriptionDataTrialSettingsEndBehavior struct {
922
        // Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
923
        MissingPaymentMethod PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod `json:"missing_payment_method"`
924
}
925

926
// Settings related to subscription trials.
927
type PaymentLinkSubscriptionDataTrialSettings struct {
928
        // Defines how a subscription behaves when a free trial ends.
929
        EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehavior `json:"end_behavior"`
930
}
931

932
// When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
933
type PaymentLinkSubscriptionData struct {
934
        // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
935
        Description     string                                      `json:"description"`
936
        InvoiceSettings *PaymentLinkSubscriptionDataInvoiceSettings `json:"invoice_settings"`
937
        // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link.
938
        Metadata map[string]string `json:"metadata"`
939
        // Integer representing the number of trial period days before the customer is charged for the first time.
940
        TrialPeriodDays int64 `json:"trial_period_days"`
941
        // Settings related to subscription trials.
942
        TrialSettings *PaymentLinkSubscriptionDataTrialSettings `json:"trial_settings"`
943
}
944
type PaymentLinkTaxIDCollection struct {
945
        // Indicates whether tax ID collection is enabled for the session.
946
        Enabled  bool                               `json:"enabled"`
947
        Required PaymentLinkTaxIDCollectionRequired `json:"required"`
948
}
949

950
// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
951
type PaymentLinkTransferData struct {
952
        // The amount in cents (or local equivalent) that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
953
        Amount int64 `json:"amount"`
954
        // The connected account receiving the transfer.
955
        Destination *Account `json:"destination"`
956
}
957

958
// A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.
959
//
960
// When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links.
961
//
962
// Related guide: [Payment Links API](https://stripe.com/docs/payment-links)
963
type PaymentLink struct {
964
        APIResource
965
        // Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated.
966
        Active          bool                        `json:"active"`
967
        AfterCompletion *PaymentLinkAfterCompletion `json:"after_completion"`
968
        // Whether user redeemable promotion codes are enabled.
969
        AllowPromotionCodes bool `json:"allow_promotion_codes"`
970
        // The ID of the Connect application that created the Payment Link.
971
        Application *Application `json:"application"`
972
        // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
973
        ApplicationFeeAmount int64 `json:"application_fee_amount"`
974
        // This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
975
        ApplicationFeePercent float64                  `json:"application_fee_percent"`
976
        AutomaticTax          *PaymentLinkAutomaticTax `json:"automatic_tax"`
977
        // Configuration for collecting the customer's billing address. Defaults to `auto`.
978
        BillingAddressCollection PaymentLinkBillingAddressCollection `json:"billing_address_collection"`
979
        // When set, provides configuration to gather active consent from customers.
980
        ConsentCollection *PaymentLinkConsentCollection `json:"consent_collection"`
981
        // 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).
982
        Currency Currency `json:"currency"`
983
        // Configuration for Customer creation during checkout.
984
        CustomerCreation PaymentLinkCustomerCreation `json:"customer_creation"`
985
        // Collect additional information from your customer using custom fields. Up to 3 fields are supported.
986
        CustomFields []*PaymentLinkCustomField `json:"custom_fields"`
987
        CustomText   *PaymentLinkCustomText    `json:"custom_text"`
988
        // Unique identifier for the object.
989
        ID string `json:"id"`
990
        // The custom message to be displayed to a customer when a payment link is no longer active.
991
        InactiveMessage string `json:"inactive_message"`
992
        // Configuration for creating invoice for payment mode payment links.
993
        InvoiceCreation *PaymentLinkInvoiceCreation `json:"invoice_creation"`
994
        // The line items representing what is being sold.
995
        LineItems *LineItemList `json:"line_items"`
996
        // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
997
        Livemode bool `json:"livemode"`
998
        // 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.
999
        Metadata map[string]string `json:"metadata"`
1000
        // String representing the object's type. Objects of the same type share the same value.
1001
        Object string `json:"object"`
1002
        // The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details.
1003
        OnBehalfOf *Account `json:"on_behalf_of"`
1004
        // Indicates the parameters to be passed to PaymentIntent creation during checkout.
1005
        PaymentIntentData *PaymentLinkPaymentIntentData `json:"payment_intent_data"`
1006
        // Configuration for collecting a payment method during checkout. Defaults to `always`.
1007
        PaymentMethodCollection PaymentLinkPaymentMethodCollection `json:"payment_method_collection"`
1008
        // The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
1009
        PaymentMethodTypes    []PaymentLinkPaymentMethodType    `json:"payment_method_types"`
1010
        PhoneNumberCollection *PaymentLinkPhoneNumberCollection `json:"phone_number_collection"`
1011
        // Settings that restrict the usage of a payment link.
1012
        Restrictions *PaymentLinkRestrictions `json:"restrictions"`
1013
        // Configuration for collecting the customer's shipping address.
1014
        ShippingAddressCollection *PaymentLinkShippingAddressCollection `json:"shipping_address_collection"`
1015
        // The shipping rate options applied to the session.
1016
        ShippingOptions []*PaymentLinkShippingOption `json:"shipping_options"`
1017
        // Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.
1018
        SubmitType PaymentLinkSubmitType `json:"submit_type"`
1019
        // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
1020
        SubscriptionData *PaymentLinkSubscriptionData `json:"subscription_data"`
1021
        TaxIDCollection  *PaymentLinkTaxIDCollection  `json:"tax_id_collection"`
1022
        // The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
1023
        TransferData *PaymentLinkTransferData `json:"transfer_data"`
1024
        // The public URL that can be shared with customers.
1025
        URL string `json:"url"`
1026
}
1027

1028
// PaymentLinkList is a list of PaymentLinks as retrieved from a list endpoint.
1029
type PaymentLinkList struct {
1030
        APIResource
1031
        ListMeta
1032
        Data []*PaymentLink `json:"data"`
1033
}
1034

1035
// UnmarshalJSON handles deserialization of a PaymentLink.
1036
// This custom unmarshaling is needed because the resulting
1037
// property may be an id or the full struct if it was expanded.
UNCOV
1038
func (p *PaymentLink) UnmarshalJSON(data []byte) error {
×
UNCOV
1039
        if id, ok := ParseID(data); ok {
×
UNCOV
1040
                p.ID = id
×
UNCOV
1041
                return nil
×
1042
        }
×
1043

1044
        type paymentLink PaymentLink
×
1045
        var v paymentLink
×
1046
        if err := json.Unmarshal(data, &v); err != nil {
×
UNCOV
1047
                return err
×
1048
        }
×
1049

1050
        *p = PaymentLink(v)
×
1051
        return nil
×
1052
}
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