代码拉取完成,页面将自动刷新
package stripe
import (
"strconv"
"github.com/stripe/stripe-go/form"
)
// PlanInterval is the list of allowed values for a plan's interval.
type PlanInterval string
const (
PlanIntervalDay PlanInterval = "day"
PlanIntervalWeek PlanInterval = "week"
PlanIntervalMonth PlanInterval = "month"
PlanIntervalYear PlanInterval = "year"
)
// PlanBillingScheme is the list of allowed values for a plan's billing scheme.
type PlanBillingScheme string
const (
PlanBillingSchemePerUnit PlanBillingScheme = "per_unit"
PlanBillingSchemeTiered PlanBillingScheme = "tiered"
)
// PlanUsageType is the list of allowed values for a plan's usage type.
type PlanUsageType string
const (
PlanUsageTypeLicensed PlanUsageType = "licensed"
PlanUsageTypeMetered PlanUsageType = "metered"
)
// PlanTiersMode is the list of allowed values for a plan's tiers mode.
type PlanTiersMode string
const (
PlanTiersModeGraduated PlanTiersMode = "graduated"
PlanTiersModeVolume PlanTiersMode = "volume"
)
// PlanTransformUsageRound is the list of allowed values for a plan's transform usage round logic.
type PlanTransformUsageRound string
const (
PlanTransformUsageRoundDown PlanTransformUsageRound = "down"
PlanTransformUsageRoundUp PlanTransformUsageRound = "up"
)
// PlanAggregateUsage is the list of allowed values for a plan's aggregate usage.
type PlanAggregateUsage string
const (
PlanAggregateUsageLastDuringPeriod PlanAggregateUsage = "last_during_period"
PlanAggregateUsageLastEver PlanAggregateUsage = "last_ever"
PlanAggregateUsageMax PlanAggregateUsage = "max"
PlanAggregateUsageSum PlanAggregateUsage = "sum"
)
// Plan is the resource representing a Stripe plan.
// For more details see https://stripe.com/docs/api#plans.
type Plan struct {
Active bool `json:"active"`
AggregateUsage string `json:"aggregate_usage"`
Amount int64 `json:"amount"`
BillingScheme PlanBillingScheme `json:"billing_scheme"`
Created int64 `json:"created"`
Currency Currency `json:"currency"`
Deleted bool `json:"deleted"`
ID string `json:"id"`
Interval PlanInterval `json:"interval"`
IntervalCount int64 `json:"interval_count"`
Livemode bool `json:"livemode"`
Metadata map[string]string `json:"metadata"`
Nickname string `json:"nickname"`
Product string `json:"product"`
Tiers []*PlanTier `json:"tiers"`
TiersMode string `json:"tiers_mode"`
TransformUsage *PlanTransformUsage `json:"transform_usage"`
TrialPeriodDays int64 `json:"trial_period_days"`
UsageType PlanUsageType `json:"usage_type"`
}
// PlanList is a list of plans as returned from a list endpoint.
type PlanList struct {
ListMeta
Data []*Plan `json:"data"`
}
// PlanListParams is the set of parameters that can be used when listing plans.
// For more details see https://stripe.com/docs/api#list_plans.
type PlanListParams struct {
ListParams `form:"*"`
Active *bool `form:"active"`
Created *int64 `form:"created"`
CreatedRange *RangeQueryParams `form:"created"`
Product *string `form:"product"`
}
// PlanParams is the set of parameters that can be used when creating or updating a plan.
// For more details see https://stripe.com/docs/api#create_plan and https://stripe.com/docs/api#update_plan.
type PlanParams struct {
Params `form:"*"`
Active *bool `form:"active"`
AggregateUsage *string `form:"aggregate_usage"`
Amount *int64 `form:"amount"`
BillingScheme *string `form:"billing_scheme"`
Currency *string `form:"currency"`
ID *string `form:"id"`
Interval *string `form:"interval"`
IntervalCount *int64 `form:"interval_count"`
Nickname *string `form:"nickname"`
Product *PlanProductParams `form:"product"`
ProductID *string `form:"product"`
Tiers []*PlanTierParams `form:"tiers,indexed"`
TiersMode *string `form:"tiers_mode"`
TransformUsage *PlanTransformUsageParams `form:"transform_usage"`
TrialPeriodDays *int64 `form:"trial_period_days"`
UsageType *string `form:"usage_type"`
}
// PlanTier configures tiered pricing
type PlanTier struct {
Amount int64 `json:"amount"`
UpTo int64 `json:"up_to"`
}
// PlanTransformUsage represents the bucket billing configuration.
type PlanTransformUsage struct {
DivideBy int64 `json:"divide_by"`
Round PlanTransformUsageRound `json:"round"`
}
// PlanTransformUsageParams represents the bucket billing configuration.
type PlanTransformUsageParams struct {
DivideBy *int64 `form:"divide_by"`
Round *string `form:"round"`
}
// PlanTierParams configures tiered pricing
type PlanTierParams struct {
Params `form:"*"`
Amount *int64 `form:"amount"`
UpTo *int64 `form:"-"` // handled in custom AppendTo
UpToInf *bool `form:"-"` // handled in custom AppendTo
}
// AppendTo implements custom up_to serialisation logic for tiers configuration
func (p *PlanTierParams) AppendTo(body *form.Values, keyParts []string) {
if BoolValue(p.UpToInf) {
body.Add(form.FormatKey(append(keyParts, "up_to")), "inf")
} else {
body.Add(form.FormatKey(append(keyParts, "up_to")), strconv.FormatInt(Int64Value(p.UpTo), 10))
}
}
// PlanProductParams is the set of parameters that can be used when creating a product inside a plan
// This can only be used on plan creation and won't work on plan update.
// For more details see https://stripe.com/docs/api#create_plan-product and https://stripe.com/docs/api#update_plan-product
type PlanProductParams struct {
ID *string `form:"id"`
Name *string `form:"name"`
Metadata map[string]string `form:"metadata"`
StatementDescriptor *string `form:"statement_descriptor"`
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。