Skip to content

Commit

Permalink
API Updates (#1616)
Browse files Browse the repository at this point in the history
Codegen for openapi v249
  • Loading branch information
anniel-stripe authored Mar 9, 2023
1 parent c3d5060 commit c2dda27
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v237
v249
25 changes: 22 additions & 3 deletions issuing_cardholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
57 changes: 57 additions & 0 deletions subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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`.
Expand All @@ -516,13 +551,23 @@ 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.
//
// 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.
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c2dda27

Please sign in to comment.