Skip to content

Commit

Permalink
Merge pull request #922 from stripe/remi-fix-schedules
Browse files Browse the repository at this point in the history
A few Billing changes
  • Loading branch information
remi-stripe authored Aug 22, 2019
2 parents dcf67bc + cd4a351 commit 92ff94d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
3 changes: 3 additions & 0 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ type InvoiceUpcomingInvoiceItemParams struct {
InvoiceItem *string `form:"invoiceitem"`
Period *InvoiceUpcomingInvoiceItemPeriodParams `form:"period"`
Quantity *int64 `form:"quantity"`
Schedule *string `form:"schedule"`
TaxRates []*string `form:"tax_rates"`
UnitAmount *int64 `form:"unit_amount"`
}
Expand Down Expand Up @@ -114,7 +115,9 @@ type InvoiceParams struct {
Coupon *string `form:"coupon"`
InvoiceItems []*InvoiceUpcomingInvoiceItemParams `form:"invoice_items"`
SubscriptionBillingCycleAnchor *int64 `form:"subscription_billing_cycle_anchor"`
SubscriptionCancelAt *int64 `form:"subscription_cancel_at"`
SubscriptionCancelAtPeriodEnd *bool `form:"subscription_cancel_at_period_end"`
SubscriptionCancelNow *bool `form:"subscription_cancel_now"`
SubscriptionDefaultTaxRates []*string `form:"subscription_default_tax_rates"`
SubscriptionItems []*SubscriptionItemsParams `form:"subscription_items"`
SubscriptionPlan *string `form:"subscription_plan"`
Expand Down
1 change: 1 addition & 0 deletions sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ type Subscription struct {
PendingSetupIntent *SetupIntent `json:"pending_setup_intent"`
Plan *Plan `json:"plan"`
Quantity int64 `json:"quantity"`
Schedule *SubscriptionSchedule `json:"schedule"`
StartDate int64 `json:"start_date"`
Status SubscriptionStatus `json:"status"`
TransferData *SubscriptionTransferData `json:"transfer_data"`
Expand Down
40 changes: 24 additions & 16 deletions subschedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ type SubscriptionSchedulePhaseItemParams struct {
// SubscriptionSchedulePhaseParams is a structure representing the parameters allowed to control
// a phase on a subscription schedule.
type SubscriptionSchedulePhaseParams struct {
ApplicationFeePercent *int64 `form:"application_fee_percent"`
Coupon *string `form:"coupon"`
DefaultTaxRates []*string `form:"default_tax_rates"`
EndDate *int64 `form:"end_date"`
Iterations *int64 `form:"iterations"`
Plans []*SubscriptionSchedulePhaseItemParams `form:"plans"`
StartDate *int64 `form:"start_date"`
Trial *bool `form:"trial"`
TrialEnd *int64 `form:"trial_end"`
ApplicationFeePercent *int64 `form:"application_fee_percent"`
BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds"`
CollectionMethod *string `form:"collection_method"`
Coupon *string `form:"coupon"`
DefaultPaymentMethod *string `form:"default_payment_method"`
DefaultTaxRates []*string `form:"default_tax_rates"`
EndDate *int64 `form:"end_date"`
InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings"`
Iterations *int64 `form:"iterations"`
Plans []*SubscriptionSchedulePhaseItemParams `form:"plans"`
StartDate *int64 `form:"start_date"`
Trial *bool `form:"trial"`
TrialEnd *int64 `form:"trial_end"`

// This parameter is deprecated and we recommend that you use TaxRates instead.
TaxPercent *float64 `form:"tax_percent"`
Expand Down Expand Up @@ -139,13 +143,17 @@ type SubscriptionSchedulePhaseItem struct {

// SubscriptionSchedulePhase is a structure a phase of a subscription schedule.
type SubscriptionSchedulePhase struct {
ApplicationFeePercent float64 `json:"application_fee_percent"`
Coupon *Coupon `json:"coupon"`
DefaultTaxRates []*TaxRate `json:"default_tax_rates"`
EndDate int64 `json:"end_date"`
Plans []*SubscriptionSchedulePhaseItem `json:"plans"`
StartDate int64 `json:"start_date"`
TrialEnd int64 `json:"trial_end"`
ApplicationFeePercent float64 `json:"application_fee_percent"`
BillingThresholds *SubscriptionBillingThresholds `json:"billing_thresholds"`
CollectionMethod SubscriptionCollectionMethod `json:"collection_method"`
Coupon *Coupon `json:"coupon"`
DefaultPaymentMethod *PaymentMethod `json:"default_payment_method"`
DefaultTaxRates []*TaxRate `json:"default_tax_rates"`
EndDate int64 `json:"end_date"`
InvoiceSettings *SubscriptionScheduleInvoiceSettings `json:"invoice_settings"`
Plans []*SubscriptionSchedulePhaseItem `json:"plans"`
StartDate int64 `json:"start_date"`
TrialEnd int64 `json:"trial_end"`

// This field is deprecated and we recommend that you use TaxRates instead.
TaxPercent float64 `json:"tax_percent"`
Expand Down

0 comments on commit 92ff94d

Please sign in to comment.