diff --git a/plan.go b/plan.go index 557d4d17ac..391a3ac6ff 100644 --- a/plan.go +++ b/plan.go @@ -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 diff --git a/plan_test.go b/plan_test.go index 5851b2b424..f1304ca7b8 100644 --- a/plan_test.go +++ b/plan_test.go @@ -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"}, }