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

Move to API version 2019-10-17 #973

Merged
merged 1 commit into from
Oct 19, 2019
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cache:
env:
global:
# If changing this number, please also change it in `testing/testing.go`.
- STRIPE_MOCK_VERSION=0.68.0
- STRIPE_MOCK_VERSION=0.69.0

go:
- "1.9.x"
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ Below are a few simple examples:

```go
params := &stripe.CustomerParams{
AccountBalance: stripe.Int64(-123),
Description: stripe.String("Stripe Developer"),
Email: stripe.String("[email protected]"),
}
params.SetSource("tok_1234")

customer, err := customer.New(params)
```
Expand Down
2 changes: 1 addition & 1 deletion stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

const (
// APIVersion is the currently supported API version
APIVersion string = "2019-10-08"
APIVersion string = "2019-10-17"

// APIBackend is a constant representing the API service backend.
APIBackend SupportedBackend = "api"
Expand Down
27 changes: 2 additions & 25 deletions subschedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ type SubscriptionScheduleEndBehavior string

// List of values that SubscriptionScheduleEndBehavior can take.
const (
SubscriptionScheduleEndBehaviorCancel SubscriptionScheduleEndBehavior = "cancel"
SubscriptionScheduleEndBehaviorNone SubscriptionScheduleEndBehavior = "none"
SubscriptionScheduleEndBehaviorRenew SubscriptionScheduleEndBehavior = "release"
SubscriptionScheduleEndBehaviorRelease SubscriptionScheduleEndBehavior = "renew"
SubscriptionScheduleEndBehaviorCancel SubscriptionScheduleEndBehavior = "cancel"
SubscriptionScheduleEndBehaviorRenew SubscriptionScheduleEndBehavior = "release"
)

// SubscriptionScheduleStatus is the list of allowed values for the schedule's status.
Expand All @@ -27,17 +25,6 @@ const (
SubscriptionScheduleStatusTrialing SubscriptionScheduleStatus = "released"
)

// SubscriptionScheduleRenewalBehavior describe what happens to a schedule when it ends.
type SubscriptionScheduleRenewalBehavior string

// List of values that SubscriptionScheduleRenewalBehavior can take.
const (
SubscriptionScheduleRenewalBehaviorCancel SubscriptionScheduleRenewalBehavior = "cancel"
SubscriptionScheduleRenewalBehaviorNone SubscriptionScheduleRenewalBehavior = "none"
SubscriptionScheduleRenewalBehaviorRenew SubscriptionScheduleRenewalBehavior = "release"
SubscriptionScheduleRenewalBehaviorRelease SubscriptionScheduleRenewalBehavior = "renew"
)

// SubscriptionScheduleInvoiceSettingsParams is a structure representing the parameters allowed to
// control invoice settings on invoices associated with a subscription schedule.
type SubscriptionScheduleInvoiceSettingsParams struct {
Expand Down Expand Up @@ -74,13 +61,6 @@ type SubscriptionSchedulePhaseParams struct {
TaxPercent *float64 `form:"tax_percent"`
}

// SubscriptionScheduleRenewalIntervalParams is a structure representing the renewal interval
// for a given subscription schedule.
type SubscriptionScheduleRenewalIntervalParams struct {
Interval *string `form:"interval"`
Length *int64 `form:"length"`
}

// SubscriptionScheduleParams is the set of parameters that can be used when creating or updating a
// subscription schedule.
type SubscriptionScheduleParams struct {
Expand All @@ -95,8 +75,6 @@ type SubscriptionScheduleParams struct {
InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings"`
Phases []*SubscriptionSchedulePhaseParams `form:"phases"`
Prorate *bool `form:"prorate"`
RenewalBehavior *string `form:"renewal_behavior"`
RenewalInterval *SubscriptionScheduleRenewalIntervalParams `form:"renewal_interval"`
StartDate *int64 `form:"start_date"`
}

Expand Down Expand Up @@ -194,7 +172,6 @@ type SubscriptionSchedule struct {
Object string `json:"object"`
Phases []*SubscriptionSchedulePhase `json:"phases"`
ReleasedSubscription *Subscription `json:"released_subscription"`
RenewalBehavior SubscriptionScheduleRenewalBehavior `json:"renewal_behavior"`
RenewalInterval *SubscriptionScheduleRenewalInterval `json:"renewal_interval"`
Status SubscriptionScheduleStatus `json:"status"`
Subscription *Subscription `json:"subscription"`
Expand Down
2 changes: 1 addition & 1 deletion subschedule/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestSubscriptionScheduleNew(t *testing.T) {
},
},
},
RenewalBehavior: stripe.String(string(stripe.SubscriptionScheduleRenewalBehaviorNone)),
EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorCancel)),
}
schedule, err := New(params)
assert.Nil(t, err)
Expand Down
2 changes: 1 addition & 1 deletion testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
// added in a more recent version of stripe-mock, we can show people a
// better error message instead of the test suite crashing with a bunch of
// confusing 404 errors or the like.
MockMinimumVersion = "0.68.0"
MockMinimumVersion = "0.69.0"

// TestMerchantID is a token that can be used to represent a merchant ID in
// simple tests.
Expand Down