From 96b0a6a2ae96e163f0d79aa8567b0908624d2c94 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 6 Jun 2022 13:15:25 -0700 Subject: [PATCH] Codegen for openapi v151 --- OPENAPI_VERSION | 2 +- checkout_session.go | 12 +++++++++++- invoice.go | 10 +++------- paymentintent.go | 2 +- setupintent.go | 2 +- shippingrate.go | 3 ++- sub.go | 14 +++++--------- subitem.go | 6 +----- 8 files changed, 25 insertions(+), 26 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index fff14d8c4a..af823a6291 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v150 \ No newline at end of file +v151 \ No newline at end of file diff --git a/checkout_session.go b/checkout_session.go index e3779ccaa1..42379a6e16 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -480,7 +480,7 @@ type CheckoutSessionPaymentMethodOptionsOXXOParams struct { // Additional fields for Financial Connections Session creation type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct { - // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. Permissions []*string `form:"permissions"` } @@ -861,10 +861,12 @@ type CheckoutSessionPaymentMethodOptionsACSSDebit struct { // Bank account verification method. VerificationMethod CheckoutSessionPaymentMethodOptionsACSSDebitVerificationMethod `json:"verification_method"` } +type CheckoutSessionPaymentMethodOptionsAffirm struct{} type CheckoutSessionPaymentMethodOptionsAfterpayClearpay struct{} type CheckoutSessionPaymentMethodOptionsAlipay struct{} type CheckoutSessionPaymentMethodOptionsAUBECSDebit struct{} type CheckoutSessionPaymentMethodOptionsBACSDebit struct{} +type CheckoutSessionPaymentMethodOptionsBancontact struct{} type CheckoutSessionPaymentMethodOptionsBoleto struct { // The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. ExpiresAfterDays int64 `json:"expires_after_days"` @@ -873,6 +875,7 @@ type CheckoutSessionPaymentMethodOptionsEPS struct{} type CheckoutSessionPaymentMethodOptionsFPX struct{} type CheckoutSessionPaymentMethodOptionsGiropay struct{} type CheckoutSessionPaymentMethodOptionsGrabpay struct{} +type CheckoutSessionPaymentMethodOptionsIdeal struct{} type CheckoutSessionPaymentMethodOptionsKlarna struct{} type CheckoutSessionPaymentMethodOptionsKonbini struct { // The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. @@ -882,8 +885,10 @@ type CheckoutSessionPaymentMethodOptionsOXXO struct { // The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. ExpiresAfterDays int64 `json:"expires_after_days"` } +type CheckoutSessionPaymentMethodOptionsP24 struct{} type CheckoutSessionPaymentMethodOptionsPayNow struct{} type CheckoutSessionPaymentMethodOptionsSepaDebit struct{} +type CheckoutSessionPaymentMethodOptionsSofort struct{} type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnections struct { // The list of permissions to request. The `payment_method` permission must be included. Permissions []CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission `json:"permissions"` @@ -899,20 +904,25 @@ type CheckoutSessionPaymentMethodOptionsUSBankAccount struct { // Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. type CheckoutSessionPaymentMethodOptions struct { ACSSDebit *CheckoutSessionPaymentMethodOptionsACSSDebit `json:"acss_debit"` + Affirm *CheckoutSessionPaymentMethodOptionsAffirm `json:"affirm"` AfterpayClearpay *CheckoutSessionPaymentMethodOptionsAfterpayClearpay `json:"afterpay_clearpay"` Alipay *CheckoutSessionPaymentMethodOptionsAlipay `json:"alipay"` AUBECSDebit *CheckoutSessionPaymentMethodOptionsAUBECSDebit `json:"au_becs_debit"` BACSDebit *CheckoutSessionPaymentMethodOptionsBACSDebit `json:"bacs_debit"` + Bancontact *CheckoutSessionPaymentMethodOptionsBancontact `json:"bancontact"` Boleto *CheckoutSessionPaymentMethodOptionsBoleto `json:"boleto"` EPS *CheckoutSessionPaymentMethodOptionsEPS `json:"eps"` FPX *CheckoutSessionPaymentMethodOptionsFPX `json:"fpx"` Giropay *CheckoutSessionPaymentMethodOptionsGiropay `json:"giropay"` Grabpay *CheckoutSessionPaymentMethodOptionsGrabpay `json:"grabpay"` + Ideal *CheckoutSessionPaymentMethodOptionsIdeal `json:"ideal"` Klarna *CheckoutSessionPaymentMethodOptionsKlarna `json:"klarna"` Konbini *CheckoutSessionPaymentMethodOptionsKonbini `json:"konbini"` OXXO *CheckoutSessionPaymentMethodOptionsOXXO `json:"oxxo"` + P24 *CheckoutSessionPaymentMethodOptionsP24 `json:"p24"` PayNow *CheckoutSessionPaymentMethodOptionsPayNow `json:"paynow"` SepaDebit *CheckoutSessionPaymentMethodOptionsSepaDebit `json:"sepa_debit"` + Sofort *CheckoutSessionPaymentMethodOptionsSofort `json:"sofort"` USBankAccount *CheckoutSessionPaymentMethodOptionsUSBankAccount `json:"us_bank_account"` } type CheckoutSessionPhoneNumberCollection struct { diff --git a/invoice.go b/invoice.go index c540961b82..9e0c2dbdcb 100644 --- a/invoice.go +++ b/invoice.go @@ -237,7 +237,7 @@ type InvoicePaymentSettingsPaymentMethodOptionsKonbiniParams struct{} // Additional fields for Financial Connections Session creation type InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct { - // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. Permissions []*string `form:"permissions"` } @@ -351,11 +351,7 @@ type InvoiceParams struct { // A list of up to 20 subscription items, each with an attached price. SubscriptionItems []*SubscriptionItemsParams `form:"subscription_items"` SubscriptionPlan *string `form:"subscription_plan"` - // Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - // - // Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - // - // Prorations can be disabled by passing `none`. + // Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. SubscriptionProrationBehavior *string `form:"subscription_proration_behavior"` // If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. SubscriptionProrationDate *int64 `form:"subscription_proration_date"` @@ -701,7 +697,7 @@ type Invoice struct { AmountDue int64 `json:"amount_due"` // The amount, in %s, that was paid. AmountPaid int64 `json:"amount_paid"` - // The amount remaining, in %s, that is due. + // The difference between amount_due and amount_paid, in %s. AmountRemaining int64 `json:"amount_remaining"` // ID of the Connect Application that created the invoice. Application *Application `json:"application"` diff --git a/paymentintent.go b/paymentintent.go index 4d86020b61..1bc69a2ec1 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1216,7 +1216,7 @@ type PaymentIntentPaymentMethodOptionsSofortParams struct { // Additional fields for Financial Connections Session creation type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct { - // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. Permissions []*string `form:"permissions"` // For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. ReturnURL *string `form:"return_url"` diff --git a/setupintent.go b/setupintent.go index 1e8e06cbea..6a2b7f1d96 100644 --- a/setupintent.go +++ b/setupintent.go @@ -524,7 +524,7 @@ type SetupIntentPaymentMethodOptionsSepaDebitParams struct { // Additional fields for Financial Connections Session creation type SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct { - // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. Permissions []*string `form:"permissions"` // For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. ReturnURL *string `form:"return_url"` diff --git a/shippingrate.go b/shippingrate.go index 9d6324b4f4..68cd471075 100644 --- a/shippingrate.go +++ b/shippingrate.go @@ -145,7 +145,8 @@ type ShippingRateFixedAmount struct { } // Shipping rates describe the price of shipping presented to your customers and can be -// applied to [Checkout Sessions](https://stripe.com/docs/payments/checkout/shipping) to collect shipping costs. +// applied to [Checkout Sessions](https://stripe.com/docs/payments/checkout/shipping) +// and [Orders](https://stripe.com/docs/orders/shipping) to collect shipping costs. type ShippingRate struct { APIResource // Whether the shipping rate can be used for new purchases. Defaults to `true`. diff --git a/sub.go b/sub.go index ba02ec866a..a38523b4c7 100644 --- a/sub.go +++ b/sub.go @@ -328,7 +328,7 @@ type SubscriptionPaymentSettingsPaymentMethodOptionsKonbiniParams struct{} // Additional fields for Financial Connections Session creation type SubscriptionPaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct { - // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. Permissions []*string `form:"permissions"` } @@ -399,7 +399,7 @@ type SubscriptionParams struct { AutomaticTax *SubscriptionAutomaticTaxParams `form:"automatic_tax"` // For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. BackdateStartDate *int64 `form:"backdate_start_date"` - // Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + // Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). BillingCycleAnchor *int64 `form:"billing_cycle_anchor"` BillingCycleAnchorNow *bool `form:"-"` // See custom AppendTo BillingCycleAnchorUnchanged *bool `form:"-"` // See custom AppendTo @@ -448,11 +448,7 @@ type SubscriptionParams struct { Plan *string `form:"plan"` // The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. PromotionCode *string `form:"promotion_code"` - // Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - // - // Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - // - // Prorations can be disabled by passing `none`. + // Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. ProrationBehavior *string `form:"proration_behavior"` // If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. ProrationDate *int64 `form:"proration_date"` @@ -615,7 +611,7 @@ type SubscriptionPendingInvoiceItemInterval struct { // If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. type SubscriptionPendingUpdate struct { - // If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + // If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. BillingCycleAnchor int64 `json:"billing_cycle_anchor"` // The point after which the changes reflected by this update will be discarded and no longer applied. ExpiresAt int64 `json:"expires_at"` @@ -645,7 +641,7 @@ type Subscription struct { // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. ApplicationFeePercent float64 `json:"application_fee_percent"` AutomaticTax *SubscriptionAutomaticTax `json:"automatic_tax"` - // Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + // Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. BillingCycleAnchor int64 `json:"billing_cycle_anchor"` // Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period BillingThresholds *SubscriptionBillingThresholds `json:"billing_thresholds"` diff --git a/subitem.go b/subitem.go index a367ea4395..cded2c812e 100644 --- a/subitem.go +++ b/subitem.go @@ -65,11 +65,7 @@ type SubscriptionItemParams struct { Price *string `form:"price"` // Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. PriceData *SubscriptionItemPriceDataParams `form:"price_data"` - // Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - // - // Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - // - // Prorations can be disabled by passing `none`. + // Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. ProrationBehavior *string `form:"proration_behavior"` // If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. ProrationDate *int64 `form:"proration_date"`