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

Add support for ProrationBehavior on SubscriptionSchedule #1035

Merged
merged 1 commit into from
Feb 21, 2020
Merged
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
23 changes: 14 additions & 9 deletions subschedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type SubscriptionSchedulePhaseParams struct {
InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings"`
Iterations *int64 `form:"iterations"`
Plans []*SubscriptionSchedulePhaseItemParams `form:"plans"`
ProrationBehavior *string `form:"proration_behavior"`
StartDate *int64 `form:"start_date"`
Trial *bool `form:"trial"`
TrialEnd *int64 `form:"trial_end"`
Expand All @@ -76,15 +77,19 @@ type SubscriptionSchedulePhaseParams struct {
// SubscriptionScheduleParams is the set of parameters that can be used when creating or updating a
// subscription schedule.
type SubscriptionScheduleParams struct {
Params `form:"*"`
Customer *string `form:"customer"`
DefaultSettings *SubscriptionScheduleDefaultSettingsParams `form:"default_settings"`
EndBehavior *string `form:"end_behavior"`
FromSubscription *string `form:"from_subscription"`
Phases []*SubscriptionSchedulePhaseParams `form:"phases"`
Prorate *bool `form:"prorate"`
StartDate *int64 `form:"start_date"`
StartDateNow *bool `form:"-"` // See custom AppendTo
Params `form:"*"`
Customer *string `form:"customer"`
DefaultSettings *SubscriptionScheduleDefaultSettingsParams `form:"default_settings"`
EndBehavior *string `form:"end_behavior"`
FromSubscription *string `form:"from_subscription"`
ProrationBehavior *string `form:"proration_behavior"`
Phases []*SubscriptionSchedulePhaseParams `form:"phases"`
StartDate *int64 `form:"start_date"`
StartDateNow *bool `form:"-"` // See custom AppendTo

// TODO remove in the next major version
// This propery is considered deprecated. Use ProrationBehavior instead
Prorate *bool `form:"prorate"`
}

// AppendTo implements custom encoding logic for SubscriptionScheduleParams so that the special
Expand Down