Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates for beta branch #1617

Merged
merged 6 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 74.11.0 - 2023-03-09
* [#1616](https://github.com/stripe/stripe-go/pull/1616) API Updates
* Add support for `CardIssuing` on `IssuingCardholderIndividualParams`
* Add support for new value `requirements.past_due` on enum `IssuingCardholderRequirementsDisabledReason`
* Add support for `CancellationDetails` on `SubscriptionCancelParams`, `SubscriptionParams`, and `Subscription`

## 74.11.0-beta.1 - 2023-03-02
* [#1615](https://github.com/stripe/stripe-go/pull/1615) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
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
70 changes: 70 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 @@ -173,6 +198,15 @@ const (
SubscriptionPendingInvoiceItemIntervalIntervalYear SubscriptionPendingInvoiceItemIntervalInterval = "year"
)

// Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
type SubscriptionPrebillingUpdateBehavior string

// List of values that SubscriptionPrebillingUpdateBehavior can take
const (
SubscriptionPrebillingUpdateBehaviorPrebill SubscriptionPrebillingUpdateBehavior = "prebill"
SubscriptionPrebillingUpdateBehaviorReset SubscriptionPrebillingUpdateBehavior = "reset"
)

// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`.
//
// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal state, the open invoice will be voided and no further invoices will be generated.
Expand Down Expand Up @@ -471,6 +505,8 @@ type SubscriptionPendingInvoiceItemIntervalParams struct {
type SubscriptionPrebillingParams struct {
// This is used to determine the number of billing cycles to prebill.
Iterations *int64 `form:"iterations"`
// Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
UpdateBehavior *string `form:"update_behavior"`
}

// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
Expand Down Expand Up @@ -520,6 +556,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 @@ -594,6 +632,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 @@ -602,13 +648,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 @@ -643,6 +699,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 @@ -775,6 +841,8 @@ type SubscriptionPrebilling struct {
PeriodEnd int64 `json:"period_end"`
// The start of the first period for which the invoice pre-bills.
PeriodStart int64 `json:"period_start"`
// Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
UpdateBehavior SubscriptionPrebillingUpdateBehavior `json:"update_behavior"`
}

// The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
Expand Down Expand Up @@ -817,6 +885,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
Loading