Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Error = errs.Class("payments config")
Error is payments config err class.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Provider string `help:"payments provider to use" default:""` MockProvider stripe.Client `internal:"true"` BillingConfig billing.Config StripeCoinPayments stripe.Config Storjscan storjscan.Config UsagePrice ProjectUsagePrice // TODO: if we decide to put default product in here and change away from overrides, change the type name. Products PriceOverrides `` /* 219-byte string literal not displayed */ PlacementPriceOverrides PlacementProductMap `` /* 265-byte string literal not displayed */ PartnersPlacementPriceOverrides PartnersPlacementProductMap `` /* 304-byte string literal not displayed */ BonusRate int64 `help:"amount of percents that user will earn as bonus credits by depositing in STORJ tokens" default:"10"` UsagePriceOverrides PriceOverrides `` /* 196-byte string literal not displayed */ PackagePlans PackagePlans `help:"semicolon-separated partner package plans in the format partner:price,credit. Price and credit are in cents USD."` }
Config defines global payments config.
type PackagePlans ¶ added in v1.72.2
type PackagePlans struct {
Packages map[string]payments.PackagePlan
}
PackagePlans contains one time prices for partners.
func (*PackagePlans) Get ¶ added in v1.72.2
func (p *PackagePlans) Get(userAgent []byte) (pkg payments.PackagePlan, err error)
Get a package plan by user agent.
func (*PackagePlans) Set ¶ added in v1.72.2
func (p *PackagePlans) Set(s string) error
Set sets the list of pricing plans to the parsed string.
func (*PackagePlans) String ¶ added in v1.72.2
func (p *PackagePlans) String() string
String returns the string representation of the package plans.
func (PackagePlans) Type ¶ added in v1.72.2
func (PackagePlans) Type() string
Type returns the type of the pflag.Value.
type PartnersPlacementProductMap ¶ added in v1.119.2
type PartnersPlacementProductMap struct {
// contains filtered or unexported fields
}
PartnersPlacementProductMap maps partners to placements to products map.
func (*PartnersPlacementProductMap) Set ¶ added in v1.119.2
func (p *PartnersPlacementProductMap) Set(s string) error
Set sets the partners placements to products mappings to the parsed string.
func (*PartnersPlacementProductMap) String ¶ added in v1.119.2
func (p *PartnersPlacementProductMap) String() string
String returns the string representation of the partners to placements to product map. Partner configs are sorted in ascending order by partner name.
func (PartnersPlacementProductMap) Type ¶ added in v1.119.2
func (PartnersPlacementProductMap) Type() string
Type returns the type of the pflag.Value.
type PlacementProductMap ¶ added in v1.119.2
type PlacementProductMap struct {
// contains filtered or unexported fields
}
PlacementProductMap maps placements to products.
func (*PlacementProductMap) Set ¶ added in v1.119.2
func (p *PlacementProductMap) Set(s string) error
Set sets the placement to product mappings to the parsed string.
func (*PlacementProductMap) String ¶ added in v1.119.2
func (p *PlacementProductMap) String() string
String returns the string representation of the placements to product map. Placements of a single key-value pair are sorted and the greater key-value strings themselves are sorted in ascending order.
func (PlacementProductMap) Type ¶ added in v1.119.2
func (PlacementProductMap) Type() string
Type returns the type of the pflag.Value.
type PriceOverrides ¶ added in v1.119.2
type PriceOverrides struct {
// contains filtered or unexported fields
}
PriceOverrides represents a mapping between a string and price overrides.
func (*PriceOverrides) Set ¶ added in v1.119.2
func (p *PriceOverrides) Set(s string) error
Set sets the list of price overrides to the parsed string.
func (*PriceOverrides) SetMap ¶ added in v1.119.2
func (p *PriceOverrides) SetMap(overrides map[string]ProjectUsagePrice)
SetMap sets the internal mapping between a string and usage prices.
func (*PriceOverrides) String ¶ added in v1.119.2
func (p *PriceOverrides) String() string
String returns the string representation of the price overrides.
func (PriceOverrides) ToModels ¶ added in v1.119.2
func (p PriceOverrides) ToModels() (map[string]payments.ProjectUsagePriceModel, error)
ToModels returns the price overrides represented as a mapping between a string and usage price models.
func (PriceOverrides) Type ¶ added in v1.119.2
func (PriceOverrides) Type() string
Type returns the type of the pflag.Value.
type ProjectUsagePrice ¶ added in v1.70.1
type ProjectUsagePrice struct { StorageTB string `help:"price user should pay for storage per month in dollars/TB" default:"4" testDefault:"10"` EgressTB string `help:"price user should pay for egress in dollars/TB" default:"7" testDefault:"45"` Segment string `` /* 132-byte string literal not displayed */ EgressDiscountRatio float64 `internal:"true"` }
ProjectUsagePrice holds the configuration for the satellite's project usage price model.
func (ProjectUsagePrice) ToModel ¶ added in v1.70.1
func (p ProjectUsagePrice) ToModel() (model payments.ProjectUsagePriceModel, err error)
ToModel returns the payments.ProjectUsagePriceModel representation of the project usage price.