Skip to content

Commit

Permalink
Fix remaining params not passed as booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Jun 6, 2018
1 parent 00d32a1 commit 165546b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ type PlanTransformUsage struct {

// PlanTransformUsageParams represents the bucket billing configuration.
type PlanTransformUsageParams struct {
DivideBy int64 `form:"bucket_size"`
Round string `form:"round"`
DivideBy *int64 `form:"bucket_size"`
Round *string `form:"round"`
}

// PlanTierParams configures tiered pricing
Expand Down
4 changes: 2 additions & 2 deletions plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func TestPlanParams_AppendTo(t *testing.T) {
{"tiers[0][up_to]", &PlanParams{Tiers: tiers}, strconv.FormatUint(321, 10)},
{"tiers[1][amount]", &PlanParams{Tiers: tiers}, strconv.FormatUint(123, 10)},
{"tiers[1][up_to]", &PlanParams{Tiers: tiers}, "inf"},
{"transform_usage[bucket_size]", &PlanParams{TransformUsage: &PlanTransformUsageParams{DivideBy: 123, Round: "round_up"}}, strconv.FormatUint(123, 10)},
{"transform_usage[round]", &PlanParams{TransformUsage: &PlanTransformUsageParams{DivideBy: 123, Round: "round_up"}}, "round_up"},
{"transform_usage[bucket_size]", &PlanParams{TransformUsage: &PlanTransformUsageParams{DivideBy: Int64(123), Round: String("round_up")}}, strconv.FormatUint(123, 10)},
{"transform_usage[round]", &PlanParams{TransformUsage: &PlanTransformUsageParams{DivideBy: Int64(123), Round: String("round_up")}}, "round_up"},
{"trial_period_days", &PlanParams{TrialPeriodDays: Int64(123)}, strconv.FormatUint(123, 10)},
{"usage_type", &PlanParams{UsageType: String("metered")}, "metered"},
}
Expand Down
2 changes: 1 addition & 1 deletion product.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type ProductListParams struct {
Active *bool `form:"active"`
IDs []string `form:"ids"`
Shippable *bool `form:"shippable"`
URL string `form:"url"`
URL *string `form:"url"`
}

// UnmarshalJSON handles deserialization of a Product.
Expand Down
10 changes: 5 additions & 5 deletions sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ func (p *SubscriptionParams) AppendTo(body *form.Values, keyParts []string) {
// For more details see https://stripe.com/docs/api#create_subscription and https://stripe.com/docs/api#update_subscription.
type SubscriptionItemsParams struct {
Params `form:"*"`
ClearUsage bool `form:"clear_usage"`
Deleted bool `form:"deleted"`
ID string `form:"id"`
Plan string `form:"plan"`
Quantity *int64 `form:"quantity"`
ClearUsage *bool `form:"clear_usage"`
Deleted *bool `form:"deleted"`
ID *string `form:"id"`
Plan *string `form:"plan"`
Quantity *int64 `form:"quantity"`
}

// SubscriptionListParams is the set of parameters that can be used when listing active subscriptions.
Expand Down
2 changes: 1 addition & 1 deletion sub/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestSubscriptionNew_WithItems(t *testing.T) {
Customer: stripe.String("cus_123"),
Items: []*stripe.SubscriptionItemsParams{
{
Plan: "gold",
Plan: stripe.String("gold"),
Quantity: stripe.Int64(0),
},
},
Expand Down

0 comments on commit 165546b

Please sign in to comment.