From ea2313acf56d0922953e3ea61c64a06bd991b8a6 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Fri, 10 Nov 2023 14:09:06 -0800 Subject: [PATCH 01/16] Fix TestDo_RetryOnTimeout flakiness (#1764) --- stripe_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stripe_test.go b/stripe_test.go index d0a151cf80..bac6a5ea33 100644 --- a/stripe_test.go +++ b/stripe_test.go @@ -355,7 +355,7 @@ func TestDo_RetryOnTimeout(t *testing.T) { LeveledLogger: nullLeveledLogger, MaxNetworkRetries: Int64(1), URL: String(testServer.URL), - HTTPClient: &http.Client{Timeout: timeout}, + HTTPClient: &http.Client{Timeout: timeout / 2}, }, ).(*BackendImplementation) From bb00d94ae295e6903e4d0a40c50fcdf31db91856 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:14:02 +0000 Subject: [PATCH 02/16] Update generated code for v656 --- OPENAPI_VERSION | 2 +- accountsession.go | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 341fbefcb5..bd17f87fde 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v655 \ No newline at end of file +v656 \ No newline at end of file diff --git a/accountsession.go b/accountsession.go index cb992c9622..bd7d698d8a 100644 --- a/accountsession.go +++ b/accountsession.go @@ -17,6 +17,28 @@ type AccountSessionComponentsAccountOnboardingParams struct { Features *AccountSessionComponentsAccountOnboardingFeaturesParams `form:"features"` } +// The list of features enabled in the embedded component. +type AccountSessionComponentsIssuingCardFeaturesParams struct{} + +// Configuration for the issuing card component. +type AccountSessionComponentsIssuingCardParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsIssuingCardFeaturesParams `form:"features"` +} + +// The list of features enabled in the embedded component. +type AccountSessionComponentsIssuingCardsListFeaturesParams struct{} + +// Configuration for the issuing cards list component. +type AccountSessionComponentsIssuingCardsListParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsIssuingCardsListFeaturesParams `form:"features"` +} + // The list of features enabled in the embedded component. type AccountSessionComponentsPaymentDetailsFeaturesParams struct { // Whether to allow capturing and cancelling payment intents. This is `true` by default. @@ -68,6 +90,10 @@ type AccountSessionComponentsPayoutsParams struct { type AccountSessionComponentsParams struct { // Configuration for the account onboarding embedded component. AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"` + // Configuration for the issuing card component. + IssuingCard *AccountSessionComponentsIssuingCardParams `form:"issuing_card"` + // Configuration for the issuing cards list component. + IssuingCardsList *AccountSessionComponentsIssuingCardsListParams `form:"issuing_cards_list"` // Configuration for the payment details embedded component. PaymentDetails *AccountSessionComponentsPaymentDetailsParams `form:"payment_details"` // Configuration for the payments embedded component. From b119a97b2f85361b2b714caf798b82759dca351a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 10:19:20 +0000 Subject: [PATCH 03/16] Update generated code for v657 --- OPENAPI_VERSION | 2 +- checkout_session.go | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index bd17f87fde..26c2426487 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v656 \ No newline at end of file +v657 \ No newline at end of file diff --git a/checkout_session.go b/checkout_session.go index ae3d9a7c1d..a2fac1b746 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -560,6 +560,27 @@ const ( CheckoutSessionPaymentMethodOptionsPayNowSetupFutureUsageNone CheckoutSessionPaymentMethodOptionsPayNowSetupFutureUsage = "none" ) +// Controls when the funds will be captured from the customer's account. +type CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod string + +// List of values that CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod can take +const ( + CheckoutSessionPaymentMethodOptionsPaypalCaptureMethodManual CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod = "manual" +) + +// Indicates that you intend to make future payments with this PaymentIntent's payment method. +// +// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +// +// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +type CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage string + +// List of values that CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage can take +const ( + CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsageNone CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage = "none" + CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsageOffSession CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage = "off_session" +) + // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. @@ -2382,6 +2403,22 @@ type CheckoutSessionPaymentMethodOptionsPayNow struct { // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). SetupFutureUsage CheckoutSessionPaymentMethodOptionsPayNowSetupFutureUsage `json:"setup_future_usage"` } +type CheckoutSessionPaymentMethodOptionsPaypal struct { + // Controls when the funds will be captured from the customer's account. + CaptureMethod CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod `json:"capture_method"` + // Preferred locale of the PayPal checkout page that the customer is redirected to. + PreferredLocale string `json:"preferred_locale"` + // A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + Reference string `json:"reference"` + // Indicates that you intend to make future payments with this PaymentIntent's payment method. + // + // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + // + // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + SetupFutureUsage CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage `json:"setup_future_usage"` + // The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + Subsellers []string `json:"subsellers"` +} type CheckoutSessionPaymentMethodOptionsPix struct { // The number of seconds after which Pix payment will expire. ExpiresAfterSeconds int64 `json:"expires_after_seconds"` @@ -2452,6 +2489,7 @@ type CheckoutSessionPaymentMethodOptions struct { OXXO *CheckoutSessionPaymentMethodOptionsOXXO `json:"oxxo"` P24 *CheckoutSessionPaymentMethodOptionsP24 `json:"p24"` PayNow *CheckoutSessionPaymentMethodOptionsPayNow `json:"paynow"` + Paypal *CheckoutSessionPaymentMethodOptionsPaypal `json:"paypal"` Pix *CheckoutSessionPaymentMethodOptionsPix `json:"pix"` RevolutPay *CheckoutSessionPaymentMethodOptionsRevolutPay `json:"revolut_pay"` SEPADebit *CheckoutSessionPaymentMethodOptionsSEPADebit `json:"sepa_debit"` From b299895ed92e0a96232ba9468be9c25851f0b36c Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:13:48 +0000 Subject: [PATCH 04/16] Update generated code for v658 --- OPENAPI_VERSION | 2 +- topup.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 26c2426487..eee8847d6e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v657 \ No newline at end of file +v658 \ No newline at end of file diff --git a/topup.go b/topup.go index 1ef1da73f8..a318994b1f 100644 --- a/topup.go +++ b/topup.go @@ -108,7 +108,7 @@ type Topup struct { Metadata map[string]string `json:"metadata"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // For most Stripe users, the source of every top-up is a bank account. This hash is then the [source object](https://stripe.com/docs/api#source_object) describing that bank account. + // The source field is deprecated. It might not always be present in the API response. Source *PaymentSource `json:"source"` // Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. StatementDescriptor string `json:"statement_descriptor"` From ee3a6f3b04b00dc200d1388633847cfbbc3351ad Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:45:38 +0000 Subject: [PATCH 05/16] Update generated code for v659 --- OPENAPI_VERSION | 2 +- price.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index eee8847d6e..50bdb862e3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v658 \ No newline at end of file +v659 \ No newline at end of file diff --git a/price.go b/price.go index 9041228cde..e5aaddda8a 100644 --- a/price.go +++ b/price.go @@ -131,7 +131,7 @@ type PriceListRecurringParams struct { UsageType *string `form:"usage_type"` } -// Returns a list of your prices. +// Returns a list of your active prices. For the list of inactive prices, set active to false. type PriceListParams struct { ListParams `form:"*"` // Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). From d85ba4a17f81dad25ef985da86819e975d83ed1a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:52:20 +0000 Subject: [PATCH 06/16] Update generated code for v661 --- OPENAPI_VERSION | 2 +- charge.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 50bdb862e3..af292e6247 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v659 \ No newline at end of file +v661 \ No newline at end of file diff --git a/charge.go b/charge.go index 1281f9fa40..3dba188ed9 100644 --- a/charge.go +++ b/charge.go @@ -981,6 +981,8 @@ type ChargePaymentMethodDetailsCard struct { AmountAuthorized int64 `json:"amount_authorized"` // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. Brand PaymentMethodCardBrand `json:"brand"` + // When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. + CaptureBefore int64 `json:"capture_before"` // Check results by Card networks on Card address and CVC at time of payment. Checks *ChargePaymentMethodDetailsCardChecks `json:"checks"` // Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. From 4da00d2329ec52c440e622089c97b67114dcfad5 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:37:22 +0000 Subject: [PATCH 07/16] Update generated code for v662 --- OPENAPI_VERSION | 2 +- client/api.go | 4 + creditnote.go | 42 +++++++++- invoicelineitem.go | 159 ++++++++++++++++++++++++++++++++++++++ invoicelineitem/client.go | 41 ++++++++++ 5 files changed, 244 insertions(+), 4 deletions(-) create mode 100644 invoicelineitem/client.go diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index af292e6247..4d1efaa339 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v661 \ No newline at end of file +v662 \ No newline at end of file diff --git a/client/api.go b/client/api.go index afafaed666..8a7f18aed0 100644 --- a/client/api.go +++ b/client/api.go @@ -53,6 +53,7 @@ import ( identityverificationsession "github.com/stripe/stripe-go/v76/identity/verificationsession" "github.com/stripe/stripe-go/v76/invoice" "github.com/stripe/stripe-go/v76/invoiceitem" + "github.com/stripe/stripe-go/v76/invoicelineitem" "github.com/stripe/stripe-go/v76/invoicepayment" issuingauthorization "github.com/stripe/stripe-go/v76/issuing/authorization" issuingcard "github.com/stripe/stripe-go/v76/issuing/card" @@ -232,6 +233,8 @@ type API struct { IdentityVerificationSessions *identityverificationsession.Client // InvoiceItems is the client used to invoke /invoiceitems APIs. InvoiceItems *invoiceitem.Client + // InvoiceLineItems is the client used to invoke /invoices/{invoice}/lines APIs. + InvoiceLineItems *invoicelineitem.Client // InvoicePayments is the client used to invoke /invoices/{invoice}/payments APIs. InvoicePayments *invoicepayment.Client // Invoices is the client used to invoke /invoices APIs. @@ -467,6 +470,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.IdentityVerificationReports = &identityverificationreport.Client{B: backends.API, Key: key} a.IdentityVerificationSessions = &identityverificationsession.Client{B: backends.API, Key: key} a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key} + a.InvoiceLineItems = &invoicelineitem.Client{B: backends.API, Key: key} a.InvoicePayments = &invoicepayment.Client{B: backends.API, Key: key} a.Invoices = &invoice.Client{B: backends.API, Key: key} a.IssuingAuthorizations = &issuingauthorization.Client{B: backends.API, Key: key} diff --git a/creditnote.go b/creditnote.go index cbdf9b1faa..ead72e4ba0 100644 --- a/creditnote.go +++ b/creditnote.go @@ -81,6 +81,16 @@ const ( CreditNoteTypePrePayment CreditNoteType = "pre_payment" ) +// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. +type CreditNoteLineTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. + TaxRate *string `form:"tax_rate"` +} + // Line items that make up the credit note. type CreditNoteLineParams struct { // The line item amount to credit. Only valid when `type` is `invoice_line_item`. @@ -91,7 +101,9 @@ type CreditNoteLineParams struct { InvoiceLineItem *string `form:"invoice_line_item"` // The line item quantity to credit. Quantity *int64 `form:"quantity"` - // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + // A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + TaxAmounts []*CreditNoteLineTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. TaxRates []*string `form:"tax_rates"` // Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` Type *string `form:"type"` @@ -189,6 +201,16 @@ func (p *CreditNoteListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. +type CreditNotePreviewLineTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. + TaxRate *string `form:"tax_rate"` +} + // Line items that make up the credit note. type CreditNotePreviewLineParams struct { // The line item amount to credit. Only valid when `type` is `invoice_line_item`. @@ -199,7 +221,9 @@ type CreditNotePreviewLineParams struct { InvoiceLineItem *string `form:"invoice_line_item"` // The line item quantity to credit. Quantity *int64 `form:"quantity"` - // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + // A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + TaxAmounts []*CreditNotePreviewLineTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. TaxRates []*string `form:"tax_rates"` // Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` Type *string `form:"type"` @@ -282,6 +306,16 @@ func (p *CreditNoteVoidCreditNoteParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. +type CreditNotePreviewLinesLineTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. + TaxRate *string `form:"tax_rate"` +} + // Line items that make up the credit note. type CreditNotePreviewLinesLineParams struct { // The line item amount to credit. Only valid when `type` is `invoice_line_item`. @@ -292,7 +326,9 @@ type CreditNotePreviewLinesLineParams struct { InvoiceLineItem *string `form:"invoice_line_item"` // The line item quantity to credit. Quantity *int64 `form:"quantity"` - // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + // A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + TaxAmounts []*CreditNotePreviewLinesLineTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. TaxRates []*string `form:"tax_rates"` // Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` Type *string `form:"type"` diff --git a/invoicelineitem.go b/invoicelineitem.go index 14c4c6aa13..5d6c51af9c 100644 --- a/invoicelineitem.go +++ b/invoicelineitem.go @@ -15,6 +15,164 @@ const ( InvoiceLineItemTypeSubscription InvoiceLineItemType = "subscription" ) +// Time span for the redeemed discount. +type InvoiceLineItemDiscountDiscountEndDurationParams struct { + // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + Interval *string `form:"interval"` + // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + IntervalCount *int64 `form:"interval_count"` +} + +// Details to determine how long the discount should be applied for. +type InvoiceLineItemDiscountDiscountEndParams struct { + // Time span for the redeemed discount. + Duration *InvoiceLineItemDiscountDiscountEndDurationParams `form:"duration"` + // A precise Unix timestamp for the discount to end. Must be in the future. + Timestamp *int64 `form:"timestamp"` + // The type of calculation made to determine when the discount ends. + Type *string `form:"type"` +} + +// The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. +type InvoiceLineItemDiscountParams struct { + // ID of the coupon to create a new discount for. + Coupon *string `form:"coupon"` + // ID of an existing discount on the object (or one of its ancestors) to reuse. + Discount *string `form:"discount"` + // Details to determine how long the discount should be applied for. + DiscountEnd *InvoiceLineItemDiscountDiscountEndParams `form:"discount_end"` +} + +// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +type InvoiceLineItemPeriodParams struct { + // The end of the period, which must be greater than or equal to the start. This value is inclusive. + End *int64 `form:"end"` + // The start of the period. This value is inclusive. + Start *int64 `form:"start"` +} + +// Data used to generate a new product object inline. One of `product` or `product_data` is required. +type InvoiceLineItemPriceDataProductDataParams struct { + // The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + Description *string `form:"description"` + // A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + Images []*string `form:"images"` + // 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 product's name, meant to be displayable to the customer. + Name *string `form:"name"` + // A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + TaxCode *string `form:"tax_code"` +} + +// AddMetadata adds a new key-value pair to the Metadata. +func (p *InvoiceLineItemPriceDataProductDataParams) AddMetadata(key string, value string) { + if p.Metadata == nil { + p.Metadata = make(map[string]string) + } + + p.Metadata[key] = value +} + +// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +type InvoiceLineItemPriceDataParams struct { + // 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). + Currency *string `form:"currency"` + // The ID of the product that this price will belong to. One of `product` or `product_data` is required. + Product *string `form:"product"` + // Data used to generate a new product object inline. One of `product` or `product_data` is required. + ProductData *InvoiceLineItemPriceDataProductDataParams `form:"product_data"` + // Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + TaxBehavior *string `form:"tax_behavior"` + // A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + UnitAmount *int64 `form:"unit_amount"` + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` +} + +// Data to find or create a TaxRate object. +// +// Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. +type InvoiceLineItemTaxAmountTaxRateDataParams struct { + // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + Country *string `form:"country"` + // An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + Description *string `form:"description"` + // The display name of the tax rate, which will be shown to users. + DisplayName *string `form:"display_name"` + // This specifies if the tax rate is inclusive or exclusive. + Inclusive *bool `form:"inclusive"` + // The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + Jurisdiction *string `form:"jurisdiction"` + // The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + Percentage *float64 `form:"percentage"` + // [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + State *string `form:"state"` + // The high-level tax type, such as `vat` or `sales_tax`. + TaxType *string `form:"tax_type"` +} + +// A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. +type InvoiceLineItemTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // Data to find or create a TaxRate object. + // + // Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + TaxRateData *InvoiceLineItemTaxAmountTaxRateDataParams `form:"tax_rate_data"` +} + +// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, +// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice +// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. +// Updating an invoice's line item is only possible before the invoice is finalized. +type InvoiceLineItemParams struct { + Params `form:"*"` + Invoice *string `form:"-"` // Included in URL + // The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + Amount *int64 `form:"amount"` + // An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + Description *string `form:"description"` + // Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + Discountable *bool `form:"discountable"` + // The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + Discounts []*InvoiceLineItemDiscountParams `form:"discounts"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. + Margins []*string `form:"margins"` + // 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 period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + Period *InvoiceLineItemPeriodParams `form:"period"` + // The ID of the price object. + Price *string `form:"price"` + // Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + PriceData *InvoiceLineItemPriceDataParams `form:"price_data"` + // Non-negative integer. The quantity of units for the line item. + Quantity *int64 `form:"quantity"` + // A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + TaxAmounts []*InvoiceLineItemTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + TaxRates []*string `form:"tax_rates"` +} + +// AddExpand appends a new field to expand. +func (p *InvoiceLineItemParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// AddMetadata adds a new key-value pair to the Metadata. +func (p *InvoiceLineItemParams) AddMetadata(key string, value string) { + if p.Metadata == nil { + p.Metadata = make(map[string]string) + } + + p.Metadata[key] = value +} + // The amount of discount calculated per discount for this line item. type InvoiceLineItemDiscountAmount struct { // The amount, in cents (or local equivalent), of the discount. @@ -45,6 +203,7 @@ type InvoiceLineItemProrationDetails struct { CreditedItems *InvoiceLineItemProrationDetailsCreditedItems `json:"credited_items"` } type InvoiceLineItem struct { + APIResource // The amount, in cents (or local equivalent). Amount int64 `json:"amount"` // The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. diff --git a/invoicelineitem/client.go b/invoicelineitem/client.go new file mode 100644 index 0000000000..4874ab38e0 --- /dev/null +++ b/invoicelineitem/client.go @@ -0,0 +1,41 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package invoicelineitem provides the /invoices/{invoice}/lines APIs +package invoicelineitem + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v76" +) + +// Client is used to invoke /invoices/{invoice}/lines APIs. +type Client struct { + B stripe.Backend + Key string +} + +// Update updates an invoice line item's properties. +func Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { + return getC().Update(id, params) +} + +// Update updates an invoice line item's properties. +func (c Client) Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { + path := stripe.FormatURLPath( + "/v1/invoices/%s/lines/%s", + stripe.StringValue(params.Invoice), + id, + ) + invoicelineitem := &stripe.InvoiceLineItem{} + err := c.B.Call(http.MethodPost, path, c.Key, params, invoicelineitem) + return invoicelineitem, err +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} From cffafe7c94876ec51b4e73951534a4b61ac91997 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:44:27 +0000 Subject: [PATCH 08/16] Update generated code for v663 --- OPENAPI_VERSION | 2 +- customersession.go | 95 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4d1efaa339..0e45f37f05 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v662 \ No newline at end of file +v663 \ No newline at end of file diff --git a/customersession.go b/customersession.go index 896e11cab7..c42816978d 100644 --- a/customersession.go +++ b/customersession.go @@ -6,9 +6,70 @@ package stripe +// Whether the payment element supports detaching payment methods. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetachAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach = "auto" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetachNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach = "never" +) + +// Whether the payment element supports setting payment methods as the customer's default. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefaultAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault = "auto" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefaultNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault = "never" +) + +// Whether the payment element supports updating payment methods. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdateAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate = "auto" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdateNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate = "never" +) + +// This hash defines whether the payment element supports certain features. +type CustomerSessionComponentsPaymentElementFeaturesParams struct { + // Whether the payment element supports detaching a payment method. + PaymentMethodDetach *string `form:"payment_method_detach"` + // Whether the payment element supports setting a payment method as the customer's default. + PaymentMethodSetAsCustomerDefault *string `form:"payment_method_set_as_customer_default"` + // Whether the payment element supports updating a payment method. + PaymentMethodUpdate *string `form:"payment_method_update"` +} + +// Configuration for the payment element. +type CustomerSessionComponentsPaymentElementParams struct { + // Whether the payment element is enabled. + Enabled *bool `form:"enabled"` + // This hash defines whether the payment element supports certain features. + Features *CustomerSessionComponentsPaymentElementFeaturesParams `form:"features"` +} + +// Configuration for the pricing table. +type CustomerSessionComponentsPricingTableParams struct { + // Whether pricing table is enabled. + Enabled *bool `form:"enabled"` +} + +// Configuration for each component. +type CustomerSessionComponentsParams struct { + // Configuration for the payment element. + PaymentElement *CustomerSessionComponentsPaymentElementParams `form:"payment_element"` + // Configuration for the pricing table. + PricingTable *CustomerSessionComponentsPricingTableParams `form:"pricing_table"` +} + // Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. type CustomerSessionParams struct { Params `form:"*"` + // Configuration for each component. + Components *CustomerSessionComponentsParams `form:"components"` // The ID of an existing customer for which to create the customer session. Customer *string `form:"customer"` // Specifies which fields in the response should be expanded. @@ -20,6 +81,38 @@ func (p *CustomerSessionParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// This hash contains the features the Payment Element supports. +type CustomerSessionComponentsPaymentElementFeatures struct { + // Whether the payment element supports detaching payment methods. + PaymentMethodDetach CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach `json:"payment_method_detach"` + // Whether the payment element supports setting payment methods as the customer's default. + PaymentMethodSetAsCustomerDefault CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault `json:"payment_method_set_as_customer_default"` + // Whether the payment element supports updating payment methods. + PaymentMethodUpdate CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate `json:"payment_method_update"` +} + +// This hash contains whether the payment element is enabled and the features it supports. +type CustomerSessionComponentsPaymentElement struct { + // Whether the payment element is enabled. + Enabled bool `json:"enabled"` + // This hash contains the features the Payment Element supports. + Features *CustomerSessionComponentsPaymentElementFeatures `json:"features"` +} + +// This hash contains whether the pricing table is enabled. +type CustomerSessionComponentsPricingTable struct { + // Whether the pricing table is enabled. + Enabled bool `json:"enabled"` +} + +// Configuration for the components supported by this customer session. +type CustomerSessionComponents struct { + // This hash contains whether the payment element is enabled and the features it supports. + PaymentElement *CustomerSessionComponentsPaymentElement `json:"payment_element"` + // This hash contains whether the pricing table is enabled. + PricingTable *CustomerSessionComponentsPricingTable `json:"pricing_table"` +} + // A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) // control over a customer. type CustomerSession struct { @@ -28,6 +121,8 @@ type CustomerSession struct { // // The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. ClientSecret string `json:"client_secret"` + // Configuration for the components supported by this customer session. + Components *CustomerSessionComponents `json:"components"` // The customer the customer session was created for. Customer *Customer `json:"customer"` // The timestamp at which this customer session will expire. From 47ac4db2cb9826fa6115e3245e396a13535c6244 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:51:24 +0000 Subject: [PATCH 09/16] Update generated code for v665 --- OPENAPI_VERSION | 2 +- customersession.go | 95 ---------------------------------------------- 2 files changed, 1 insertion(+), 96 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0e45f37f05..eb13725219 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v663 \ No newline at end of file +v665 \ No newline at end of file diff --git a/customersession.go b/customersession.go index c42816978d..896e11cab7 100644 --- a/customersession.go +++ b/customersession.go @@ -6,70 +6,9 @@ package stripe -// Whether the payment element supports detaching payment methods. -type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach string - -// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach can take -const ( - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetachAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach = "auto" - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetachNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach = "never" -) - -// Whether the payment element supports setting payment methods as the customer's default. -type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault string - -// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault can take -const ( - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefaultAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault = "auto" - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefaultNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault = "never" -) - -// Whether the payment element supports updating payment methods. -type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate string - -// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate can take -const ( - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdateAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate = "auto" - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdateNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate = "never" -) - -// This hash defines whether the payment element supports certain features. -type CustomerSessionComponentsPaymentElementFeaturesParams struct { - // Whether the payment element supports detaching a payment method. - PaymentMethodDetach *string `form:"payment_method_detach"` - // Whether the payment element supports setting a payment method as the customer's default. - PaymentMethodSetAsCustomerDefault *string `form:"payment_method_set_as_customer_default"` - // Whether the payment element supports updating a payment method. - PaymentMethodUpdate *string `form:"payment_method_update"` -} - -// Configuration for the payment element. -type CustomerSessionComponentsPaymentElementParams struct { - // Whether the payment element is enabled. - Enabled *bool `form:"enabled"` - // This hash defines whether the payment element supports certain features. - Features *CustomerSessionComponentsPaymentElementFeaturesParams `form:"features"` -} - -// Configuration for the pricing table. -type CustomerSessionComponentsPricingTableParams struct { - // Whether pricing table is enabled. - Enabled *bool `form:"enabled"` -} - -// Configuration for each component. -type CustomerSessionComponentsParams struct { - // Configuration for the payment element. - PaymentElement *CustomerSessionComponentsPaymentElementParams `form:"payment_element"` - // Configuration for the pricing table. - PricingTable *CustomerSessionComponentsPricingTableParams `form:"pricing_table"` -} - // Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. type CustomerSessionParams struct { Params `form:"*"` - // Configuration for each component. - Components *CustomerSessionComponentsParams `form:"components"` // The ID of an existing customer for which to create the customer session. Customer *string `form:"customer"` // Specifies which fields in the response should be expanded. @@ -81,38 +20,6 @@ func (p *CustomerSessionParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// This hash contains the features the Payment Element supports. -type CustomerSessionComponentsPaymentElementFeatures struct { - // Whether the payment element supports detaching payment methods. - PaymentMethodDetach CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach `json:"payment_method_detach"` - // Whether the payment element supports setting payment methods as the customer's default. - PaymentMethodSetAsCustomerDefault CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault `json:"payment_method_set_as_customer_default"` - // Whether the payment element supports updating payment methods. - PaymentMethodUpdate CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate `json:"payment_method_update"` -} - -// This hash contains whether the payment element is enabled and the features it supports. -type CustomerSessionComponentsPaymentElement struct { - // Whether the payment element is enabled. - Enabled bool `json:"enabled"` - // This hash contains the features the Payment Element supports. - Features *CustomerSessionComponentsPaymentElementFeatures `json:"features"` -} - -// This hash contains whether the pricing table is enabled. -type CustomerSessionComponentsPricingTable struct { - // Whether the pricing table is enabled. - Enabled bool `json:"enabled"` -} - -// Configuration for the components supported by this customer session. -type CustomerSessionComponents struct { - // This hash contains whether the payment element is enabled and the features it supports. - PaymentElement *CustomerSessionComponentsPaymentElement `json:"payment_element"` - // This hash contains whether the pricing table is enabled. - PricingTable *CustomerSessionComponentsPricingTable `json:"pricing_table"` -} - // A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) // control over a customer. type CustomerSession struct { @@ -121,8 +28,6 @@ type CustomerSession struct { // // The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. ClientSecret string `json:"client_secret"` - // Configuration for the components supported by this customer session. - Components *CustomerSessionComponents `json:"components"` // The customer the customer session was created for. Customer *Customer `json:"customer"` // The timestamp at which this customer session will expire. From 5ff45a671631bd01cb7ee6ef34e54601cd9b3434 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:06:04 +0000 Subject: [PATCH 10/16] Update generated code for v666 --- OPENAPI_VERSION | 2 +- account.go | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index eb13725219..13e06c1ee9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v665 \ No newline at end of file +v666 \ No newline at end of file diff --git a/account.go b/account.go index e2b324ebec..9fa93ef782 100644 --- a/account.go +++ b/account.go @@ -711,6 +711,12 @@ type AccountDocumentsParams struct { ProofOfRegistration *AccountDocumentsProofOfRegistrationParams `form:"proof_of_registration"` } +// Settings specific to Bacs Direct Debit payments. +type AccountSettingsBACSDebitPaymentsParams struct { + // The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + DisplayName *string `form:"display_name"` +} + // Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. type AccountSettingsBrandingParams struct { // (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. @@ -820,12 +826,10 @@ type AccountSettingsTreasuryParams struct { // Details on the account's acceptance of the Stripe Treasury Services Agreement. TOSAcceptance *AccountSettingsTreasuryTOSAcceptanceParams `form:"tos_acceptance"` } -type AccountSettingsBACSDebitPaymentsParams struct { - DisplayName *string `form:"display_name"` -} // Options for customizing how the account functions within Stripe. type AccountSettingsParams struct { + // Settings specific to Bacs Direct Debit payments. BACSDebitPayments *AccountSettingsBACSDebitPaymentsParams `form:"bacs_debit_payments"` // Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. Branding *AccountSettingsBrandingParams `form:"branding"` @@ -1230,8 +1234,10 @@ type AccountRequirements struct { PendingVerification []string `json:"pending_verification"` } type AccountSettingsBACSDebitPayments struct { - // The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this will appear on the mandate, and as the statement descriptor. + // The Bacs Direct Debit display name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. DisplayName string `json:"display_name"` + // The Bacs Direct Debit Service user number for this account. For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. + ServiceUserNumber string `json:"service_user_number"` } type AccountSettingsBranding struct { // (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. From 5d00c4f4c8b9e90a8d03322ebf60b32c3981eed7 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 16:49:42 +0000 Subject: [PATCH 11/16] Update generated code for v667 --- OPENAPI_VERSION | 2 +- customersession.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 13e06c1ee9..4f79f80948 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v666 \ No newline at end of file +v667 \ No newline at end of file diff --git a/customersession.go b/customersession.go index 896e11cab7..3d68a196be 100644 --- a/customersession.go +++ b/customersession.go @@ -28,6 +28,8 @@ type CustomerSession struct { // // The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. ClientSecret string `json:"client_secret"` + // Time at which the object was created. Measured in seconds since the Unix epoch. + Created int64 `json:"created"` // The customer the customer session was created for. Customer *Customer `json:"customer"` // The timestamp at which this customer session will expire. From b4cd6b93e926baf9dea30d9ba564f2c2c5298434 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 10:46:46 -0800 Subject: [PATCH 12/16] Update generated code (#1767) * Update generated code for v657 * Update generated code for v658 * Update generated code for v659 * Update generated code for v660 * Update generated code for v661 * Update generated code for v662 * Update generated code for v666 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- account.go | 14 ++-- charge.go | 2 + checkout_session.go | 36 ++++++++++ client/api.go | 4 ++ creditnote.go | 42 +++++++++++- invoicelineitem.go | 137 ++++++++++++++++++++++++++++++++++++++ invoicelineitem/client.go | 41 ++++++++++++ issuing_transaction.go | 8 +++ price.go | 2 +- topup.go | 2 +- 11 files changed, 280 insertions(+), 10 deletions(-) create mode 100644 invoicelineitem/client.go diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 341fbefcb5..13e06c1ee9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v655 \ No newline at end of file +v666 \ No newline at end of file diff --git a/account.go b/account.go index ec37ccee0a..bf51f047ca 100644 --- a/account.go +++ b/account.go @@ -691,6 +691,12 @@ type AccountDocumentsParams struct { ProofOfRegistration *AccountDocumentsProofOfRegistrationParams `form:"proof_of_registration"` } +// Settings specific to Bacs Direct Debit payments. +type AccountSettingsBACSDebitPaymentsParams struct { + // The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + DisplayName *string `form:"display_name"` +} + // Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. type AccountSettingsBrandingParams struct { // (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. @@ -794,12 +800,10 @@ type AccountSettingsTreasuryParams struct { // Details on the account's acceptance of the Stripe Treasury Services Agreement. TOSAcceptance *AccountSettingsTreasuryTOSAcceptanceParams `form:"tos_acceptance"` } -type AccountSettingsBACSDebitPaymentsParams struct { - DisplayName *string `form:"display_name"` -} // Options for customizing how the account functions within Stripe. type AccountSettingsParams struct { + // Settings specific to Bacs Direct Debit payments. BACSDebitPayments *AccountSettingsBACSDebitPaymentsParams `form:"bacs_debit_payments"` // Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. Branding *AccountSettingsBrandingParams `form:"branding"` @@ -1162,8 +1166,10 @@ type AccountRequirements struct { PendingVerification []string `json:"pending_verification"` } type AccountSettingsBACSDebitPayments struct { - // The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this will appear on the mandate, and as the statement descriptor. + // The Bacs Direct Debit display name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. DisplayName string `json:"display_name"` + // The Bacs Direct Debit Service user number for this account. For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. + ServiceUserNumber string `json:"service_user_number"` } type AccountSettingsBranding struct { // (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. diff --git a/charge.go b/charge.go index b7e434f27e..a1005f7be8 100644 --- a/charge.go +++ b/charge.go @@ -745,6 +745,8 @@ type ChargePaymentMethodDetailsCard struct { AmountAuthorized int64 `json:"amount_authorized"` // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. Brand PaymentMethodCardBrand `json:"brand"` + // When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. + CaptureBefore int64 `json:"capture_before"` // Check results by Card networks on Card address and CVC at time of payment. Checks *ChargePaymentMethodDetailsCardChecks `json:"checks"` // Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. diff --git a/checkout_session.go b/checkout_session.go index bc2f2f0873..c2fb679c63 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -542,6 +542,27 @@ const ( CheckoutSessionPaymentMethodOptionsPayNowSetupFutureUsageNone CheckoutSessionPaymentMethodOptionsPayNowSetupFutureUsage = "none" ) +// Controls when the funds will be captured from the customer's account. +type CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod string + +// List of values that CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod can take +const ( + CheckoutSessionPaymentMethodOptionsPaypalCaptureMethodManual CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod = "manual" +) + +// Indicates that you intend to make future payments with this PaymentIntent's payment method. +// +// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +// +// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +type CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage string + +// List of values that CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage can take +const ( + CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsageNone CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage = "none" + CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsageOffSession CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage = "off_session" +) + // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. @@ -2292,6 +2313,20 @@ type CheckoutSessionPaymentMethodOptionsPayNow struct { // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). SetupFutureUsage CheckoutSessionPaymentMethodOptionsPayNowSetupFutureUsage `json:"setup_future_usage"` } +type CheckoutSessionPaymentMethodOptionsPaypal struct { + // Controls when the funds will be captured from the customer's account. + CaptureMethod CheckoutSessionPaymentMethodOptionsPaypalCaptureMethod `json:"capture_method"` + // Preferred locale of the PayPal checkout page that the customer is redirected to. + PreferredLocale string `json:"preferred_locale"` + // A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + Reference string `json:"reference"` + // Indicates that you intend to make future payments with this PaymentIntent's payment method. + // + // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + // + // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + SetupFutureUsage CheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage `json:"setup_future_usage"` +} type CheckoutSessionPaymentMethodOptionsPix struct { // The number of seconds after which Pix payment will expire. ExpiresAfterSeconds int64 `json:"expires_after_seconds"` @@ -2357,6 +2392,7 @@ type CheckoutSessionPaymentMethodOptions struct { OXXO *CheckoutSessionPaymentMethodOptionsOXXO `json:"oxxo"` P24 *CheckoutSessionPaymentMethodOptionsP24 `json:"p24"` PayNow *CheckoutSessionPaymentMethodOptionsPayNow `json:"paynow"` + Paypal *CheckoutSessionPaymentMethodOptionsPaypal `json:"paypal"` Pix *CheckoutSessionPaymentMethodOptionsPix `json:"pix"` RevolutPay *CheckoutSessionPaymentMethodOptionsRevolutPay `json:"revolut_pay"` SEPADebit *CheckoutSessionPaymentMethodOptionsSEPADebit `json:"sepa_debit"` diff --git a/client/api.go b/client/api.go index 93a2368a75..c94d3e33c6 100644 --- a/client/api.go +++ b/client/api.go @@ -43,6 +43,7 @@ import ( identityverificationsession "github.com/stripe/stripe-go/v76/identity/verificationsession" "github.com/stripe/stripe-go/v76/invoice" "github.com/stripe/stripe-go/v76/invoiceitem" + "github.com/stripe/stripe-go/v76/invoicelineitem" issuingauthorization "github.com/stripe/stripe-go/v76/issuing/authorization" issuingcard "github.com/stripe/stripe-go/v76/issuing/card" issuingcardholder "github.com/stripe/stripe-go/v76/issuing/cardholder" @@ -191,6 +192,8 @@ type API struct { IdentityVerificationSessions *identityverificationsession.Client // InvoiceItems is the client used to invoke /invoiceitems APIs. InvoiceItems *invoiceitem.Client + // InvoiceLineItems is the client used to invoke /invoices/{invoice}/lines APIs. + InvoiceLineItems *invoicelineitem.Client // Invoices is the client used to invoke /invoices APIs. Invoices *invoice.Client // IssuingAuthorizations is the client used to invoke /issuing/authorizations APIs. @@ -394,6 +397,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.IdentityVerificationReports = &identityverificationreport.Client{B: backends.API, Key: key} a.IdentityVerificationSessions = &identityverificationsession.Client{B: backends.API, Key: key} a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key} + a.InvoiceLineItems = &invoicelineitem.Client{B: backends.API, Key: key} a.Invoices = &invoice.Client{B: backends.API, Key: key} a.IssuingAuthorizations = &issuingauthorization.Client{B: backends.API, Key: key} a.IssuingCardholders = &issuingcardholder.Client{B: backends.API, Key: key} diff --git a/creditnote.go b/creditnote.go index 68f9db2dd4..e1a9e96854 100644 --- a/creditnote.go +++ b/creditnote.go @@ -81,6 +81,16 @@ const ( CreditNoteTypePrePayment CreditNoteType = "pre_payment" ) +// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. +type CreditNoteLineTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. + TaxRate *string `form:"tax_rate"` +} + // Line items that make up the credit note. type CreditNoteLineParams struct { // The line item amount to credit. Only valid when `type` is `invoice_line_item`. @@ -91,7 +101,9 @@ type CreditNoteLineParams struct { InvoiceLineItem *string `form:"invoice_line_item"` // The line item quantity to credit. Quantity *int64 `form:"quantity"` - // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + // A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + TaxAmounts []*CreditNoteLineTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. TaxRates []*string `form:"tax_rates"` // Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` Type *string `form:"type"` @@ -179,6 +191,16 @@ func (p *CreditNoteListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. +type CreditNotePreviewLineTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. + TaxRate *string `form:"tax_rate"` +} + // Line items that make up the credit note. type CreditNotePreviewLineParams struct { // The line item amount to credit. Only valid when `type` is `invoice_line_item`. @@ -189,7 +211,9 @@ type CreditNotePreviewLineParams struct { InvoiceLineItem *string `form:"invoice_line_item"` // The line item quantity to credit. Quantity *int64 `form:"quantity"` - // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + // A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + TaxAmounts []*CreditNotePreviewLineTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. TaxRates []*string `form:"tax_rates"` // Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` Type *string `form:"type"` @@ -262,6 +286,16 @@ func (p *CreditNoteVoidCreditNoteParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. +type CreditNotePreviewLinesLineTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. + TaxRate *string `form:"tax_rate"` +} + // Line items that make up the credit note. type CreditNotePreviewLinesLineParams struct { // The line item amount to credit. Only valid when `type` is `invoice_line_item`. @@ -272,7 +306,9 @@ type CreditNotePreviewLinesLineParams struct { InvoiceLineItem *string `form:"invoice_line_item"` // The line item quantity to credit. Quantity *int64 `form:"quantity"` - // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + // A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + TaxAmounts []*CreditNotePreviewLinesLineTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. TaxRates []*string `form:"tax_rates"` // Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` Type *string `form:"type"` diff --git a/invoicelineitem.go b/invoicelineitem.go index d9a9c53fce..fcc879d097 100644 --- a/invoicelineitem.go +++ b/invoicelineitem.go @@ -15,6 +15,142 @@ const ( InvoiceLineItemTypeSubscription InvoiceLineItemType = "subscription" ) +// The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. +type InvoiceLineItemDiscountParams struct { + // ID of the coupon to create a new discount for. + Coupon *string `form:"coupon"` + // ID of an existing discount on the object (or one of its ancestors) to reuse. + Discount *string `form:"discount"` +} + +// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +type InvoiceLineItemPeriodParams struct { + // The end of the period, which must be greater than or equal to the start. This value is inclusive. + End *int64 `form:"end"` + // The start of the period. This value is inclusive. + Start *int64 `form:"start"` +} + +// Data used to generate a new product object inline. One of `product` or `product_data` is required. +type InvoiceLineItemPriceDataProductDataParams struct { + // The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + Description *string `form:"description"` + // A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + Images []*string `form:"images"` + // 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 product's name, meant to be displayable to the customer. + Name *string `form:"name"` + // A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + TaxCode *string `form:"tax_code"` +} + +// AddMetadata adds a new key-value pair to the Metadata. +func (p *InvoiceLineItemPriceDataProductDataParams) AddMetadata(key string, value string) { + if p.Metadata == nil { + p.Metadata = make(map[string]string) + } + + p.Metadata[key] = value +} + +// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +type InvoiceLineItemPriceDataParams struct { + // 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). + Currency *string `form:"currency"` + // The ID of the product that this price will belong to. One of `product` or `product_data` is required. + Product *string `form:"product"` + // Data used to generate a new product object inline. One of `product` or `product_data` is required. + ProductData *InvoiceLineItemPriceDataProductDataParams `form:"product_data"` + // Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + TaxBehavior *string `form:"tax_behavior"` + // A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + UnitAmount *int64 `form:"unit_amount"` + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` +} + +// Data to find or create a TaxRate object. +// +// Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. +type InvoiceLineItemTaxAmountTaxRateDataParams struct { + // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + Country *string `form:"country"` + // An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + Description *string `form:"description"` + // The display name of the tax rate, which will be shown to users. + DisplayName *string `form:"display_name"` + // This specifies if the tax rate is inclusive or exclusive. + Inclusive *bool `form:"inclusive"` + // The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + Jurisdiction *string `form:"jurisdiction"` + // The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + Percentage *float64 `form:"percentage"` + // [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + State *string `form:"state"` + // The high-level tax type, such as `vat` or `sales_tax`. + TaxType *string `form:"tax_type"` +} + +// A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. +type InvoiceLineItemTaxAmountParams struct { + // The amount, in cents (or local equivalent), of the tax. + Amount *int64 `form:"amount"` + // The amount on which tax is calculated, in cents (or local equivalent). + TaxableAmount *int64 `form:"taxable_amount"` + // Data to find or create a TaxRate object. + // + // Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + TaxRateData *InvoiceLineItemTaxAmountTaxRateDataParams `form:"tax_rate_data"` +} + +// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, +// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice +// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. +// Updating an invoice's line item is only possible before the invoice is finalized. +type InvoiceLineItemParams struct { + Params `form:"*"` + Invoice *string `form:"-"` // Included in URL + // The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + Amount *int64 `form:"amount"` + // An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + Description *string `form:"description"` + // Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + Discountable *bool `form:"discountable"` + // The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + Discounts []*InvoiceLineItemDiscountParams `form:"discounts"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // 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 period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + Period *InvoiceLineItemPeriodParams `form:"period"` + // The ID of the price object. + Price *string `form:"price"` + // Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + PriceData *InvoiceLineItemPriceDataParams `form:"price_data"` + // Non-negative integer. The quantity of units for the line item. + Quantity *int64 `form:"quantity"` + // A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + TaxAmounts []*InvoiceLineItemTaxAmountParams `form:"tax_amounts"` + // The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + TaxRates []*string `form:"tax_rates"` +} + +// AddExpand appends a new field to expand. +func (p *InvoiceLineItemParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// AddMetadata adds a new key-value pair to the Metadata. +func (p *InvoiceLineItemParams) AddMetadata(key string, value string) { + if p.Metadata == nil { + p.Metadata = make(map[string]string) + } + + p.Metadata[key] = value +} + // The amount of discount calculated per discount for this line item. type InvoiceLineItemDiscountAmount struct { // The amount, in cents (or local equivalent), of the discount. @@ -37,6 +173,7 @@ type InvoiceLineItemProrationDetails struct { CreditedItems *InvoiceLineItemProrationDetailsCreditedItems `json:"credited_items"` } type InvoiceLineItem struct { + APIResource // The amount, in cents (or local equivalent). Amount int64 `json:"amount"` // The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. diff --git a/invoicelineitem/client.go b/invoicelineitem/client.go new file mode 100644 index 0000000000..4874ab38e0 --- /dev/null +++ b/invoicelineitem/client.go @@ -0,0 +1,41 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package invoicelineitem provides the /invoices/{invoice}/lines APIs +package invoicelineitem + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v76" +) + +// Client is used to invoke /invoices/{invoice}/lines APIs. +type Client struct { + B stripe.Backend + Key string +} + +// Update updates an invoice line item's properties. +func Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { + return getC().Update(id, params) +} + +// Update updates an invoice line item's properties. +func (c Client) Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { + path := stripe.FormatURLPath( + "/v1/invoices/%s/lines/%s", + stripe.StringValue(params.Invoice), + id, + ) + invoicelineitem := &stripe.InvoiceLineItem{} + err := c.B.Call(http.MethodPost, path, c.Key, params, invoicelineitem) + return invoicelineitem, err +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/issuing_transaction.go b/issuing_transaction.go index 85aea4d386..f81ef01e7b 100644 --- a/issuing_transaction.go +++ b/issuing_transaction.go @@ -101,6 +101,12 @@ type IssuingTransactionAmountDetails struct { CashbackAmount int64 `json:"cashback_amount"` } +// Details about the transaction, such as processing dates, set by the card network. +type IssuingTransactionNetworkData struct { + // The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. + ProcessingDate string `json:"processing_date"` +} + // The legs of the trip. type IssuingTransactionPurchaseDetailsFlightSegment struct { // The three-letter IATA airport code of the flight's destination. @@ -221,6 +227,8 @@ type IssuingTransaction struct { MerchantData *IssuingAuthorizationMerchantData `json:"merchant_data"` // 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"` + // Details about the transaction, such as processing dates, set by the card network. + NetworkData *IssuingTransactionNetworkData `json:"network_data"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` // Additional purchase information that is optionally provided by the merchant. diff --git a/price.go b/price.go index 02f6ed7f05..1589fd06ba 100644 --- a/price.go +++ b/price.go @@ -123,7 +123,7 @@ type PriceListRecurringParams struct { UsageType *string `form:"usage_type"` } -// Returns a list of your prices. +// Returns a list of your active prices. For the list of inactive prices, set active to false. type PriceListParams struct { ListParams `form:"*"` // Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). diff --git a/topup.go b/topup.go index 1ef1da73f8..a318994b1f 100644 --- a/topup.go +++ b/topup.go @@ -108,7 +108,7 @@ type Topup struct { Metadata map[string]string `json:"metadata"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // For most Stripe users, the source of every top-up is a bank account. This hash is then the [source object](https://stripe.com/docs/api#source_object) describing that bank account. + // The source field is deprecated. It might not always be present in the API response. Source *PaymentSource `json:"source"` // Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. StatementDescriptor string `json:"statement_descriptor"` From bc1ccbc806d6d135b201cbba91db63bb867facc7 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 19:57:25 +0000 Subject: [PATCH 13/16] Update generated code for v669 --- OPENAPI_VERSION | 2 +- charge.go | 376 ++++++++++++++++++++++++++ paymentintent.go | 686 ++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 1061 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f522f139de..d491c28018 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v668 \ No newline at end of file +v669 \ No newline at end of file diff --git a/charge.go b/charge.go index 3dba188ed9..f65e3b2eb0 100644 --- a/charge.go +++ b/charge.go @@ -429,8 +429,40 @@ type ChargeFraudDetailsParams struct { UserReport *string `form:"user_report"` } +// Affiliate details for this purchase. +type ChargePaymentDetailsCarRentalAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargePaymentDetailsCarRentalDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargePaymentDetailsCarRentalDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargePaymentDetailsCarRentalDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type ChargePaymentDetailsCarRentalDriverParams struct { + // Full name of the person or entity on the car reservation. + Name *string `form:"name"` +} + // Car rental details for this PaymentIntent. type ChargePaymentDetailsCarRentalParams struct { + // Affiliate details for this purchase. + Affiliate *ChargePaymentDetailsCarRentalAffiliateParams `form:"affiliate"` // The booking number associated with the car rental. BookingNumber *string `form:"booking_number"` // Class code of the car. @@ -445,6 +477,10 @@ type ChargePaymentDetailsCarRentalParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // Number of days the car is being rented. DaysRented *int64 `form:"days_rented"` + // Delivery details for this purchase. + Delivery *ChargePaymentDetailsCarRentalDeliveryParams `form:"delivery"` + // The details of the passengers in the travel reservation + Drivers []*ChargePaymentDetailsCarRentalDriverParams `form:"drivers"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates if the customer did not keep nor cancel their booking. @@ -467,6 +503,82 @@ type ChargePaymentDetailsCarRentalParams struct { TaxExempt *bool `form:"tax_exempt"` } +// Affiliate details for this purchase. +type ChargePaymentDetailsEventDetailsAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargePaymentDetailsEventDetailsDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargePaymentDetailsEventDetailsDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargePaymentDetailsEventDetailsDeliveryReceipientParams `form:"receipient"` +} + +// Event details for this PaymentIntent +type ChargePaymentDetailsEventDetailsParams struct { + // Indicates if the tickets are digitally checked when entering the venue. + AccessControlledVenue *bool `form:"access_controlled_venue"` + // The event location's address. + Address *AddressParams `form:"address"` + // Affiliate details for this purchase. + Affiliate *ChargePaymentDetailsEventDetailsAffiliateParams `form:"affiliate"` + // The name of the company + Company *string `form:"company"` + // Delivery details for this purchase. + Delivery *ChargePaymentDetailsEventDetailsDeliveryParams `form:"delivery"` + // Event end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Type of the event entertainment (concert, sports event etc) + Genre *string `form:"genre"` + // The name of the event. + Name *string `form:"name"` + // Event start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + +// Affiliate details for this purchase. +type ChargePaymentDetailsFlightAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargePaymentDetailsFlightDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargePaymentDetailsFlightDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargePaymentDetailsFlightDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation. +type ChargePaymentDetailsFlightPassengerParams struct { + // Full name of the person or entity on the flight reservation. + Name *string `form:"name"` +} + // The individual flight segments associated with the trip. type ChargePaymentDetailsFlightSegmentParams struct { // The International Air Transport Association (IATA) airport code for the arrival airport. @@ -487,24 +599,62 @@ type ChargePaymentDetailsFlightSegmentParams struct { // Flight reservation details for this PaymentIntent type ChargePaymentDetailsFlightParams struct { + // Affiliate details for this purchase. + Affiliate *ChargePaymentDetailsFlightAffiliateParams `form:"affiliate"` // The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. AgencyNumber *string `form:"agency_number"` // The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. Carrier *string `form:"carrier"` + // Delivery details for this purchase. + Delivery *ChargePaymentDetailsFlightDeliveryParams `form:"delivery"` // The name of the person or entity on the reservation. PassengerName *string `form:"passenger_name"` + // The details of the passengers in the travel reservation. + Passengers []*ChargePaymentDetailsFlightPassengerParams `form:"passengers"` // The individual flight segments associated with the trip. Segments []*ChargePaymentDetailsFlightSegmentParams `form:"segments"` // The ticket number associated with the travel reservation. TicketNumber *string `form:"ticket_number"` } +// Affiliate details for this purchase. +type ChargePaymentDetailsLodgingAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargePaymentDetailsLodgingDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargePaymentDetailsLodgingDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargePaymentDetailsLodgingDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type ChargePaymentDetailsLodgingPassengerParams struct { + // Full name of the person or entity on the lodging reservation. + Name *string `form:"name"` +} + // Lodging reservation details for this PaymentIntent type ChargePaymentDetailsLodgingParams struct { // The lodging location's address. Address *AddressParams `form:"address"` // The number of adults on the booking Adults *int64 `form:"adults"` + // Affiliate details for this purchase. + Affiliate *ChargePaymentDetailsLodgingAffiliateParams `form:"affiliate"` // The booking number associated with the lodging reservation. BookingNumber *string `form:"booking_number"` // The lodging category @@ -517,6 +667,8 @@ type ChargePaymentDetailsLodgingParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // The daily lodging room rate. DailyRoomRateAmount *int64 `form:"daily_room_rate_amount"` + // Delivery details for this purchase. + Delivery *ChargePaymentDetailsLodgingDeliveryParams `form:"delivery"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates whether the lodging location is compliant with the Fire Safety Act. @@ -525,6 +677,8 @@ type ChargePaymentDetailsLodgingParams struct { Name *string `form:"name"` // Indicates if the customer did not keep their booking while failing to cancel the reservation. NoShow *bool `form:"no_show"` + // The details of the passengers in the travel reservation + Passengers []*ChargePaymentDetailsLodgingPassengerParams `form:"passengers"` // The phone number of the lodging location. PropertyPhoneNumber *string `form:"property_phone_number"` // The number of room nights @@ -535,18 +689,84 @@ type ChargePaymentDetailsLodgingParams struct { TotalTaxAmount *int64 `form:"total_tax_amount"` } +// Affiliate details for this purchase. +type ChargePaymentDetailsSubscriptionAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Subscription billing details for this purchase. +type ChargePaymentDetailsSubscriptionBillingIntervalParams struct { + // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + Count *int64 `form:"count"` + // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + Interval *string `form:"interval"` +} + +// Subscription details for this PaymentIntent +type ChargePaymentDetailsSubscriptionParams struct { + // Affiliate details for this purchase. + Affiliate *ChargePaymentDetailsSubscriptionAffiliateParams `form:"affiliate"` + // Info whether the subscription will be auto renewed upon expiry. + AutoRenewal *bool `form:"auto_renewal"` + // Subscription billing details for this purchase. + BillingInterval *ChargePaymentDetailsSubscriptionBillingIntervalParams `form:"billing_interval"` + // Subscription end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Name of the product on subscription. e.g. Apple Music Subscription + Name *string `form:"name"` + // Subscription start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + // Provides industry-specific information about the charge. type ChargePaymentDetailsParams struct { // Car rental details for this PaymentIntent. CarRental *ChargePaymentDetailsCarRentalParams `form:"car_rental"` + // Event details for this PaymentIntent + EventDetails *ChargePaymentDetailsEventDetailsParams `form:"event_details"` // Flight reservation details for this PaymentIntent Flight *ChargePaymentDetailsFlightParams `form:"flight"` // Lodging reservation details for this PaymentIntent Lodging *ChargePaymentDetailsLodgingParams `form:"lodging"` + // Subscription details for this PaymentIntent + Subscription *ChargePaymentDetailsSubscriptionParams `form:"subscription"` +} + +// Affiliate details for this purchase. +type ChargeCapturePaymentDetailsCarRentalAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargeCapturePaymentDetailsCarRentalDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargeCapturePaymentDetailsCarRentalDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargeCapturePaymentDetailsCarRentalDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type ChargeCapturePaymentDetailsCarRentalDriverParams struct { + // Full name of the person or entity on the car reservation. + Name *string `form:"name"` } // Car rental details for this PaymentIntent. type ChargeCapturePaymentDetailsCarRentalParams struct { + // Affiliate details for this purchase. + Affiliate *ChargeCapturePaymentDetailsCarRentalAffiliateParams `form:"affiliate"` // The booking number associated with the car rental. BookingNumber *string `form:"booking_number"` // Class code of the car. @@ -561,6 +781,10 @@ type ChargeCapturePaymentDetailsCarRentalParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // Number of days the car is being rented. DaysRented *int64 `form:"days_rented"` + // Delivery details for this purchase. + Delivery *ChargeCapturePaymentDetailsCarRentalDeliveryParams `form:"delivery"` + // The details of the passengers in the travel reservation + Drivers []*ChargeCapturePaymentDetailsCarRentalDriverParams `form:"drivers"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates if the customer did not keep nor cancel their booking. @@ -583,6 +807,82 @@ type ChargeCapturePaymentDetailsCarRentalParams struct { TaxExempt *bool `form:"tax_exempt"` } +// Affiliate details for this purchase. +type ChargeCapturePaymentDetailsEventDetailsAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargeCapturePaymentDetailsEventDetailsDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargeCapturePaymentDetailsEventDetailsDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargeCapturePaymentDetailsEventDetailsDeliveryReceipientParams `form:"receipient"` +} + +// Event details for this PaymentIntent +type ChargeCapturePaymentDetailsEventDetailsParams struct { + // Indicates if the tickets are digitally checked when entering the venue. + AccessControlledVenue *bool `form:"access_controlled_venue"` + // The event location's address. + Address *AddressParams `form:"address"` + // Affiliate details for this purchase. + Affiliate *ChargeCapturePaymentDetailsEventDetailsAffiliateParams `form:"affiliate"` + // The name of the company + Company *string `form:"company"` + // Delivery details for this purchase. + Delivery *ChargeCapturePaymentDetailsEventDetailsDeliveryParams `form:"delivery"` + // Event end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Type of the event entertainment (concert, sports event etc) + Genre *string `form:"genre"` + // The name of the event. + Name *string `form:"name"` + // Event start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + +// Affiliate details for this purchase. +type ChargeCapturePaymentDetailsFlightAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargeCapturePaymentDetailsFlightDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargeCapturePaymentDetailsFlightDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargeCapturePaymentDetailsFlightDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation. +type ChargeCapturePaymentDetailsFlightPassengerParams struct { + // Full name of the person or entity on the flight reservation. + Name *string `form:"name"` +} + // The individual flight segments associated with the trip. type ChargeCapturePaymentDetailsFlightSegmentParams struct { // The International Air Transport Association (IATA) airport code for the arrival airport. @@ -603,24 +903,62 @@ type ChargeCapturePaymentDetailsFlightSegmentParams struct { // Flight reservation details for this PaymentIntent type ChargeCapturePaymentDetailsFlightParams struct { + // Affiliate details for this purchase. + Affiliate *ChargeCapturePaymentDetailsFlightAffiliateParams `form:"affiliate"` // The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. AgencyNumber *string `form:"agency_number"` // The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. Carrier *string `form:"carrier"` + // Delivery details for this purchase. + Delivery *ChargeCapturePaymentDetailsFlightDeliveryParams `form:"delivery"` // The name of the person or entity on the reservation. PassengerName *string `form:"passenger_name"` + // The details of the passengers in the travel reservation. + Passengers []*ChargeCapturePaymentDetailsFlightPassengerParams `form:"passengers"` // The individual flight segments associated with the trip. Segments []*ChargeCapturePaymentDetailsFlightSegmentParams `form:"segments"` // The ticket number associated with the travel reservation. TicketNumber *string `form:"ticket_number"` } +// Affiliate details for this purchase. +type ChargeCapturePaymentDetailsLodgingAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type ChargeCapturePaymentDetailsLodgingDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type ChargeCapturePaymentDetailsLodgingDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *ChargeCapturePaymentDetailsLodgingDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type ChargeCapturePaymentDetailsLodgingPassengerParams struct { + // Full name of the person or entity on the lodging reservation. + Name *string `form:"name"` +} + // Lodging reservation details for this PaymentIntent type ChargeCapturePaymentDetailsLodgingParams struct { // The lodging location's address. Address *AddressParams `form:"address"` // The number of adults on the booking Adults *int64 `form:"adults"` + // Affiliate details for this purchase. + Affiliate *ChargeCapturePaymentDetailsLodgingAffiliateParams `form:"affiliate"` // The booking number associated with the lodging reservation. BookingNumber *string `form:"booking_number"` // The lodging category @@ -633,6 +971,8 @@ type ChargeCapturePaymentDetailsLodgingParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // The daily lodging room rate. DailyRoomRateAmount *int64 `form:"daily_room_rate_amount"` + // Delivery details for this purchase. + Delivery *ChargeCapturePaymentDetailsLodgingDeliveryParams `form:"delivery"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates whether the lodging location is compliant with the Fire Safety Act. @@ -641,6 +981,8 @@ type ChargeCapturePaymentDetailsLodgingParams struct { Name *string `form:"name"` // Indicates if the customer did not keep their booking while failing to cancel the reservation. NoShow *bool `form:"no_show"` + // The details of the passengers in the travel reservation + Passengers []*ChargeCapturePaymentDetailsLodgingPassengerParams `form:"passengers"` // The phone number of the lodging location. PropertyPhoneNumber *string `form:"property_phone_number"` // The number of room nights @@ -651,14 +993,48 @@ type ChargeCapturePaymentDetailsLodgingParams struct { TotalTaxAmount *int64 `form:"total_tax_amount"` } +// Affiliate details for this purchase. +type ChargeCapturePaymentDetailsSubscriptionAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Subscription billing details for this purchase. +type ChargeCapturePaymentDetailsSubscriptionBillingIntervalParams struct { + // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + Count *int64 `form:"count"` + // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + Interval *string `form:"interval"` +} + +// Subscription details for this PaymentIntent +type ChargeCapturePaymentDetailsSubscriptionParams struct { + // Affiliate details for this purchase. + Affiliate *ChargeCapturePaymentDetailsSubscriptionAffiliateParams `form:"affiliate"` + // Info whether the subscription will be auto renewed upon expiry. + AutoRenewal *bool `form:"auto_renewal"` + // Subscription billing details for this purchase. + BillingInterval *ChargeCapturePaymentDetailsSubscriptionBillingIntervalParams `form:"billing_interval"` + // Subscription end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Name of the product on subscription. e.g. Apple Music Subscription + Name *string `form:"name"` + // Subscription start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + // Provides industry-specific information about the charge. type ChargeCapturePaymentDetailsParams struct { // Car rental details for this PaymentIntent. CarRental *ChargeCapturePaymentDetailsCarRentalParams `form:"car_rental"` + // Event details for this PaymentIntent + EventDetails *ChargeCapturePaymentDetailsEventDetailsParams `form:"event_details"` // Flight reservation details for this PaymentIntent Flight *ChargeCapturePaymentDetailsFlightParams `form:"flight"` // Lodging reservation details for this PaymentIntent Lodging *ChargeCapturePaymentDetailsLodgingParams `form:"lodging"` + // Subscription details for this PaymentIntent + Subscription *ChargeCapturePaymentDetailsSubscriptionParams `form:"subscription"` } // An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. diff --git a/paymentintent.go b/paymentintent.go index 95f6608d2a..6d22e5bd8b 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -112,6 +112,17 @@ const ( PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositTypeDescriptorCode PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType = "descriptor_code" ) +// The delivery method for the payment +type PaymentIntentPaymentDetailsCarRentalDeliveryMode string + +// List of values that PaymentIntentPaymentDetailsCarRentalDeliveryMode can take +const ( + PaymentIntentPaymentDetailsCarRentalDeliveryModeEmail PaymentIntentPaymentDetailsCarRentalDeliveryMode = "email" + PaymentIntentPaymentDetailsCarRentalDeliveryModePhone PaymentIntentPaymentDetailsCarRentalDeliveryMode = "phone" + PaymentIntentPaymentDetailsCarRentalDeliveryModePickup PaymentIntentPaymentDetailsCarRentalDeliveryMode = "pickup" + PaymentIntentPaymentDetailsCarRentalDeliveryModePost PaymentIntentPaymentDetailsCarRentalDeliveryMode = "post" +) + // List of additional charges being billed. type PaymentIntentPaymentDetailsCarRentalExtraCharge string @@ -134,6 +145,28 @@ const ( PaymentIntentPaymentDetailsCarRentalRateIntervalWeek PaymentIntentPaymentDetailsCarRentalRateInterval = "week" ) +// The delivery method for the payment +type PaymentIntentPaymentDetailsEventDetailsDeliveryMode string + +// List of values that PaymentIntentPaymentDetailsEventDetailsDeliveryMode can take +const ( + PaymentIntentPaymentDetailsEventDetailsDeliveryModeEmail PaymentIntentPaymentDetailsEventDetailsDeliveryMode = "email" + PaymentIntentPaymentDetailsEventDetailsDeliveryModePhone PaymentIntentPaymentDetailsEventDetailsDeliveryMode = "phone" + PaymentIntentPaymentDetailsEventDetailsDeliveryModePickup PaymentIntentPaymentDetailsEventDetailsDeliveryMode = "pickup" + PaymentIntentPaymentDetailsEventDetailsDeliveryModePost PaymentIntentPaymentDetailsEventDetailsDeliveryMode = "post" +) + +// Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. +type PaymentIntentPaymentDetailsSubscriptionBillingIntervalInterval string + +// List of values that PaymentIntentPaymentDetailsSubscriptionBillingIntervalInterval can take +const ( + PaymentIntentPaymentDetailsSubscriptionBillingIntervalIntervalDay PaymentIntentPaymentDetailsSubscriptionBillingIntervalInterval = "day" + PaymentIntentPaymentDetailsSubscriptionBillingIntervalIntervalMonth PaymentIntentPaymentDetailsSubscriptionBillingIntervalInterval = "month" + PaymentIntentPaymentDetailsSubscriptionBillingIntervalIntervalWeek PaymentIntentPaymentDetailsSubscriptionBillingIntervalInterval = "week" + PaymentIntentPaymentDetailsSubscriptionBillingIntervalIntervalYear PaymentIntentPaymentDetailsSubscriptionBillingIntervalInterval = "year" +) + // Payment schedule for the mandate. type PaymentIntentPaymentMethodOptionsACSSDebitMandateOptionsPaymentSchedule string @@ -907,8 +940,40 @@ type PaymentIntentMandateDataParams struct { CustomerAcceptance *PaymentIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"` } +// Affiliate details for this purchase. +type PaymentIntentPaymentDetailsCarRentalAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentPaymentDetailsCarRentalDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentPaymentDetailsCarRentalDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentPaymentDetailsCarRentalDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type PaymentIntentPaymentDetailsCarRentalDriverParams struct { + // Full name of the person or entity on the car reservation. + Name *string `form:"name"` +} + // Car rental details for this PaymentIntent. type PaymentIntentPaymentDetailsCarRentalParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentPaymentDetailsCarRentalAffiliateParams `form:"affiliate"` // The booking number associated with the car rental. BookingNumber *string `form:"booking_number"` // Class code of the car. @@ -923,6 +988,10 @@ type PaymentIntentPaymentDetailsCarRentalParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // Number of days the car is being rented. DaysRented *int64 `form:"days_rented"` + // Delivery details for this purchase. + Delivery *PaymentIntentPaymentDetailsCarRentalDeliveryParams `form:"delivery"` + // The details of the passengers in the travel reservation + Drivers []*PaymentIntentPaymentDetailsCarRentalDriverParams `form:"drivers"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates if the customer did not keep nor cancel their booking. @@ -945,6 +1014,82 @@ type PaymentIntentPaymentDetailsCarRentalParams struct { TaxExempt *bool `form:"tax_exempt"` } +// Affiliate details for this purchase. +type PaymentIntentPaymentDetailsEventDetailsAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentPaymentDetailsEventDetailsDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentPaymentDetailsEventDetailsDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentPaymentDetailsEventDetailsDeliveryReceipientParams `form:"receipient"` +} + +// Event details for this PaymentIntent +type PaymentIntentPaymentDetailsEventDetailsParams struct { + // Indicates if the tickets are digitally checked when entering the venue. + AccessControlledVenue *bool `form:"access_controlled_venue"` + // The event location's address. + Address *AddressParams `form:"address"` + // Affiliate details for this purchase. + Affiliate *PaymentIntentPaymentDetailsEventDetailsAffiliateParams `form:"affiliate"` + // The name of the company + Company *string `form:"company"` + // Delivery details for this purchase. + Delivery *PaymentIntentPaymentDetailsEventDetailsDeliveryParams `form:"delivery"` + // Event end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Type of the event entertainment (concert, sports event etc) + Genre *string `form:"genre"` + // The name of the event. + Name *string `form:"name"` + // Event start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + +// Affiliate details for this purchase. +type PaymentIntentPaymentDetailsFlightAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentPaymentDetailsFlightDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentPaymentDetailsFlightDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentPaymentDetailsFlightDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation. +type PaymentIntentPaymentDetailsFlightPassengerParams struct { + // Full name of the person or entity on the flight reservation. + Name *string `form:"name"` +} + // The individual flight segments associated with the trip. type PaymentIntentPaymentDetailsFlightSegmentParams struct { // The International Air Transport Association (IATA) airport code for the arrival airport. @@ -965,24 +1110,62 @@ type PaymentIntentPaymentDetailsFlightSegmentParams struct { // Flight reservation details for this PaymentIntent type PaymentIntentPaymentDetailsFlightParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentPaymentDetailsFlightAffiliateParams `form:"affiliate"` // The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. AgencyNumber *string `form:"agency_number"` // The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. Carrier *string `form:"carrier"` + // Delivery details for this purchase. + Delivery *PaymentIntentPaymentDetailsFlightDeliveryParams `form:"delivery"` // The name of the person or entity on the reservation. PassengerName *string `form:"passenger_name"` + // The details of the passengers in the travel reservation. + Passengers []*PaymentIntentPaymentDetailsFlightPassengerParams `form:"passengers"` // The individual flight segments associated with the trip. Segments []*PaymentIntentPaymentDetailsFlightSegmentParams `form:"segments"` // The ticket number associated with the travel reservation. TicketNumber *string `form:"ticket_number"` } +// Affiliate details for this purchase. +type PaymentIntentPaymentDetailsLodgingAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentPaymentDetailsLodgingDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentPaymentDetailsLodgingDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentPaymentDetailsLodgingDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type PaymentIntentPaymentDetailsLodgingPassengerParams struct { + // Full name of the person or entity on the lodging reservation. + Name *string `form:"name"` +} + // Lodging reservation details for this PaymentIntent type PaymentIntentPaymentDetailsLodgingParams struct { // The lodging location's address. Address *AddressParams `form:"address"` // The number of adults on the booking Adults *int64 `form:"adults"` + // Affiliate details for this purchase. + Affiliate *PaymentIntentPaymentDetailsLodgingAffiliateParams `form:"affiliate"` // The booking number associated with the lodging reservation. BookingNumber *string `form:"booking_number"` // The lodging category @@ -995,6 +1178,8 @@ type PaymentIntentPaymentDetailsLodgingParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // The daily lodging room rate. DailyRoomRateAmount *int64 `form:"daily_room_rate_amount"` + // Delivery details for this purchase. + Delivery *PaymentIntentPaymentDetailsLodgingDeliveryParams `form:"delivery"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates whether the lodging location is compliant with the Fire Safety Act. @@ -1003,6 +1188,8 @@ type PaymentIntentPaymentDetailsLodgingParams struct { Name *string `form:"name"` // Indicates if the customer did not keep their booking while failing to cancel the reservation. NoShow *bool `form:"no_show"` + // The details of the passengers in the travel reservation + Passengers []*PaymentIntentPaymentDetailsLodgingPassengerParams `form:"passengers"` // The phone number of the lodging location. PropertyPhoneNumber *string `form:"property_phone_number"` // The number of room nights @@ -1013,14 +1200,48 @@ type PaymentIntentPaymentDetailsLodgingParams struct { TotalTaxAmount *int64 `form:"total_tax_amount"` } +// Affiliate details for this purchase. +type PaymentIntentPaymentDetailsSubscriptionAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Subscription billing details for this purchase. +type PaymentIntentPaymentDetailsSubscriptionBillingIntervalParams struct { + // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + Count *int64 `form:"count"` + // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + Interval *string `form:"interval"` +} + +// Subscription details for this PaymentIntent +type PaymentIntentPaymentDetailsSubscriptionParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentPaymentDetailsSubscriptionAffiliateParams `form:"affiliate"` + // Info whether the subscription will be auto renewed upon expiry. + AutoRenewal *bool `form:"auto_renewal"` + // Subscription billing details for this purchase. + BillingInterval *PaymentIntentPaymentDetailsSubscriptionBillingIntervalParams `form:"billing_interval"` + // Subscription end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Name of the product on subscription. e.g. Apple Music Subscription + Name *string `form:"name"` + // Subscription start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + // Provides industry-specific information about the charge. type PaymentIntentPaymentDetailsParams struct { // Car rental details for this PaymentIntent. CarRental *PaymentIntentPaymentDetailsCarRentalParams `form:"car_rental"` + // Event details for this PaymentIntent + EventDetails *PaymentIntentPaymentDetailsEventDetailsParams `form:"event_details"` // Flight reservation details for this PaymentIntent Flight *PaymentIntentPaymentDetailsFlightParams `form:"flight"` // Lodging reservation details for this PaymentIntent Lodging *PaymentIntentPaymentDetailsLodgingParams `form:"lodging"` + // Subscription details for this PaymentIntent + Subscription *PaymentIntentPaymentDetailsSubscriptionParams `form:"subscription"` } // If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. @@ -2040,8 +2261,40 @@ func (p *PaymentIntentListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// Affiliate details for this purchase. +type PaymentIntentConfirmPaymentDetailsCarRentalAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentConfirmPaymentDetailsCarRentalDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentConfirmPaymentDetailsCarRentalDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentConfirmPaymentDetailsCarRentalDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type PaymentIntentConfirmPaymentDetailsCarRentalDriverParams struct { + // Full name of the person or entity on the car reservation. + Name *string `form:"name"` +} + // Car rental details for this PaymentIntent. type PaymentIntentConfirmPaymentDetailsCarRentalParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentConfirmPaymentDetailsCarRentalAffiliateParams `form:"affiliate"` // The booking number associated with the car rental. BookingNumber *string `form:"booking_number"` // Class code of the car. @@ -2056,6 +2309,10 @@ type PaymentIntentConfirmPaymentDetailsCarRentalParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // Number of days the car is being rented. DaysRented *int64 `form:"days_rented"` + // Delivery details for this purchase. + Delivery *PaymentIntentConfirmPaymentDetailsCarRentalDeliveryParams `form:"delivery"` + // The details of the passengers in the travel reservation + Drivers []*PaymentIntentConfirmPaymentDetailsCarRentalDriverParams `form:"drivers"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates if the customer did not keep nor cancel their booking. @@ -2078,6 +2335,82 @@ type PaymentIntentConfirmPaymentDetailsCarRentalParams struct { TaxExempt *bool `form:"tax_exempt"` } +// Affiliate details for this purchase. +type PaymentIntentConfirmPaymentDetailsEventDetailsAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentConfirmPaymentDetailsEventDetailsDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentConfirmPaymentDetailsEventDetailsDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentConfirmPaymentDetailsEventDetailsDeliveryReceipientParams `form:"receipient"` +} + +// Event details for this PaymentIntent +type PaymentIntentConfirmPaymentDetailsEventDetailsParams struct { + // Indicates if the tickets are digitally checked when entering the venue. + AccessControlledVenue *bool `form:"access_controlled_venue"` + // The event location's address. + Address *AddressParams `form:"address"` + // Affiliate details for this purchase. + Affiliate *PaymentIntentConfirmPaymentDetailsEventDetailsAffiliateParams `form:"affiliate"` + // The name of the company + Company *string `form:"company"` + // Delivery details for this purchase. + Delivery *PaymentIntentConfirmPaymentDetailsEventDetailsDeliveryParams `form:"delivery"` + // Event end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Type of the event entertainment (concert, sports event etc) + Genre *string `form:"genre"` + // The name of the event. + Name *string `form:"name"` + // Event start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + +// Affiliate details for this purchase. +type PaymentIntentConfirmPaymentDetailsFlightAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentConfirmPaymentDetailsFlightDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentConfirmPaymentDetailsFlightDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentConfirmPaymentDetailsFlightDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation. +type PaymentIntentConfirmPaymentDetailsFlightPassengerParams struct { + // Full name of the person or entity on the flight reservation. + Name *string `form:"name"` +} + // The individual flight segments associated with the trip. type PaymentIntentConfirmPaymentDetailsFlightSegmentParams struct { // The International Air Transport Association (IATA) airport code for the arrival airport. @@ -2098,24 +2431,62 @@ type PaymentIntentConfirmPaymentDetailsFlightSegmentParams struct { // Flight reservation details for this PaymentIntent type PaymentIntentConfirmPaymentDetailsFlightParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentConfirmPaymentDetailsFlightAffiliateParams `form:"affiliate"` // The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. AgencyNumber *string `form:"agency_number"` // The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. Carrier *string `form:"carrier"` + // Delivery details for this purchase. + Delivery *PaymentIntentConfirmPaymentDetailsFlightDeliveryParams `form:"delivery"` // The name of the person or entity on the reservation. PassengerName *string `form:"passenger_name"` + // The details of the passengers in the travel reservation. + Passengers []*PaymentIntentConfirmPaymentDetailsFlightPassengerParams `form:"passengers"` // The individual flight segments associated with the trip. Segments []*PaymentIntentConfirmPaymentDetailsFlightSegmentParams `form:"segments"` // The ticket number associated with the travel reservation. TicketNumber *string `form:"ticket_number"` } +// Affiliate details for this purchase. +type PaymentIntentConfirmPaymentDetailsLodgingAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentConfirmPaymentDetailsLodgingDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentConfirmPaymentDetailsLodgingDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentConfirmPaymentDetailsLodgingDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type PaymentIntentConfirmPaymentDetailsLodgingPassengerParams struct { + // Full name of the person or entity on the lodging reservation. + Name *string `form:"name"` +} + // Lodging reservation details for this PaymentIntent type PaymentIntentConfirmPaymentDetailsLodgingParams struct { // The lodging location's address. Address *AddressParams `form:"address"` // The number of adults on the booking Adults *int64 `form:"adults"` + // Affiliate details for this purchase. + Affiliate *PaymentIntentConfirmPaymentDetailsLodgingAffiliateParams `form:"affiliate"` // The booking number associated with the lodging reservation. BookingNumber *string `form:"booking_number"` // The lodging category @@ -2128,6 +2499,8 @@ type PaymentIntentConfirmPaymentDetailsLodgingParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // The daily lodging room rate. DailyRoomRateAmount *int64 `form:"daily_room_rate_amount"` + // Delivery details for this purchase. + Delivery *PaymentIntentConfirmPaymentDetailsLodgingDeliveryParams `form:"delivery"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates whether the lodging location is compliant with the Fire Safety Act. @@ -2136,6 +2509,8 @@ type PaymentIntentConfirmPaymentDetailsLodgingParams struct { Name *string `form:"name"` // Indicates if the customer did not keep their booking while failing to cancel the reservation. NoShow *bool `form:"no_show"` + // The details of the passengers in the travel reservation + Passengers []*PaymentIntentConfirmPaymentDetailsLodgingPassengerParams `form:"passengers"` // The phone number of the lodging location. PropertyPhoneNumber *string `form:"property_phone_number"` // The number of room nights @@ -2146,14 +2521,48 @@ type PaymentIntentConfirmPaymentDetailsLodgingParams struct { TotalTaxAmount *int64 `form:"total_tax_amount"` } +// Affiliate details for this purchase. +type PaymentIntentConfirmPaymentDetailsSubscriptionAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Subscription billing details for this purchase. +type PaymentIntentConfirmPaymentDetailsSubscriptionBillingIntervalParams struct { + // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + Count *int64 `form:"count"` + // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + Interval *string `form:"interval"` +} + +// Subscription details for this PaymentIntent +type PaymentIntentConfirmPaymentDetailsSubscriptionParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentConfirmPaymentDetailsSubscriptionAffiliateParams `form:"affiliate"` + // Info whether the subscription will be auto renewed upon expiry. + AutoRenewal *bool `form:"auto_renewal"` + // Subscription billing details for this purchase. + BillingInterval *PaymentIntentConfirmPaymentDetailsSubscriptionBillingIntervalParams `form:"billing_interval"` + // Subscription end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Name of the product on subscription. e.g. Apple Music Subscription + Name *string `form:"name"` + // Subscription start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + // Provides industry-specific information about the charge. type PaymentIntentConfirmPaymentDetailsParams struct { // Car rental details for this PaymentIntent. CarRental *PaymentIntentConfirmPaymentDetailsCarRentalParams `form:"car_rental"` + // Event details for this PaymentIntent + EventDetails *PaymentIntentConfirmPaymentDetailsEventDetailsParams `form:"event_details"` // Flight reservation details for this PaymentIntent Flight *PaymentIntentConfirmPaymentDetailsFlightParams `form:"flight"` // Lodging reservation details for this PaymentIntent Lodging *PaymentIntentConfirmPaymentDetailsLodgingParams `form:"lodging"` + // Subscription details for this PaymentIntent + Subscription *PaymentIntentConfirmPaymentDetailsSubscriptionParams `form:"subscription"` } // Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). @@ -2259,8 +2668,40 @@ func (p *PaymentIntentCancelParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// Affiliate details for this purchase. +type PaymentIntentCapturePaymentDetailsCarRentalAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentCapturePaymentDetailsCarRentalDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentCapturePaymentDetailsCarRentalDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentCapturePaymentDetailsCarRentalDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type PaymentIntentCapturePaymentDetailsCarRentalDriverParams struct { + // Full name of the person or entity on the car reservation. + Name *string `form:"name"` +} + // Car rental details for this PaymentIntent. type PaymentIntentCapturePaymentDetailsCarRentalParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentCapturePaymentDetailsCarRentalAffiliateParams `form:"affiliate"` // The booking number associated with the car rental. BookingNumber *string `form:"booking_number"` // Class code of the car. @@ -2275,6 +2716,10 @@ type PaymentIntentCapturePaymentDetailsCarRentalParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // Number of days the car is being rented. DaysRented *int64 `form:"days_rented"` + // Delivery details for this purchase. + Delivery *PaymentIntentCapturePaymentDetailsCarRentalDeliveryParams `form:"delivery"` + // The details of the passengers in the travel reservation + Drivers []*PaymentIntentCapturePaymentDetailsCarRentalDriverParams `form:"drivers"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates if the customer did not keep nor cancel their booking. @@ -2297,6 +2742,82 @@ type PaymentIntentCapturePaymentDetailsCarRentalParams struct { TaxExempt *bool `form:"tax_exempt"` } +// Affiliate details for this purchase. +type PaymentIntentCapturePaymentDetailsEventDetailsAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentCapturePaymentDetailsEventDetailsDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentCapturePaymentDetailsEventDetailsDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentCapturePaymentDetailsEventDetailsDeliveryReceipientParams `form:"receipient"` +} + +// Event details for this PaymentIntent +type PaymentIntentCapturePaymentDetailsEventDetailsParams struct { + // Indicates if the tickets are digitally checked when entering the venue. + AccessControlledVenue *bool `form:"access_controlled_venue"` + // The event location's address. + Address *AddressParams `form:"address"` + // Affiliate details for this purchase. + Affiliate *PaymentIntentCapturePaymentDetailsEventDetailsAffiliateParams `form:"affiliate"` + // The name of the company + Company *string `form:"company"` + // Delivery details for this purchase. + Delivery *PaymentIntentCapturePaymentDetailsEventDetailsDeliveryParams `form:"delivery"` + // Event end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Type of the event entertainment (concert, sports event etc) + Genre *string `form:"genre"` + // The name of the event. + Name *string `form:"name"` + // Event start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + +// Affiliate details for this purchase. +type PaymentIntentCapturePaymentDetailsFlightAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentCapturePaymentDetailsFlightDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentCapturePaymentDetailsFlightDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentCapturePaymentDetailsFlightDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation. +type PaymentIntentCapturePaymentDetailsFlightPassengerParams struct { + // Full name of the person or entity on the flight reservation. + Name *string `form:"name"` +} + // The individual flight segments associated with the trip. type PaymentIntentCapturePaymentDetailsFlightSegmentParams struct { // The International Air Transport Association (IATA) airport code for the arrival airport. @@ -2317,24 +2838,62 @@ type PaymentIntentCapturePaymentDetailsFlightSegmentParams struct { // Flight reservation details for this PaymentIntent type PaymentIntentCapturePaymentDetailsFlightParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentCapturePaymentDetailsFlightAffiliateParams `form:"affiliate"` // The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. AgencyNumber *string `form:"agency_number"` // The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. Carrier *string `form:"carrier"` + // Delivery details for this purchase. + Delivery *PaymentIntentCapturePaymentDetailsFlightDeliveryParams `form:"delivery"` // The name of the person or entity on the reservation. PassengerName *string `form:"passenger_name"` + // The details of the passengers in the travel reservation. + Passengers []*PaymentIntentCapturePaymentDetailsFlightPassengerParams `form:"passengers"` // The individual flight segments associated with the trip. Segments []*PaymentIntentCapturePaymentDetailsFlightSegmentParams `form:"segments"` // The ticket number associated with the travel reservation. TicketNumber *string `form:"ticket_number"` } +// Affiliate details for this purchase. +type PaymentIntentCapturePaymentDetailsLodgingAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Details of the recipient. +type PaymentIntentCapturePaymentDetailsLodgingDeliveryReceipientParams struct { + // The email of the recipient the ticket is delivered to. + Email *string `form:"email"` + // The name of the recipient the ticket is delivered to. + Name *string `form:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone *string `form:"phone"` +} + +// Delivery details for this purchase. +type PaymentIntentCapturePaymentDetailsLodgingDeliveryParams struct { + // The delivery method for the payment + Mode *string `form:"mode"` + // Details of the recipient. + Receipient *PaymentIntentCapturePaymentDetailsLodgingDeliveryReceipientParams `form:"receipient"` +} + +// The details of the passengers in the travel reservation +type PaymentIntentCapturePaymentDetailsLodgingPassengerParams struct { + // Full name of the person or entity on the lodging reservation. + Name *string `form:"name"` +} + // Lodging reservation details for this PaymentIntent type PaymentIntentCapturePaymentDetailsLodgingParams struct { // The lodging location's address. Address *AddressParams `form:"address"` // The number of adults on the booking Adults *int64 `form:"adults"` + // Affiliate details for this purchase. + Affiliate *PaymentIntentCapturePaymentDetailsLodgingAffiliateParams `form:"affiliate"` // The booking number associated with the lodging reservation. BookingNumber *string `form:"booking_number"` // The lodging category @@ -2347,6 +2906,8 @@ type PaymentIntentCapturePaymentDetailsLodgingParams struct { CustomerServicePhoneNumber *string `form:"customer_service_phone_number"` // The daily lodging room rate. DailyRoomRateAmount *int64 `form:"daily_room_rate_amount"` + // Delivery details for this purchase. + Delivery *PaymentIntentCapturePaymentDetailsLodgingDeliveryParams `form:"delivery"` // List of additional charges being billed. ExtraCharges []*string `form:"extra_charges"` // Indicates whether the lodging location is compliant with the Fire Safety Act. @@ -2355,6 +2916,8 @@ type PaymentIntentCapturePaymentDetailsLodgingParams struct { Name *string `form:"name"` // Indicates if the customer did not keep their booking while failing to cancel the reservation. NoShow *bool `form:"no_show"` + // The details of the passengers in the travel reservation + Passengers []*PaymentIntentCapturePaymentDetailsLodgingPassengerParams `form:"passengers"` // The phone number of the lodging location. PropertyPhoneNumber *string `form:"property_phone_number"` // The number of room nights @@ -2365,14 +2928,48 @@ type PaymentIntentCapturePaymentDetailsLodgingParams struct { TotalTaxAmount *int64 `form:"total_tax_amount"` } +// Affiliate details for this purchase. +type PaymentIntentCapturePaymentDetailsSubscriptionAffiliateParams struct { + // The name of the affiliate that originated the purchase. + Name *string `form:"name"` +} + +// Subscription billing details for this purchase. +type PaymentIntentCapturePaymentDetailsSubscriptionBillingIntervalParams struct { + // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + Count *int64 `form:"count"` + // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + Interval *string `form:"interval"` +} + +// Subscription details for this PaymentIntent +type PaymentIntentCapturePaymentDetailsSubscriptionParams struct { + // Affiliate details for this purchase. + Affiliate *PaymentIntentCapturePaymentDetailsSubscriptionAffiliateParams `form:"affiliate"` + // Info whether the subscription will be auto renewed upon expiry. + AutoRenewal *bool `form:"auto_renewal"` + // Subscription billing details for this purchase. + BillingInterval *PaymentIntentCapturePaymentDetailsSubscriptionBillingIntervalParams `form:"billing_interval"` + // Subscription end time. Measured in seconds since the Unix epoch. + EndsAt *int64 `form:"ends_at"` + // Name of the product on subscription. e.g. Apple Music Subscription + Name *string `form:"name"` + // Subscription start time. Measured in seconds since the Unix epoch. + StartsAt *int64 `form:"starts_at"` +} + // Provides industry-specific information about the charge. type PaymentIntentCapturePaymentDetailsParams struct { // Car rental details for this PaymentIntent. CarRental *PaymentIntentCapturePaymentDetailsCarRentalParams `form:"car_rental"` + // Event details for this PaymentIntent + EventDetails *PaymentIntentCapturePaymentDetailsEventDetailsParams `form:"event_details"` // Flight reservation details for this PaymentIntent Flight *PaymentIntentCapturePaymentDetailsFlightParams `form:"flight"` // Lodging reservation details for this PaymentIntent Lodging *PaymentIntentCapturePaymentDetailsLodgingParams `form:"lodging"` + // Subscription details for this PaymentIntent + Subscription *PaymentIntentCapturePaymentDetailsSubscriptionParams `form:"subscription"` } // Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -2842,7 +3439,31 @@ type PaymentIntentNextAction struct { WeChatPayRedirectToAndroidApp *PaymentIntentNextActionWeChatPayRedirectToAndroidApp `json:"wechat_pay_redirect_to_android_app"` WeChatPayRedirectToIOSApp *PaymentIntentNextActionWeChatPayRedirectToIOSApp `json:"wechat_pay_redirect_to_ios_app"` } +type PaymentIntentPaymentDetailsCarRentalAffiliate struct { + // The name of the affiliate that originated the purchase. + Name string `json:"name"` +} +type PaymentIntentPaymentDetailsCarRentalDeliveryReceipient struct { + // The email of the recipient the ticket is delivered to. + Email string `json:"email"` + // The name of the recipient the ticket is delivered to. + Name string `json:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone string `json:"phone"` +} +type PaymentIntentPaymentDetailsCarRentalDelivery struct { + // The delivery method for the payment + Mode PaymentIntentPaymentDetailsCarRentalDeliveryMode `json:"mode"` + Receipient *PaymentIntentPaymentDetailsCarRentalDeliveryReceipient `json:"receipient"` +} + +// The details of the drivers associated with the trip. +type PaymentIntentPaymentDetailsCarRentalDriver struct { + // Full name of the driver on the reservation. + Name string `json:"name"` +} type PaymentIntentPaymentDetailsCarRental struct { + Affiliate *PaymentIntentPaymentDetailsCarRentalAffiliate `json:"affiliate"` // The booking number associated with the car rental. BookingNumber string `json:"booking_number"` // Class code of the car. @@ -2856,7 +3477,10 @@ type PaymentIntentPaymentDetailsCarRental struct { // The customer service phone number of the car rental company. CustomerServicePhoneNumber string `json:"customer_service_phone_number"` // Number of days the car is being rented. - DaysRented int64 `json:"days_rented"` + DaysRented int64 `json:"days_rented"` + Delivery *PaymentIntentPaymentDetailsCarRentalDelivery `json:"delivery"` + // The details of the drivers associated with the trip. + Drivers []*PaymentIntentPaymentDetailsCarRentalDriver `json:"drivers"` // List of additional charges being billed. ExtraCharges []PaymentIntentPaymentDetailsCarRentalExtraCharge `json:"extra_charges"` // Indicates if the customer did not keep nor cancel their booking. @@ -2876,8 +3500,66 @@ type PaymentIntentPaymentDetailsCarRental struct { // Indicates whether the goods or services are tax-exempt or tax is not collected. TaxExempt bool `json:"tax_exempt"` } +type PaymentIntentPaymentDetailsEventDetailsAffiliate struct { + // The name of the affiliate that originated the purchase. + Name string `json:"name"` +} +type PaymentIntentPaymentDetailsEventDetailsDeliveryReceipient struct { + // The email of the recipient the ticket is delivered to. + Email string `json:"email"` + // The name of the recipient the ticket is delivered to. + Name string `json:"name"` + // The phone number of the recipient the ticket is delivered to. + Phone string `json:"phone"` +} +type PaymentIntentPaymentDetailsEventDetailsDelivery struct { + // The delivery method for the payment + Mode PaymentIntentPaymentDetailsEventDetailsDeliveryMode `json:"mode"` + Receipient *PaymentIntentPaymentDetailsEventDetailsDeliveryReceipient `json:"receipient"` +} +type PaymentIntentPaymentDetailsEventDetails struct { + // Indicates if the tickets are digitally checked when entering the venue. + AccessControlledVenue bool `json:"access_controlled_venue"` + Address *Address `json:"address"` + Affiliate *PaymentIntentPaymentDetailsEventDetailsAffiliate `json:"affiliate"` + // The name of the company + Company string `json:"company"` + Delivery *PaymentIntentPaymentDetailsEventDetailsDelivery `json:"delivery"` + // Event end time. Measured in seconds since the Unix epoch. + EndsAt int64 `json:"ends_at"` + // Type of the event entertainment (concert, sports event etc) + Genre string `json:"genre"` + // The name of the event. + Name string `json:"name"` + // Event start time. Measured in seconds since the Unix epoch. + StartsAt int64 `json:"starts_at"` +} +type PaymentIntentPaymentDetailsSubscriptionAffiliate struct { + // The name of the affiliate that originated the purchase. + Name string `json:"name"` +} +type PaymentIntentPaymentDetailsSubscriptionBillingInterval struct { + // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + Count int64 `json:"count"` + // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + Interval PaymentIntentPaymentDetailsSubscriptionBillingIntervalInterval `json:"interval"` +} +type PaymentIntentPaymentDetailsSubscription struct { + Affiliate *PaymentIntentPaymentDetailsSubscriptionAffiliate `json:"affiliate"` + // Info whether the subscription will be auto renewed upon expiry. + AutoRenewal bool `json:"auto_renewal"` + BillingInterval *PaymentIntentPaymentDetailsSubscriptionBillingInterval `json:"billing_interval"` + // Subscription end time. Measured in seconds since the Unix epoch. + EndsAt int64 `json:"ends_at"` + // Name of the product on subscription. e.g. Apple Music Subscription. + Name string `json:"name"` + // Subscription start time. Measured in seconds since the Unix epoch. + StartsAt int64 `json:"starts_at"` +} type PaymentIntentPaymentDetails struct { - CarRental *PaymentIntentPaymentDetailsCarRental `json:"car_rental"` + CarRental *PaymentIntentPaymentDetailsCarRental `json:"car_rental"` + EventDetails *PaymentIntentPaymentDetailsEventDetails `json:"event_details"` + Subscription *PaymentIntentPaymentDetailsSubscription `json:"subscription"` } // Information about the payment method configuration used for this PaymentIntent. From 947c16cc9f5f03e12320aa2bbdcfc981ec7648da Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 23:22:46 +0000 Subject: [PATCH 14/16] Update generated code for v669 --- client/api.go | 4 - invoicelineitem.go | 159 -------------------------------------- invoicelineitem/client.go | 41 ---------- 3 files changed, 204 deletions(-) delete mode 100644 invoicelineitem/client.go diff --git a/client/api.go b/client/api.go index 8a7f18aed0..afafaed666 100644 --- a/client/api.go +++ b/client/api.go @@ -53,7 +53,6 @@ import ( identityverificationsession "github.com/stripe/stripe-go/v76/identity/verificationsession" "github.com/stripe/stripe-go/v76/invoice" "github.com/stripe/stripe-go/v76/invoiceitem" - "github.com/stripe/stripe-go/v76/invoicelineitem" "github.com/stripe/stripe-go/v76/invoicepayment" issuingauthorization "github.com/stripe/stripe-go/v76/issuing/authorization" issuingcard "github.com/stripe/stripe-go/v76/issuing/card" @@ -233,8 +232,6 @@ type API struct { IdentityVerificationSessions *identityverificationsession.Client // InvoiceItems is the client used to invoke /invoiceitems APIs. InvoiceItems *invoiceitem.Client - // InvoiceLineItems is the client used to invoke /invoices/{invoice}/lines APIs. - InvoiceLineItems *invoicelineitem.Client // InvoicePayments is the client used to invoke /invoices/{invoice}/payments APIs. InvoicePayments *invoicepayment.Client // Invoices is the client used to invoke /invoices APIs. @@ -470,7 +467,6 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.IdentityVerificationReports = &identityverificationreport.Client{B: backends.API, Key: key} a.IdentityVerificationSessions = &identityverificationsession.Client{B: backends.API, Key: key} a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key} - a.InvoiceLineItems = &invoicelineitem.Client{B: backends.API, Key: key} a.InvoicePayments = &invoicepayment.Client{B: backends.API, Key: key} a.Invoices = &invoice.Client{B: backends.API, Key: key} a.IssuingAuthorizations = &issuingauthorization.Client{B: backends.API, Key: key} diff --git a/invoicelineitem.go b/invoicelineitem.go index 5d6c51af9c..14c4c6aa13 100644 --- a/invoicelineitem.go +++ b/invoicelineitem.go @@ -15,164 +15,6 @@ const ( InvoiceLineItemTypeSubscription InvoiceLineItemType = "subscription" ) -// Time span for the redeemed discount. -type InvoiceLineItemDiscountDiscountEndDurationParams struct { - // Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. - Interval *string `form:"interval"` - // The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. - IntervalCount *int64 `form:"interval_count"` -} - -// Details to determine how long the discount should be applied for. -type InvoiceLineItemDiscountDiscountEndParams struct { - // Time span for the redeemed discount. - Duration *InvoiceLineItemDiscountDiscountEndDurationParams `form:"duration"` - // A precise Unix timestamp for the discount to end. Must be in the future. - Timestamp *int64 `form:"timestamp"` - // The type of calculation made to determine when the discount ends. - Type *string `form:"type"` -} - -// The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. -type InvoiceLineItemDiscountParams struct { - // ID of the coupon to create a new discount for. - Coupon *string `form:"coupon"` - // ID of an existing discount on the object (or one of its ancestors) to reuse. - Discount *string `form:"discount"` - // Details to determine how long the discount should be applied for. - DiscountEnd *InvoiceLineItemDiscountDiscountEndParams `form:"discount_end"` -} - -// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. -type InvoiceLineItemPeriodParams struct { - // The end of the period, which must be greater than or equal to the start. This value is inclusive. - End *int64 `form:"end"` - // The start of the period. This value is inclusive. - Start *int64 `form:"start"` -} - -// Data used to generate a new product object inline. One of `product` or `product_data` is required. -type InvoiceLineItemPriceDataProductDataParams struct { - // The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - Description *string `form:"description"` - // A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - Images []*string `form:"images"` - // 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 product's name, meant to be displayable to the customer. - Name *string `form:"name"` - // A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - TaxCode *string `form:"tax_code"` -} - -// AddMetadata adds a new key-value pair to the Metadata. -func (p *InvoiceLineItemPriceDataProductDataParams) AddMetadata(key string, value string) { - if p.Metadata == nil { - p.Metadata = make(map[string]string) - } - - p.Metadata[key] = value -} - -// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. -type InvoiceLineItemPriceDataParams struct { - // 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). - Currency *string `form:"currency"` - // The ID of the product that this price will belong to. One of `product` or `product_data` is required. - Product *string `form:"product"` - // Data used to generate a new product object inline. One of `product` or `product_data` is required. - ProductData *InvoiceLineItemPriceDataProductDataParams `form:"product_data"` - // Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - TaxBehavior *string `form:"tax_behavior"` - // A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. - UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` -} - -// Data to find or create a TaxRate object. -// -// Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. -type InvoiceLineItemTaxAmountTaxRateDataParams struct { - // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - Country *string `form:"country"` - // An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. - Description *string `form:"description"` - // The display name of the tax rate, which will be shown to users. - DisplayName *string `form:"display_name"` - // This specifies if the tax rate is inclusive or exclusive. - Inclusive *bool `form:"inclusive"` - // The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. - Jurisdiction *string `form:"jurisdiction"` - // The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. - Percentage *float64 `form:"percentage"` - // [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. - State *string `form:"state"` - // The high-level tax type, such as `vat` or `sales_tax`. - TaxType *string `form:"tax_type"` -} - -// A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. -type InvoiceLineItemTaxAmountParams struct { - // The amount, in cents (or local equivalent), of the tax. - Amount *int64 `form:"amount"` - // The amount on which tax is calculated, in cents (or local equivalent). - TaxableAmount *int64 `form:"taxable_amount"` - // Data to find or create a TaxRate object. - // - // Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. - TaxRateData *InvoiceLineItemTaxAmountTaxRateDataParams `form:"tax_rate_data"` -} - -// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, -// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice -// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. -// Updating an invoice's line item is only possible before the invoice is finalized. -type InvoiceLineItemParams struct { - Params `form:"*"` - Invoice *string `form:"-"` // Included in URL - // The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. - Amount *int64 `form:"amount"` - // An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - Description *string `form:"description"` - // Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. - Discountable *bool `form:"discountable"` - // The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. - Discounts []*InvoiceLineItemDiscountParams `form:"discounts"` - // Specifies which fields in the response should be expanded. - Expand []*string `form:"expand"` - // The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. - Margins []*string `form:"margins"` - // 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 period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - Period *InvoiceLineItemPeriodParams `form:"period"` - // The ID of the price object. - Price *string `form:"price"` - // Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - PriceData *InvoiceLineItemPriceDataParams `form:"price_data"` - // Non-negative integer. The quantity of units for the line item. - Quantity *int64 `form:"quantity"` - // A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. - TaxAmounts []*InvoiceLineItemTaxAmountParams `form:"tax_amounts"` - // The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. - TaxRates []*string `form:"tax_rates"` -} - -// AddExpand appends a new field to expand. -func (p *InvoiceLineItemParams) AddExpand(f string) { - p.Expand = append(p.Expand, &f) -} - -// AddMetadata adds a new key-value pair to the Metadata. -func (p *InvoiceLineItemParams) AddMetadata(key string, value string) { - if p.Metadata == nil { - p.Metadata = make(map[string]string) - } - - p.Metadata[key] = value -} - // The amount of discount calculated per discount for this line item. type InvoiceLineItemDiscountAmount struct { // The amount, in cents (or local equivalent), of the discount. @@ -203,7 +45,6 @@ type InvoiceLineItemProrationDetails struct { CreditedItems *InvoiceLineItemProrationDetailsCreditedItems `json:"credited_items"` } type InvoiceLineItem struct { - APIResource // The amount, in cents (or local equivalent). Amount int64 `json:"amount"` // The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. diff --git a/invoicelineitem/client.go b/invoicelineitem/client.go deleted file mode 100644 index 4874ab38e0..0000000000 --- a/invoicelineitem/client.go +++ /dev/null @@ -1,41 +0,0 @@ -// -// -// File generated from our OpenAPI spec -// -// - -// Package invoicelineitem provides the /invoices/{invoice}/lines APIs -package invoicelineitem - -import ( - "net/http" - - stripe "github.com/stripe/stripe-go/v76" -) - -// Client is used to invoke /invoices/{invoice}/lines APIs. -type Client struct { - B stripe.Backend - Key string -} - -// Update updates an invoice line item's properties. -func Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { - return getC().Update(id, params) -} - -// Update updates an invoice line item's properties. -func (c Client) Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { - path := stripe.FormatURLPath( - "/v1/invoices/%s/lines/%s", - stripe.StringValue(params.Invoice), - id, - ) - invoicelineitem := &stripe.InvoiceLineItem{} - err := c.B.Call(http.MethodPost, path, c.Key, params, invoicelineitem) - return invoicelineitem, err -} - -func getC() Client { - return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} -} From e647ebb955c9a6b4d67413f50f2f4c811903b58e Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:44:24 -0800 Subject: [PATCH 15/16] Update generated code (#1768) * Update generated code for v668 * Update generated code for v669 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- checkout_session.go | 2 + client/api.go | 4 -- invoicelineitem.go | 137 -------------------------------------- invoicelineitem/client.go | 41 ------------ 5 files changed, 3 insertions(+), 183 deletions(-) delete mode 100644 invoicelineitem/client.go diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 13e06c1ee9..d491c28018 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v666 \ No newline at end of file +v669 \ No newline at end of file diff --git a/checkout_session.go b/checkout_session.go index c2fb679c63..cc9528843d 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -748,6 +748,8 @@ type CheckoutSessionListParams struct { PaymentIntent *string `form:"payment_intent"` // Only return the Checkout Sessions for the Payment Link specified. PaymentLink *string `form:"payment_link"` + // Only return the Checkout Sessions matching the given status. + Status *string `form:"status"` // Only return the Checkout Session for the subscription specified. Subscription *string `form:"subscription"` } diff --git a/client/api.go b/client/api.go index c94d3e33c6..93a2368a75 100644 --- a/client/api.go +++ b/client/api.go @@ -43,7 +43,6 @@ import ( identityverificationsession "github.com/stripe/stripe-go/v76/identity/verificationsession" "github.com/stripe/stripe-go/v76/invoice" "github.com/stripe/stripe-go/v76/invoiceitem" - "github.com/stripe/stripe-go/v76/invoicelineitem" issuingauthorization "github.com/stripe/stripe-go/v76/issuing/authorization" issuingcard "github.com/stripe/stripe-go/v76/issuing/card" issuingcardholder "github.com/stripe/stripe-go/v76/issuing/cardholder" @@ -192,8 +191,6 @@ type API struct { IdentityVerificationSessions *identityverificationsession.Client // InvoiceItems is the client used to invoke /invoiceitems APIs. InvoiceItems *invoiceitem.Client - // InvoiceLineItems is the client used to invoke /invoices/{invoice}/lines APIs. - InvoiceLineItems *invoicelineitem.Client // Invoices is the client used to invoke /invoices APIs. Invoices *invoice.Client // IssuingAuthorizations is the client used to invoke /issuing/authorizations APIs. @@ -397,7 +394,6 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.IdentityVerificationReports = &identityverificationreport.Client{B: backends.API, Key: key} a.IdentityVerificationSessions = &identityverificationsession.Client{B: backends.API, Key: key} a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key} - a.InvoiceLineItems = &invoicelineitem.Client{B: backends.API, Key: key} a.Invoices = &invoice.Client{B: backends.API, Key: key} a.IssuingAuthorizations = &issuingauthorization.Client{B: backends.API, Key: key} a.IssuingCardholders = &issuingcardholder.Client{B: backends.API, Key: key} diff --git a/invoicelineitem.go b/invoicelineitem.go index fcc879d097..d9a9c53fce 100644 --- a/invoicelineitem.go +++ b/invoicelineitem.go @@ -15,142 +15,6 @@ const ( InvoiceLineItemTypeSubscription InvoiceLineItemType = "subscription" ) -// The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. -type InvoiceLineItemDiscountParams struct { - // ID of the coupon to create a new discount for. - Coupon *string `form:"coupon"` - // ID of an existing discount on the object (or one of its ancestors) to reuse. - Discount *string `form:"discount"` -} - -// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. -type InvoiceLineItemPeriodParams struct { - // The end of the period, which must be greater than or equal to the start. This value is inclusive. - End *int64 `form:"end"` - // The start of the period. This value is inclusive. - Start *int64 `form:"start"` -} - -// Data used to generate a new product object inline. One of `product` or `product_data` is required. -type InvoiceLineItemPriceDataProductDataParams struct { - // The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - Description *string `form:"description"` - // A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - Images []*string `form:"images"` - // 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 product's name, meant to be displayable to the customer. - Name *string `form:"name"` - // A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - TaxCode *string `form:"tax_code"` -} - -// AddMetadata adds a new key-value pair to the Metadata. -func (p *InvoiceLineItemPriceDataProductDataParams) AddMetadata(key string, value string) { - if p.Metadata == nil { - p.Metadata = make(map[string]string) - } - - p.Metadata[key] = value -} - -// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. -type InvoiceLineItemPriceDataParams struct { - // 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). - Currency *string `form:"currency"` - // The ID of the product that this price will belong to. One of `product` or `product_data` is required. - Product *string `form:"product"` - // Data used to generate a new product object inline. One of `product` or `product_data` is required. - ProductData *InvoiceLineItemPriceDataProductDataParams `form:"product_data"` - // Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - TaxBehavior *string `form:"tax_behavior"` - // A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. - UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` -} - -// Data to find or create a TaxRate object. -// -// Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. -type InvoiceLineItemTaxAmountTaxRateDataParams struct { - // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - Country *string `form:"country"` - // An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. - Description *string `form:"description"` - // The display name of the tax rate, which will be shown to users. - DisplayName *string `form:"display_name"` - // This specifies if the tax rate is inclusive or exclusive. - Inclusive *bool `form:"inclusive"` - // The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. - Jurisdiction *string `form:"jurisdiction"` - // The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. - Percentage *float64 `form:"percentage"` - // [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. - State *string `form:"state"` - // The high-level tax type, such as `vat` or `sales_tax`. - TaxType *string `form:"tax_type"` -} - -// A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. -type InvoiceLineItemTaxAmountParams struct { - // The amount, in cents (or local equivalent), of the tax. - Amount *int64 `form:"amount"` - // The amount on which tax is calculated, in cents (or local equivalent). - TaxableAmount *int64 `form:"taxable_amount"` - // Data to find or create a TaxRate object. - // - // Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. - TaxRateData *InvoiceLineItemTaxAmountTaxRateDataParams `form:"tax_rate_data"` -} - -// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, -// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice -// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. -// Updating an invoice's line item is only possible before the invoice is finalized. -type InvoiceLineItemParams struct { - Params `form:"*"` - Invoice *string `form:"-"` // Included in URL - // The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. - Amount *int64 `form:"amount"` - // An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - Description *string `form:"description"` - // Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. - Discountable *bool `form:"discountable"` - // The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. - Discounts []*InvoiceLineItemDiscountParams `form:"discounts"` - // Specifies which fields in the response should be expanded. - Expand []*string `form:"expand"` - // 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 period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - Period *InvoiceLineItemPeriodParams `form:"period"` - // The ID of the price object. - Price *string `form:"price"` - // Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - PriceData *InvoiceLineItemPriceDataParams `form:"price_data"` - // Non-negative integer. The quantity of units for the line item. - Quantity *int64 `form:"quantity"` - // A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. - TaxAmounts []*InvoiceLineItemTaxAmountParams `form:"tax_amounts"` - // The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. - TaxRates []*string `form:"tax_rates"` -} - -// AddExpand appends a new field to expand. -func (p *InvoiceLineItemParams) AddExpand(f string) { - p.Expand = append(p.Expand, &f) -} - -// AddMetadata adds a new key-value pair to the Metadata. -func (p *InvoiceLineItemParams) AddMetadata(key string, value string) { - if p.Metadata == nil { - p.Metadata = make(map[string]string) - } - - p.Metadata[key] = value -} - // The amount of discount calculated per discount for this line item. type InvoiceLineItemDiscountAmount struct { // The amount, in cents (or local equivalent), of the discount. @@ -173,7 +37,6 @@ type InvoiceLineItemProrationDetails struct { CreditedItems *InvoiceLineItemProrationDetailsCreditedItems `json:"credited_items"` } type InvoiceLineItem struct { - APIResource // The amount, in cents (or local equivalent). Amount int64 `json:"amount"` // The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. diff --git a/invoicelineitem/client.go b/invoicelineitem/client.go deleted file mode 100644 index 4874ab38e0..0000000000 --- a/invoicelineitem/client.go +++ /dev/null @@ -1,41 +0,0 @@ -// -// -// File generated from our OpenAPI spec -// -// - -// Package invoicelineitem provides the /invoices/{invoice}/lines APIs -package invoicelineitem - -import ( - "net/http" - - stripe "github.com/stripe/stripe-go/v76" -) - -// Client is used to invoke /invoices/{invoice}/lines APIs. -type Client struct { - B stripe.Backend - Key string -} - -// Update updates an invoice line item's properties. -func Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { - return getC().Update(id, params) -} - -// Update updates an invoice line item's properties. -func (c Client) Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { - path := stripe.FormatURLPath( - "/v1/invoices/%s/lines/%s", - stripe.StringValue(params.Invoice), - id, - ) - invoicelineitem := &stripe.InvoiceLineItem{} - err := c.B.Call(http.MethodPost, path, c.Key, params, invoicelineitem) - return invoicelineitem, err -} - -func getC() Client { - return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} -} From f41c88af95037f1ba559e1ce4251559819814913 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 16 Nov 2023 16:14:57 -0800 Subject: [PATCH 16/16] Bump version to 76.5.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- stripe.go | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa2531d57..71978d7e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 76.5.0 - 2023-11-16 +* [#1768](https://github.com/stripe/stripe-go/pull/1768) Update generated code + * Add support for `Status` on `CheckoutSessionListParams` +* [#1767](https://github.com/stripe/stripe-go/pull/1767) Update generated code + * Add support for `BACSDebitPayments` on `AccountSettingsParams` + * Add support for `ServiceUserNumber` on `AccountSettingsBacsDebitPayments` + * Add support for `CaptureBefore` on `ChargePaymentMethodDetailsCard` + * Add support for `Paypal` on `CheckoutSessionPaymentMethodOptions` + * Add support for `TaxAmounts` on `CreditNoteLinesParams`, `CreditNotePreviewLinesLinesParams`, and `CreditNotePreviewLinesParams` + * Add support for `NetworkData` on `IssuingTransaction` +* [#1764](https://github.com/stripe/stripe-go/pull/1764) Fix TestDo_RetryOnTimeout flakiness + ## 76.4.0 - 2023-11-09 * [#1762](https://github.com/stripe/stripe-go/pull/1762) Update generated code * Add support for new value `terminal_reader_hardware_fault` on enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode` diff --git a/VERSION b/VERSION index e4edff8209..8705ccdcfd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -76.4.0 +76.5.0 diff --git a/stripe.go b/stripe.go index 359f209234..17c2208b1f 100644 --- a/stripe.go +++ b/stripe.go @@ -1226,7 +1226,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "76.4.0" +const clientversion = "76.5.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and