From c2dda27bedc6ee8f413315fd3bfd7394a0bc15a6 Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Thu, 9 Mar 2023 11:28:54 -0800 Subject: [PATCH] API Updates (#1616) Codegen for openapi v249 --- OPENAPI_VERSION | 2 +- issuing_cardholder.go | 25 ++++++++++++++++--- subscription.go | 57 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index eb6678972b..f93f657afe 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v237 \ No newline at end of file +v249 \ No newline at end of file diff --git a/issuing_cardholder.go b/issuing_cardholder.go index 63adf7e804..6afc225790 100644 --- a/issuing_cardholder.go +++ b/issuing_cardholder.go @@ -13,9 +13,10 @@ type IssuingCardholderRequirementsDisabledReason string // List of values that IssuingCardholderRequirementsDisabledReason can take const ( - IssuingCardholderRequirementsDisabledReasonListed IssuingCardholderRequirementsDisabledReason = "listed" - IssuingCardholderRequirementsDisabledReasonRejectedListed IssuingCardholderRequirementsDisabledReason = "rejected.listed" - IssuingCardholderRequirementsDisabledReasonUnderReview IssuingCardholderRequirementsDisabledReason = "under_review" + IssuingCardholderRequirementsDisabledReasonListed IssuingCardholderRequirementsDisabledReason = "listed" + IssuingCardholderRequirementsDisabledReasonRejectedListed IssuingCardholderRequirementsDisabledReason = "rejected.listed" + IssuingCardholderRequirementsDisabledReasonRequirementsPastDue IssuingCardholderRequirementsDisabledReason = "requirements.past_due" + IssuingCardholderRequirementsDisabledReasonUnderReview IssuingCardholderRequirementsDisabledReason = "under_review" ) // Interval (or event) to which the amount applies. @@ -79,6 +80,22 @@ type IssuingCardholderCompanyParams struct { TaxID *string `form:"tax_id"` } +// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). +type IssuingCardholderIndividualCardIssuingUserTermsAcceptanceParams struct { + // The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + Date *int64 `form:"date"` + // The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + IP *string `form:"ip"` + // The user agent of the browser from which the cardholder accepted the Authorized User Terms. + UserAgent *string `form:"user_agent"` +} + +// Information related to the card_issuing program for this cardholder. +type IssuingCardholderIndividualCardIssuingParams struct { + // Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). + UserTermsAcceptance *IssuingCardholderIndividualCardIssuingUserTermsAcceptanceParams `form:"user_terms_acceptance"` +} + // The date of birth of this cardholder. type IssuingCardholderIndividualDOBParams struct { // The day of birth, between 1 and 31. @@ -105,6 +122,8 @@ type IssuingCardholderIndividualVerificationParams struct { // Additional information about an `individual` cardholder. type IssuingCardholderIndividualParams struct { + // Information related to the card_issuing program for this cardholder. + CardIssuing *IssuingCardholderIndividualCardIssuingParams `form:"card_issuing"` // The date of birth of this cardholder. DOB *IssuingCardholderIndividualDOBParams `form:"dob"` // The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. diff --git a/subscription.go b/subscription.go index 540894147a..5af8c1689d 100644 --- a/subscription.go +++ b/subscription.go @@ -11,6 +11,31 @@ import ( "github.com/stripe/stripe-go/v74/form" ) +// The customer submitted reason for why they cancelled, if the subscription was cancelled explicitly by the user. +type SubscriptionCancellationDetailsFeedback string + +// List of values that SubscriptionCancellationDetailsFeedback can take +const ( + SubscriptionCancellationDetailsFeedbackCustomerService SubscriptionCancellationDetailsFeedback = "customer_service" + SubscriptionCancellationDetailsFeedbackLowQuality SubscriptionCancellationDetailsFeedback = "low_quality" + SubscriptionCancellationDetailsFeedbackMissingFeatures SubscriptionCancellationDetailsFeedback = "missing_features" + SubscriptionCancellationDetailsFeedbackOther SubscriptionCancellationDetailsFeedback = "other" + SubscriptionCancellationDetailsFeedbackSwitchedService SubscriptionCancellationDetailsFeedback = "switched_service" + SubscriptionCancellationDetailsFeedbackTooComplex SubscriptionCancellationDetailsFeedback = "too_complex" + SubscriptionCancellationDetailsFeedbackTooExpensive SubscriptionCancellationDetailsFeedback = "too_expensive" + SubscriptionCancellationDetailsFeedbackUnused SubscriptionCancellationDetailsFeedback = "unused" +) + +// Why this subscription was cancelled. +type SubscriptionCancellationDetailsReason string + +// List of values that SubscriptionCancellationDetailsReason can take +const ( + SubscriptionCancellationDetailsReasonCancellationRequested SubscriptionCancellationDetailsReason = "cancellation_requested" + SubscriptionCancellationDetailsReasonPaymentDisputed SubscriptionCancellationDetailsReason = "payment_disputed" + SubscriptionCancellationDetailsReasonPaymentFailed SubscriptionCancellationDetailsReason = "payment_failed" +) + // Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. type SubscriptionCollectionMethod string @@ -438,6 +463,8 @@ type SubscriptionParams struct { CancelAt *int64 `form:"cancel_at"` // Boolean indicating whether this subscription should cancel at the end of the current period. CancelAtPeriodEnd *bool `form:"cancel_at_period_end"` + // Details about why this subscription was cancelled + CancellationDetails *SubscriptionCancellationDetailsParams `form:"cancellation_details"` // Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. CollectionMethod *string `form:"collection_method"` // The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. @@ -508,6 +535,14 @@ func (s *SubscriptionParams) AppendTo(body *form.Values, keyParts []string) { } } +// Details about why this subscription was cancelled +type SubscriptionCancellationDetailsParams struct { + // Additional comments about why the user canceled the subscription, if the subscription was cancelled explicitly by the user. + Comment *string `form:"comment"` + // The customer submitted reason for why they cancelled, if the subscription was cancelled explicitly by the user. + Feedback *string `form:"feedback"` +} + // If specified, payment collection for this subscription will be paused. type SubscriptionPauseCollectionParams struct { // The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. @@ -516,6 +551,14 @@ type SubscriptionPauseCollectionParams struct { ResumesAt *int64 `form:"resumes_at"` } +// Details about why this subscription was cancelled +type SubscriptionCancelCancellationDetailsParams struct { + // Additional comments about why the user canceled the subscription, if the subscription was cancelled explicitly by the user. + Comment *string `form:"comment"` + // The customer submitted reason for why they cancelled, if the subscription was cancelled explicitly by the user. + Feedback *string `form:"feedback"` +} + // Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. // // Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. @@ -523,6 +566,8 @@ type SubscriptionPauseCollectionParams struct { // By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. type SubscriptionCancelParams struct { Params `form:"*"` + // Details about why this subscription was cancelled + CancellationDetails *SubscriptionCancelCancellationDetailsParams `form:"cancellation_details"` // Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. InvoiceNow *bool `form:"invoice_now"` // Will generate a proration invoice item that credits remaining unused time until the subscription period end. @@ -557,6 +602,16 @@ type SubscriptionBillingThresholds struct { ResetBillingCycleAnchor bool `json:"reset_billing_cycle_anchor"` } +// Details about why this subscription was cancelled +type SubscriptionCancellationDetails struct { + // Additional comments about why the user canceled the subscription, if the subscription was cancelled explicitly by the user. + Comment string `json:"comment"` + // The customer submitted reason for why they cancelled, if the subscription was cancelled explicitly by the user. + Feedback SubscriptionCancellationDetailsFeedback `json:"feedback"` + // Why this subscription was cancelled. + Reason SubscriptionCancellationDetailsReason `json:"reason"` +} + // If specified, payment collection for this subscription will be paused. type SubscriptionPauseCollection struct { // The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. @@ -717,6 +772,8 @@ type Subscription struct { CancelAtPeriodEnd bool `json:"cancel_at_period_end"` // If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. CanceledAt int64 `json:"canceled_at"` + // Details about why this subscription was cancelled + CancellationDetails *SubscriptionCancellationDetails `json:"cancellation_details"` // Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. CollectionMethod SubscriptionCollectionMethod `json:"collection_method"` // Time at which the object was created. Measured in seconds since the Unix epoch.