paymentsconfig

package
v1.101.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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
	BonusRate           int64                      `help:"amount of percents that user will earn as bonus credits by depositing in STORJ tokens" default:"10"`
	UsagePriceOverrides ProjectUsagePriceOverrides `` /* 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 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.

type ProjectUsagePriceOverrides added in v1.70.1

type ProjectUsagePriceOverrides struct {
	// contains filtered or unexported fields
}

ProjectUsagePriceOverrides represents a mapping between partners and project usage price overrides.

func (*ProjectUsagePriceOverrides) Set added in v1.70.1

Set sets the list of price overrides to the parsed string.

func (*ProjectUsagePriceOverrides) SetMap added in v1.71.1

func (p *ProjectUsagePriceOverrides) SetMap(overrides map[string]ProjectUsagePrice)

SetMap sets the internal mapping between partners and project usage prices.

func (*ProjectUsagePriceOverrides) String added in v1.70.1

func (p *ProjectUsagePriceOverrides) String() string

String returns the string representation of the price overrides.

func (ProjectUsagePriceOverrides) ToModels added in v1.70.1

ToModels returns the price overrides represented as a mapping between partners and project usage price models.

func (ProjectUsagePriceOverrides) Type added in v1.70.1

Type returns the type of the pflag.Value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL