Skip to content

Commit

Permalink
Merge pull request #576 from mholt/master
Browse files Browse the repository at this point in the history
Fix bucket_size -> divide_by
  • Loading branch information
brandur-stripe authored Jun 7, 2018
2 parents 171c54c + e40e7d5 commit e5045d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ type PlanTier struct {

// PlanTransformUsage represents the bucket billing configuration.
type PlanTransformUsage struct {
BucketSize int64 `json:"bucket_size"`
Round PlanTransformUsageRound `json:"round"`
DivideBy int64 `json:"divide_by"`
Round PlanTransformUsageRound `json:"round"`
}

// PlanTransformUsageParams represents the bucket billing configuration.
type PlanTransformUsageParams struct {
BucketSize *int64 `form:"bucket_size"`
Round *string `form:"round"`
DivideBy *int64 `form:"divide_by"`
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 @@ -66,8 +66,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{BucketSize: Int64(123), Round: String("round_up")}}, strconv.FormatUint(123, 10)},
{"transform_usage[round]", &PlanParams{TransformUsage: &PlanTransformUsageParams{BucketSize: Int64(123), Round: String("round_up")}}, "round_up"},
{"transform_usage[divide_by]", &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

0 comments on commit e5045d0

Please sign in to comment.