diff --git a/CHANGELOG.md b/CHANGELOG.md index de97e6fe12..dd59396b49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,6 @@ * Add support for `CashbackAmount` on `IssuingAuthorizationAmountDetails`, `IssuingAuthorizationPendingRequestAmountDetails`, `IssuingAuthorizationRequestHistoryAmountDetails`, and `IssuingTransactionAmountDetails` * Add support for `SerialNumber` on `TerminalReaderListParams` - ## 75.5.0 - 2023-09-13 * [#1735](https://github.com/stripe/stripe-go/pull/1735) Bugfix: point files.New back to files.stripe.com * [#1731](https://github.com/stripe/stripe-go/pull/1731) Delay calculation of Stripe-User-Agent diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e9281bf5d6..688708d739 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v532 \ No newline at end of file +v545 \ No newline at end of file diff --git a/account.go b/account.go index aefdc7359f..ad3ae1a80e 100644 --- a/account.go +++ b/account.go @@ -1378,7 +1378,7 @@ type Account struct { // A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. // See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. // - // Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information) + // Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) Individual *Person `json:"individual"` // 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. Metadata map[string]string `json:"metadata"` diff --git a/api_version.go b/api_version.go index 9d45b21b57..4629581ba2 100644 --- a/api_version.go +++ b/api_version.go @@ -8,5 +8,5 @@ package stripe const ( apiVersion string = "2023-08-16" - previewVersion string = "2023-08-11.preview-v2" + previewVersion string = "2023-09-15.preview-v2" ) diff --git a/checkout_session.go b/checkout_session.go index 0fa6da7723..de6d1814d5 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -820,13 +820,19 @@ type CheckoutSessionCustomFieldParams struct { // Custom text that should be displayed alongside shipping address collection. type CheckoutSessionCustomTextShippingAddressParams struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. Message *string `form:"message"` } // Custom text that should be displayed alongside the payment confirmation button. type CheckoutSessionCustomTextSubmitParams struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. + Message *string `form:"message"` +} + +// Custom text that should be displayed in place of the default terms of service agreement text. +type CheckoutSessionCustomTextTermsOfServiceAcceptanceParams struct { + // Text may be up to 1200 characters in length. Message *string `form:"message"` } @@ -836,6 +842,8 @@ type CheckoutSessionCustomTextParams struct { ShippingAddress *CheckoutSessionCustomTextShippingAddressParams `form:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button. Submit *CheckoutSessionCustomTextSubmitParams `form:"submit"` + // Custom text that should be displayed in place of the default terms of service agreement text. + TermsOfServiceAcceptance *CheckoutSessionCustomTextTermsOfServiceAcceptanceParams `form:"terms_of_service_acceptance"` } // Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. @@ -1953,13 +1961,19 @@ type CheckoutSessionCustomField struct { // Custom text that should be displayed alongside shipping address collection. type CheckoutSessionCustomTextShippingAddress struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. Message string `json:"message"` } // Custom text that should be displayed alongside the payment confirmation button. type CheckoutSessionCustomTextSubmit struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. + Message string `json:"message"` +} + +// Custom text that should be displayed in place of the default terms of service agreement text. +type CheckoutSessionCustomTextTermsOfServiceAcceptance struct { + // Text may be up to 1200 characters in length. Message string `json:"message"` } type CheckoutSessionCustomText struct { @@ -1967,6 +1981,8 @@ type CheckoutSessionCustomText struct { ShippingAddress *CheckoutSessionCustomTextShippingAddress `json:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button. Submit *CheckoutSessionCustomTextSubmit `json:"submit"` + // Custom text that should be displayed in place of the default terms of service agreement text. + TermsOfServiceAcceptance *CheckoutSessionCustomTextTermsOfServiceAcceptance `json:"terms_of_service_acceptance"` } // The customer's tax IDs after a completed Checkout Session. diff --git a/confirmationtoken.go b/confirmationtoken.go index 540d69260a..c763fc381f 100644 --- a/confirmationtoken.go +++ b/confirmationtoken.go @@ -750,8 +750,6 @@ type ConfirmationToken struct { APIResource // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` - // ID of the Customer this ConfirmationToken belongs to. - Customer string `json:"customer"` // Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. ExpiresAt int64 `json:"expires_at"` // Unique identifier for the object. diff --git a/file.go b/file.go index 26f00a88b1..313c951aa3 100644 --- a/file.go +++ b/file.go @@ -38,14 +38,14 @@ const ( FilePurposeTerminalReaderSplashscreen FilePurpose = "terminal_reader_splashscreen" ) -// Returns a list of the files that your account has access to. The files are returned sorted by creation date, with the most recently created files appearing first. +// Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. type FileListParams struct { ListParams `form:"*"` Created *int64 `form:"created"` CreatedRange *RangeQueryParams `form:"created"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` - // The file purpose to filter queries by. If none is provided, files will not be filtered by purpose. + // Filter queries by the file purpose. If you don't provide a purpose, the queries return unfiltered files. Purpose *string `form:"purpose"` } @@ -54,12 +54,12 @@ func (p *FileListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Optional parameters to automatically create a [file link](https://stripe.com/docs/api#file_links) for the newly created file. +// Optional parameters that automatically create a [file link](https://stripe.com/docs/api#file_links) for the newly created file. type FileFileLinkDataParams struct { Params `form:"*"` // Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. Create *bool `form:"create"` - // A future timestamp after which the link will no longer be usable. + // The link isn't available after this future timestamp. ExpiresAt *int64 `form:"expires_at"` // 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 map[string]string `form:"metadata"` @@ -74,9 +74,9 @@ func (p *FileFileLinkDataParams) AddMetadata(key string, value string) { p.Metadata[key] = value } -// To upload a file to Stripe, you'll need to send a request of type multipart/form-data. The request should contain the file you would like to upload, as well as the parameters for creating a file. +// To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. // -// All of Stripe's officially supported Client libraries should have support for sending multipart/form-data. +// All of Stripe's officially supported Client libraries support sending multipart/form-data. type FileParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. @@ -86,7 +86,7 @@ type FileParams struct { // Filename is just the name of the file without path information. Filename *string - // Optional parameters to automatically create a [file link](https://stripe.com/docs/api#file_links) for the newly created file. + // Optional parameters that automatically create a [file link](https://stripe.com/docs/api#file_links) for the newly created file. FileLinkData *FileFileLinkDataParams `form:"file_link_data"` // The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. Purpose *string `form:"purpose"` @@ -97,10 +97,10 @@ func (p *FileParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// This is an object representing a file hosted on Stripe's servers. The -// file may have been uploaded by yourself using the [create file](https://stripe.com/docs/api#create_file) -// request (for example, when uploading dispute evidence) or it may have -// been created by Stripe (for example, the results of a [Sigma scheduled +// This object represents files hosted on Stripe's servers. You can upload +// files with the [create file](https://stripe.com/docs/api#create_file) request +// (for example, when uploading dispute evidence). Stripe also +// creates files independetly (for example, the results of a [Sigma scheduled // query](https://stripe.com/docs/api#scheduled_queries)). // // Related guide: [File upload guide](https://stripe.com/docs/file-upload) @@ -108,9 +108,9 @@ type File struct { APIResource // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` - // The time at which the file expires and is no longer available in epoch seconds. + // The file expires and isn't available at this time in epoch seconds. ExpiresAt int64 `json:"expires_at"` - // A filename for the file, suitable for saving to a filesystem. + // The suitable name for saving the file to a filesystem. Filename string `json:"filename"` // Unique identifier for the object. ID string `json:"id"` @@ -120,13 +120,13 @@ type File struct { Object string `json:"object"` // The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. Purpose FilePurpose `json:"purpose"` - // The size in bytes of the file object. + // The size of the file object in bytes. Size int64 `json:"size"` - // A user friendly title for the document. + // A suitable title for the document. Title string `json:"title"` - // The type of the file returned (e.g., `csv`, `pdf`, `jpg`, or `png`). + // The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). Type string `json:"type"` - // The URL from which the file can be downloaded using your live secret API key. + // Use your live secret API key to download the file from this URL. URL string `json:"url"` } diff --git a/filelink.go b/filelink.go index 6759a7ebb7..89698a57ff 100644 --- a/filelink.go +++ b/filelink.go @@ -50,7 +50,7 @@ type FileLinkListParams struct { CreatedRange *RangeQueryParams `form:"created"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` - // Filter links by their expiration status. By default, all links are returned. + // Filter links by their expiration status. By default, Stripe returns all links. Expired *bool `form:"expired"` // Only return links for the given file. File *string `form:"file"` @@ -62,15 +62,15 @@ func (p *FileLinkListParams) AddExpand(f string) { } // To share the contents of a `File` object with non-Stripe users, you can -// create a `FileLink`. `FileLink`s contain a URL that can be used to +// create a `FileLink`. `FileLink`s contain a URL that you can use to // retrieve the contents of the file without authentication. type FileLink struct { APIResource // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` - // Whether this link is already expired. + // Returns if the link is already expired. Expired bool `json:"expired"` - // Time at which the link expires. + // Time that the link expires. ExpiresAt int64 `json:"expires_at"` // The file object this link points to. File *File `json:"file"` diff --git a/invoice.go b/invoice.go index 0de159d1ca..228d6e4331 100644 --- a/invoice.go +++ b/invoice.go @@ -11,6 +11,15 @@ import ( "github.com/stripe/stripe-go/v75/form" ) +// Type of the account referenced. +type InvoiceAutomaticTaxLiabilityType string + +// List of values that InvoiceAutomaticTaxLiabilityType can take +const ( + InvoiceAutomaticTaxLiabilityTypeAccount InvoiceAutomaticTaxLiabilityType = "account" + InvoiceAutomaticTaxLiabilityTypeSelf InvoiceAutomaticTaxLiabilityType = "self" +) + // The status of the most recent automated tax calculation for this invoice. type InvoiceAutomaticTaxStatus string @@ -54,6 +63,15 @@ const ( InvoiceCollectionMethodSendInvoice InvoiceCollectionMethod = "send_invoice" ) +// Type of the account referenced. +type InvoiceIssuerType string + +// List of values that InvoiceIssuerType can take +const ( + InvoiceIssuerTypeAccount InvoiceIssuerType = "account" + InvoiceIssuerTypeSelf InvoiceIssuerType = "self" +) + // Transaction type of the mandate. type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType string @@ -236,10 +254,22 @@ func (p *InvoiceSearchParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// 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. +type InvoiceUpcomingAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Settings for automatic tax lookup for this invoice preview. type InvoiceAutomaticTaxParams struct { // Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. Enabled *bool `form:"enabled"` + // 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. + Liability *InvoiceAutomaticTaxLiabilityParams `form:"liability"` + // 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. + LiabilityTODOINCOMPATIBLECOMBINATION *InvoiceUpcomingAutomaticTaxLiabilityParams `form:"liabilityTODO_INCOMPATIBLE_COMBINATION"` } type InvoiceUpcomingAutomaticTaxParams struct { Enabled *bool `form:"enabled"` @@ -366,6 +396,14 @@ func (p *InvoiceUpcomingInvoiceItemParams) AddMetadata(key string, value string) p.Metadata[key] = value } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type InvoiceUpcomingIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // The pre-billing to apply to the subscription as a preview. type InvoiceUpcomingSubscriptionPrebillingParams struct { // This is used to determine the number of billing cycles to prebill. @@ -395,6 +433,10 @@ type InvoiceUpcomingParams struct { Expand []*string `form:"expand"` // List of invoice items to add or update in the upcoming invoice preview. InvoiceItems []*InvoiceUpcomingInvoiceItemParams `form:"invoice_items"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *InvoiceUpcomingIssuerParams `form:"issuer"` + // The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + OnBehalfOf *string `form:"on_behalf_of"` // The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. Schedule *string `form:"schedule"` // The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @@ -448,6 +490,14 @@ func (p *InvoiceUpcomingParams) AppendTo(body *form.Values, keyParts []string) { } } +// 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. +type InvoiceAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. type InvoiceCustomFieldParams struct { // The name of the custom field. This may be up to 30 characters. @@ -464,6 +514,14 @@ type InvoiceDiscountDiscountEndDurationParams struct { IntervalCount *int64 `form:"interval_count"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type InvoiceIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Additional fields for Mandate creation type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams struct { // Transaction type of the mandate. @@ -730,6 +788,8 @@ type InvoiceParams struct { Footer *string `form:"footer"` // Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. FromInvoice *InvoiceFromInvoiceParams `form:"from_invoice"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *InvoiceIssuerParams `form:"issuer"` // 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 map[string]string `form:"metadata"` // The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @@ -792,10 +852,20 @@ func (p *InvoicePayParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// 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. +type InvoiceUpcomingLinesAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Settings for automatic tax lookup for this invoice preview. type InvoiceUpcomingLinesAutomaticTaxParams struct { // Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. Enabled *bool `form:"enabled"` + // 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. + Liability *InvoiceUpcomingLinesAutomaticTaxLiabilityParams `form:"liability"` } // The customer's shipping information. Appears on invoices emailed to this customer. @@ -959,6 +1029,14 @@ func (p *InvoiceUpcomingLinesInvoiceItemParams) AddMetadata(key string, value st p.Metadata[key] = value } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type InvoiceUpcomingLinesIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. type InvoiceUpcomingLinesSubscriptionItemBillingThresholdsParams struct { // Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) @@ -1077,6 +1155,10 @@ type InvoiceUpcomingLinesParams struct { Expand []*string `form:"expand"` // List of invoice items to add or update in the upcoming invoice preview. InvoiceItems []*InvoiceUpcomingLinesInvoiceItemParams `form:"invoice_items"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *InvoiceUpcomingLinesIssuerParams `form:"issuer"` + // The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + OnBehalfOf *string `form:"on_behalf_of"` // The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. Schedule *string `form:"schedule"` // The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @@ -1227,9 +1309,18 @@ func (p *InvoiceListLinesParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// The connected 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. +type InvoiceAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type InvoiceAutomaticTaxLiabilityType `json:"type"` +} type InvoiceAutomaticTax struct { // Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. Enabled bool `json:"enabled"` + // The connected 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. + Liability *InvoiceAutomaticTaxLiability `json:"liability"` // The status of the most recent automated tax calculation for this invoice. Status InvoiceAutomaticTaxStatus `json:"status"` } @@ -1257,6 +1348,14 @@ type InvoiceFromInvoice struct { // The invoice that was cloned. Invoice *Invoice `json:"invoice"` } + +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type InvoiceIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type InvoiceIssuerType `json:"type"` +} type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptions struct { // Transaction type of the mandate. TransactionType InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType `json:"transaction_type"` @@ -1570,6 +1669,8 @@ type Invoice struct { ID string `json:"id"` // The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. InvoicePDF string `json:"invoice_pdf"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *InvoiceIssuer `json:"issuer"` // The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. LastFinalizationError *Error `json:"last_finalization_error"` // The ID of the most recent non-draft revision of this invoice diff --git a/issuing_authorization.go b/issuing_authorization.go index 14bf74de70..f22a3edc6b 100644 --- a/issuing_authorization.go +++ b/issuing_authorization.go @@ -127,8 +127,8 @@ func (p *IssuingAuthorizationParams) AddMetadata(key string, value string) { p.Metadata[key] = value } -// Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. -// You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found [here](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). +// [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). type IssuingAuthorizationApproveParams struct { Params `form:"*"` // If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). @@ -153,8 +153,8 @@ func (p *IssuingAuthorizationApproveParams) AddMetadata(key string, value string p.Metadata[key] = value } -// Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. -// You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found [here](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). +// [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). type IssuingAuthorizationDeclineParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. diff --git a/paymentintent.go b/paymentintent.go index 7e5be348b7..f925140d71 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1925,9 +1925,10 @@ type PaymentIntentParams struct { StatementDescriptor *string `form:"statement_descriptor"` // Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` - // The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + // The parameters used to automatically create a Transfer when the payment succeeds. + // For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). TransferData *PaymentIntentTransferDataParams `form:"transfer_data"` - // A string that identifies the resulting payment as part of a group. `transfer_group` may only be provided if it has not been set. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + // A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). TransferGroup *string `form:"transfer_group"` // These parameters apply only for paymentIntent.New with `confirm=true` // Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). diff --git a/paymentlink.go b/paymentlink.go index 0a1139e651..391883bf6b 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -256,13 +256,19 @@ type PaymentLinkCustomFieldParams struct { // Custom text that should be displayed alongside shipping address collection. type PaymentLinkCustomTextShippingAddressParams struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. Message *string `form:"message"` } // Custom text that should be displayed alongside the payment confirmation button. type PaymentLinkCustomTextSubmitParams struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. + Message *string `form:"message"` +} + +// Custom text that should be displayed in place of the default terms of service agreement text. +type PaymentLinkCustomTextTermsOfServiceAcceptanceParams struct { + // Text may be up to 1200 characters in length. Message *string `form:"message"` } @@ -272,6 +278,8 @@ type PaymentLinkCustomTextParams struct { ShippingAddress *PaymentLinkCustomTextShippingAddressParams `form:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button. Submit *PaymentLinkCustomTextSubmitParams `form:"submit"` + // Custom text that should be displayed in place of the default terms of service agreement text. + TermsOfServiceAcceptance *PaymentLinkCustomTextTermsOfServiceAcceptanceParams `form:"terms_of_service_acceptance"` } // Default custom fields to be displayed on invoices for this customer. @@ -581,13 +589,19 @@ type PaymentLinkCustomField struct { // Custom text that should be displayed alongside shipping address collection. type PaymentLinkCustomTextShippingAddress struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. Message string `json:"message"` } // Custom text that should be displayed alongside the payment confirmation button. type PaymentLinkCustomTextSubmit struct { - // Text may be up to 1000 characters in length. + // Text may be up to 1200 characters in length. + Message string `json:"message"` +} + +// Custom text that should be displayed in place of the default terms of service agreement text. +type PaymentLinkCustomTextTermsOfServiceAcceptance struct { + // Text may be up to 1200 characters in length. Message string `json:"message"` } type PaymentLinkCustomText struct { @@ -595,6 +609,8 @@ type PaymentLinkCustomText struct { ShippingAddress *PaymentLinkCustomTextShippingAddress `json:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button. Submit *PaymentLinkCustomTextSubmit `json:"submit"` + // Custom text that should be displayed in place of the default terms of service agreement text. + TermsOfServiceAcceptance *PaymentLinkCustomTextTermsOfServiceAcceptance `json:"terms_of_service_acceptance"` } // A list of up to 4 custom fields to be displayed on the invoice. diff --git a/paymentmethod.go b/paymentmethod.go index c692141191..3a9244feaf 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -305,7 +305,8 @@ type PaymentMethodCardParams struct { ExpYear *int64 `form:"exp_year"` // The card number, as a string without any separators. Number *string `form:"number"` - Token *string `form:"token"` + // For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. + Token *string `form:"token"` } // If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. diff --git a/person.go b/person.go index 88113c7703..8b2dc21632 100644 --- a/person.go +++ b/person.go @@ -229,9 +229,9 @@ type PersonParams struct { FullNameAliases []*string `form:"full_name_aliases"` // The person's gender (International regulations require either "male" or "female"). Gender *string `form:"gender"` - // The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + // The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). IDNumber *string `form:"id_number"` - // The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + // The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). IDNumberSecondary *string `form:"id_number_secondary"` // The person's last name. LastName *string `form:"last_name"` @@ -419,7 +419,7 @@ type PersonVerification struct { // A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. // See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. // -// Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information) +// Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) type Person struct { APIResource // The account the person is associated with. diff --git a/quote.go b/quote.go index 6e8fb09c57..4b0402dd29 100644 --- a/quote.go +++ b/quote.go @@ -11,6 +11,15 @@ import ( "github.com/stripe/stripe-go/v75/form" ) +// Type of the account referenced. +type QuoteAutomaticTaxLiabilityType string + +// List of values that QuoteAutomaticTaxLiabilityType can take +const ( + QuoteAutomaticTaxLiabilityTypeAccount QuoteAutomaticTaxLiabilityType = "account" + QuoteAutomaticTaxLiabilityTypeSelf QuoteAutomaticTaxLiabilityType = "self" +) + // The status of the most recent automated tax calculation for this quote. type QuoteAutomaticTaxStatus string @@ -85,6 +94,15 @@ const ( QuoteComputedUpfrontTotalDetailsBreakdownTaxTaxabilityReasonZeroRated QuoteComputedUpfrontTotalDetailsBreakdownTaxTaxabilityReason = "zero_rated" ) +// Type of the account referenced. +type QuoteInvoiceSettingsIssuerType string + +// List of values that QuoteInvoiceSettingsIssuerType can take +const ( + QuoteInvoiceSettingsIssuerTypeAccount QuoteInvoiceSettingsIssuerType = "account" + QuoteInvoiceSettingsIssuerTypeSelf QuoteInvoiceSettingsIssuerType = "self" +) + // The status of the quote. type QuoteStatus string @@ -365,10 +383,20 @@ func (p *QuoteParams) AddMetadata(key string, value string) { p.Metadata[key] = value } +// 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. +type QuoteAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. type QuoteAutomaticTaxParams struct { // Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. Enabled *bool `form:"enabled"` + // 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. + Liability *QuoteAutomaticTaxLiabilityParams `form:"liability"` } // Time span for the redeemed discount. @@ -399,10 +427,20 @@ type QuoteDiscountParams struct { DiscountEnd *QuoteDiscountDiscountEndParams `form:"discount_end"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type QuoteInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // All invoices will be billed using the specified settings. type QuoteInvoiceSettingsParams struct { // Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *QuoteInvoiceSettingsIssuerParams `form:"issuer"` } // Time span for the redeemed discount. @@ -1238,9 +1276,18 @@ func (p *QuotePDFParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// 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. +type QuoteAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuoteAutomaticTaxLiabilityType `json:"type"` +} type QuoteAutomaticTax struct { // Automatically calculate taxes Enabled bool `json:"enabled"` + // 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. + Liability *QuoteAutomaticTaxLiability `json:"liability"` // The status of the most recent automated tax calculation for this quote. Status QuoteAutomaticTaxStatus `json:"status"` } @@ -1362,10 +1409,20 @@ type QuoteFromQuote struct { Quote *Quote `json:"quote"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type QuoteInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuoteInvoiceSettingsIssuerType `json:"type"` +} + // All invoices will be billed using the specified settings. type QuoteInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *QuoteInvoiceSettingsIssuer `json:"issuer"` } type QuoteStatusDetailsCanceled struct { // The reason this quote was marked as canceled. diff --git a/quotepreviewinvoice.go b/quotepreviewinvoice.go index 64e27bc415..4b032ea1d0 100644 --- a/quotepreviewinvoice.go +++ b/quotepreviewinvoice.go @@ -15,6 +15,15 @@ const ( QuotePreviewInvoiceAppliesToTypeSubscriptionSchedule QuotePreviewInvoiceAppliesToType = "subscription_schedule" ) +// Type of the account referenced. +type QuotePreviewInvoiceAutomaticTaxLiabilityType string + +// List of values that QuotePreviewInvoiceAutomaticTaxLiabilityType can take +const ( + QuotePreviewInvoiceAutomaticTaxLiabilityTypeAccount QuotePreviewInvoiceAutomaticTaxLiabilityType = "account" + QuotePreviewInvoiceAutomaticTaxLiabilityTypeSelf QuotePreviewInvoiceAutomaticTaxLiabilityType = "self" +) + // The status of the most recent automated tax calculation for this invoice. type QuotePreviewInvoiceAutomaticTaxStatus string @@ -142,6 +151,15 @@ const ( QuotePreviewInvoiceCustomerTaxIDTypeZAVAT QuotePreviewInvoiceCustomerTaxIDType = "za_vat" ) +// Type of the account referenced. +type QuotePreviewInvoiceIssuerType string + +// List of values that QuotePreviewInvoiceIssuerType can take +const ( + QuotePreviewInvoiceIssuerTypeAccount QuotePreviewInvoiceIssuerType = "account" + QuotePreviewInvoiceIssuerTypeSelf QuotePreviewInvoiceIssuerType = "self" +) + // Transaction type of the mandate. type QuotePreviewInvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType string @@ -352,9 +370,19 @@ type QuotePreviewInvoiceAppliesTo struct { // Describes whether the quote line is affecting a new schedule or an existing schedule. Type QuotePreviewInvoiceAppliesToType `json:"type"` } + +// The connected 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. +type QuotePreviewInvoiceAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuotePreviewInvoiceAutomaticTaxLiabilityType `json:"type"` +} type QuotePreviewInvoiceAutomaticTax struct { // Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. Enabled bool `json:"enabled"` + // The connected 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. + Liability *QuotePreviewInvoiceAutomaticTaxLiability `json:"liability"` // The status of the most recent automated tax calculation for this invoice. Status QuotePreviewInvoiceAutomaticTaxStatus `json:"status"` } @@ -382,6 +410,14 @@ type QuotePreviewInvoiceFromInvoice struct { // The invoice that was cloned. Invoice *Invoice `json:"invoice"` } + +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type QuotePreviewInvoiceIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuotePreviewInvoiceIssuerType `json:"type"` +} type QuotePreviewInvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptions struct { // Transaction type of the mandate. TransactionType QuotePreviewInvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType `json:"transaction_type"` @@ -684,6 +720,8 @@ type QuotePreviewInvoice struct { FromInvoice *QuotePreviewInvoiceFromInvoice `json:"from_invoice"` // Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. ID string `json:"id"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *QuotePreviewInvoiceIssuer `json:"issuer"` // The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. LastFinalizationError *Error `json:"last_finalization_error"` // The ID of the most recent non-draft revision of this invoice diff --git a/quotepreviewschedule.go b/quotepreviewschedule.go index aa36325d0f..08b2c2c7b4 100644 --- a/quotepreviewschedule.go +++ b/quotepreviewschedule.go @@ -24,6 +24,15 @@ const ( QuotePreviewScheduleBillingBehaviorProrateUpFront QuotePreviewScheduleBillingBehavior = "prorate_up_front" ) +// Type of the account referenced. +type QuotePreviewScheduleDefaultSettingsAutomaticTaxLiabilityType string + +// List of values that QuotePreviewScheduleDefaultSettingsAutomaticTaxLiabilityType can take +const ( + QuotePreviewScheduleDefaultSettingsAutomaticTaxLiabilityTypeAccount QuotePreviewScheduleDefaultSettingsAutomaticTaxLiabilityType = "account" + QuotePreviewScheduleDefaultSettingsAutomaticTaxLiabilityTypeSelf QuotePreviewScheduleDefaultSettingsAutomaticTaxLiabilityType = "self" +) + // Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). type QuotePreviewScheduleDefaultSettingsBillingCycleAnchor string @@ -42,6 +51,15 @@ const ( QuotePreviewScheduleDefaultSettingsCollectionMethodSendInvoice QuotePreviewScheduleDefaultSettingsCollectionMethod = "send_invoice" ) +// Type of the account referenced. +type QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuerType string + +// List of values that QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuerType can take +const ( + QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuerTypeAccount QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuerType = "account" + QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuerTypeSelf QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuerType = "self" +) + // Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. type QuotePreviewScheduleEndBehavior string @@ -61,6 +79,15 @@ const ( QuotePreviewSchedulePhaseAddInvoiceItemDiscountDiscountEndTypeTimestamp QuotePreviewSchedulePhaseAddInvoiceItemDiscountDiscountEndType = "timestamp" ) +// Type of the account referenced. +type QuotePreviewSchedulePhaseAutomaticTaxLiabilityType string + +// List of values that QuotePreviewSchedulePhaseAutomaticTaxLiabilityType can take +const ( + QuotePreviewSchedulePhaseAutomaticTaxLiabilityTypeAccount QuotePreviewSchedulePhaseAutomaticTaxLiabilityType = "account" + QuotePreviewSchedulePhaseAutomaticTaxLiabilityTypeSelf QuotePreviewSchedulePhaseAutomaticTaxLiabilityType = "self" +) + // Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). type QuotePreviewSchedulePhaseBillingCycleAnchor string @@ -87,6 +114,15 @@ const ( QuotePreviewSchedulePhaseDiscountDiscountEndTypeTimestamp QuotePreviewSchedulePhaseDiscountDiscountEndType = "timestamp" ) +// Type of the account referenced. +type QuotePreviewSchedulePhaseInvoiceSettingsIssuerType string + +// List of values that QuotePreviewSchedulePhaseInvoiceSettingsIssuerType can take +const ( + QuotePreviewSchedulePhaseInvoiceSettingsIssuerTypeAccount QuotePreviewSchedulePhaseInvoiceSettingsIssuerType = "account" + QuotePreviewSchedulePhaseInvoiceSettingsIssuerTypeSelf QuotePreviewSchedulePhaseInvoiceSettingsIssuerType = "self" +) + // The discount end type. type QuotePreviewSchedulePhaseItemDiscountDiscountEndType string @@ -191,9 +227,19 @@ type QuotePreviewScheduleCurrentPhase struct { // The start of this phase of the subscription schedule. StartDate int64 `json:"start_date"` } + +// The connected 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. +type QuotePreviewScheduleDefaultSettingsAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuotePreviewScheduleDefaultSettingsAutomaticTaxLiabilityType `json:"type"` +} type QuotePreviewScheduleDefaultSettingsAutomaticTax struct { // Whether Stripe automatically computes tax on invoices created during this phase. Enabled bool `json:"enabled"` + // The connected 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. + Liability *QuotePreviewScheduleDefaultSettingsAutomaticTaxLiability `json:"liability"` } // Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period @@ -204,10 +250,20 @@ type QuotePreviewScheduleDefaultSettingsBillingThresholds struct { ResetBillingCycleAnchor bool `json:"reset_billing_cycle_anchor"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuerType `json:"type"` +} + // The subscription schedule's default invoice settings. type QuotePreviewScheduleDefaultSettingsInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *QuotePreviewScheduleDefaultSettingsInvoiceSettingsIssuer `json:"issuer"` } // The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. @@ -268,9 +324,19 @@ type QuotePreviewSchedulePhaseAddInvoiceItem struct { // The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. TaxRates []*TaxRate `json:"tax_rates"` } + +// The connected 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. +type QuotePreviewSchedulePhaseAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuotePreviewSchedulePhaseAutomaticTaxLiabilityType `json:"type"` +} type QuotePreviewSchedulePhaseAutomaticTax struct { // Whether Stripe automatically computes tax on invoices created during this phase. Enabled bool `json:"enabled"` + // The connected 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. + Liability *QuotePreviewSchedulePhaseAutomaticTaxLiability `json:"liability"` } // Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period @@ -299,10 +365,20 @@ type QuotePreviewSchedulePhaseDiscount struct { DiscountEnd *QuotePreviewSchedulePhaseDiscountDiscountEnd `json:"discount_end"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type QuotePreviewSchedulePhaseInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuotePreviewSchedulePhaseInvoiceSettingsIssuerType `json:"type"` +} + // The invoice settings applicable during this phase. type QuotePreviewSchedulePhaseInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *QuotePreviewSchedulePhaseInvoiceSettingsIssuer `json:"issuer"` } // Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period diff --git a/sourcetransaction/client.go b/sourcetransaction/client.go index 3243990f58..7870bb3e70 100644 --- a/sourcetransaction/client.go +++ b/sourcetransaction/client.go @@ -4,7 +4,7 @@ // // -// Package sourcetransaction provides the TODO APIs +// Package sourcetransaction provides the sourcetransaction related APIs package sourcetransaction import ( diff --git a/subscription.go b/subscription.go index 2562eeaa7a..a962aaa430 100644 --- a/subscription.go +++ b/subscription.go @@ -11,6 +11,15 @@ import ( "github.com/stripe/stripe-go/v75/form" ) +// Type of the account referenced. +type SubscriptionAutomaticTaxLiabilityType string + +// List of values that SubscriptionAutomaticTaxLiabilityType can take +const ( + SubscriptionAutomaticTaxLiabilityTypeAccount SubscriptionAutomaticTaxLiabilityType = "account" + SubscriptionAutomaticTaxLiabilityTypeSelf SubscriptionAutomaticTaxLiabilityType = "self" +) + // The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. type SubscriptionCancellationDetailsFeedback string @@ -340,10 +349,20 @@ type SubscriptionAddInvoiceItemParams struct { TaxRates []*string `form:"tax_rates"` } +// 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. +type SubscriptionAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. type SubscriptionAutomaticTaxParams struct { // Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. Enabled *bool `form:"enabled"` + // 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. + Liability *SubscriptionAutomaticTaxLiabilityParams `form:"liability"` } // Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. @@ -382,6 +401,20 @@ type SubscriptionDiscountParams struct { DiscountEnd *SubscriptionDiscountDiscountEndParams `form:"discount_end"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + +// All invoices will be billed using the specified settings. +type SubscriptionInvoiceSettingsParams struct { + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionInvoiceSettingsIssuerParams `form:"issuer"` +} + // A list of up to 20 subscription items, each with an attached price. type SubscriptionItemsParams struct { Params `form:"*"` @@ -614,6 +647,8 @@ type SubscriptionParams struct { Discounts []*SubscriptionDiscountParams `form:"discounts"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` + // All invoices will be billed using the specified settings. + InvoiceSettings *SubscriptionInvoiceSettingsParams `form:"invoice_settings"` // A list of up to 20 subscription items, each with an attached price. Items []*SubscriptionItemsParams `form:"items"` // 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`. @@ -756,9 +791,19 @@ func (p *SubscriptionResumeParams) AddExpand(f string) { type SubscriptionDeleteDiscountParams struct { Params `form:"*"` } + +// The connected 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. +type SubscriptionAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type SubscriptionAutomaticTaxLiabilityType `json:"type"` +} type SubscriptionAutomaticTax struct { // Whether Stripe automatically computes tax on this subscription. Enabled bool `json:"enabled"` + // The connected 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. + Liability *SubscriptionAutomaticTaxLiability `json:"liability"` } // Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period diff --git a/subscriptionschedule.go b/subscriptionschedule.go index 16d5340f91..361fc74745 100644 --- a/subscriptionschedule.go +++ b/subscriptionschedule.go @@ -29,6 +29,15 @@ const ( SubscriptionScheduleDefaultSettingsBillingCycleAnchorPhaseStart SubscriptionScheduleDefaultSettingsBillingCycleAnchor = "phase_start" ) +// Type of the account referenced. +type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType string + +// List of values that SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType can take +const ( + SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerTypeAccount SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType = "account" + SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerTypeSelf SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType = "self" +) + // Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. type SubscriptionScheduleEndBehavior string @@ -65,6 +74,15 @@ const ( SubscriptionSchedulePhaseDiscountDiscountEndTypeTimestamp SubscriptionSchedulePhaseDiscountDiscountEndType = "timestamp" ) +// Type of the account referenced. +type SubscriptionSchedulePhaseInvoiceSettingsIssuerType string + +// List of values that SubscriptionSchedulePhaseInvoiceSettingsIssuerType can take +const ( + SubscriptionSchedulePhaseInvoiceSettingsIssuerTypeAccount SubscriptionSchedulePhaseInvoiceSettingsIssuerType = "account" + SubscriptionSchedulePhaseInvoiceSettingsIssuerTypeSelf SubscriptionSchedulePhaseInvoiceSettingsIssuerType = "self" +) + // The discount end type. type SubscriptionSchedulePhaseItemDiscountDiscountEndType string @@ -172,10 +190,20 @@ func (p *SubscriptionScheduleListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // All invoices will be billed using the specified settings. type SubscriptionScheduleDefaultSettingsInvoiceSettingsParams struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerParams `form:"issuer"` } // Object representing the subscription schedule's default settings. @@ -245,10 +273,20 @@ type SubscriptionSchedulePhaseAddInvoiceItemParams struct { TaxRates []*string `form:"tax_rates"` } +// 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. +type SubscriptionSchedulePhaseAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Automatic tax settings for this phase. type SubscriptionSchedulePhaseAutomaticTaxParams struct { // Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. Enabled *bool `form:"enabled"` + // 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. + Liability *SubscriptionSchedulePhaseAutomaticTaxLiabilityParams `form:"liability"` } // Time span for the redeemed discount. @@ -279,10 +317,20 @@ type SubscriptionSchedulePhaseDiscountParams struct { DiscountEnd *SubscriptionSchedulePhaseDiscountDiscountEndParams `form:"discount_end"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionSchedulePhaseInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // All invoices will be billed using the specified settings. type SubscriptionSchedulePhaseInvoiceSettingsParams struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionSchedulePhaseInvoiceSettingsIssuerParams `form:"issuer"` } // Time span for the redeemed discount. @@ -925,10 +973,20 @@ type SubscriptionScheduleCurrentPhase struct { StartDate int64 `json:"start_date"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType `json:"type"` +} + // The subscription schedule's default invoice settings. type SubscriptionScheduleDefaultSettingsInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer `json:"issuer"` } type SubscriptionScheduleDefaultSettings struct { // 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 during this phase of the schedule. @@ -1000,10 +1058,20 @@ type SubscriptionSchedulePhaseDiscount struct { DiscountEnd *SubscriptionSchedulePhaseDiscountDiscountEnd `json:"discount_end"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionSchedulePhaseInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type SubscriptionSchedulePhaseInvoiceSettingsIssuerType `json:"type"` +} + // The invoice settings applicable during this phase. type SubscriptionSchedulePhaseInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionSchedulePhaseInvoiceSettingsIssuer `json:"issuer"` } // Details to determine how long the discount should be applied for. diff --git a/taxid.go b/taxid.go index 167d64df50..1181c55a5b 100644 --- a/taxid.go +++ b/taxid.go @@ -133,10 +133,10 @@ type TaxIDVerification struct { VerifiedName string `json:"verified_name"` } -// You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers). -// A customer's tax IDs are displayed on invoices and credit notes issued for the customer. +// You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. +// Customer and account tax IDs get displayed on related invoices and credit notes. // -// Related guide: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids) +// Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids) type TaxID struct { APIResource // Two-letter ISO code representing the country of the tax ID.