payment

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasePrice

type BasePrice struct {
	Value    float64  `json:"value"`
	Currency Currency `json:"currency"`
	Unit     Unit     `json:"unit,omitempty"`
	Interval string   `json:"interval,omitempty"`
}

func (BasePrice) ConvertUnit added in v1.11.0

func (p BasePrice) ConvertUnit(to Unit) (BasePrice, error)

func (BasePrice) CurrencyAmount added in v1.11.0

func (p BasePrice) CurrencyAmount() currency.Amount

func (BasePrice) MustConvertUnit added in v1.11.0

func (p BasePrice) MustConvertUnit(to Unit) BasePrice

type Client added in v1.11.0

type Client interface {
	ListPlans() ([]Plan, error)
	ListPaymentProfiles() ([]PaymentProfile, error)
	ConnectProfile(customerNumber string, password string) (*PaymentProfile, error)
}

func NewClient added in v1.11.0

func NewClient(client *lowlevel.SpacesLowlevelClient) Client

type Currency added in v1.11.0

type Currency int
const (
	CurrencyEUR Currency = iota
)

func (*Currency) MarshalJSON added in v1.11.0

func (c *Currency) MarshalJSON() ([]byte, error)

func (*Currency) String added in v1.11.0

func (c *Currency) String() string

func (*Currency) Unit added in v1.11.0

func (c *Currency) Unit() currency.Unit

func (*Currency) UnmarshalJSON added in v1.11.0

func (c *Currency) UnmarshalJSON(input []byte) error

type Exceedance added in v1.11.0

type Exceedance struct {
	Quantity  Quantity  `json:"quantity"`
	BasePrice BasePrice `json:"basePrice"`
}

type Exceedances added in v1.11.0

type Exceedances struct {
	PreProvision Exceedance `json:"preprovision"`
	OnDemand     Exceedance `json:"ondemand"`
}

type ExceedancesWithoutOnDemand added in v1.11.0

type ExceedancesWithoutOnDemand struct {
	PreProvision Exceedance `json:"preprovision"`
}

type PaymentOption

type PaymentOption struct {
	Type          string `json:"type"`
	IBAN          string `json:"iban,omitempty"`
	BIC           string `json:"bic,omitempty"`
	AccountHolder string `json:"accountHolder,omitempty"`
}

type PaymentProfile

type PaymentProfile struct {
	ID              string                         `json:"id"`
	CreatedAt       time.Time                      `json:"createdAt"`
	ModifiedAt      time.Time                      `json:"modifiedAt"`
	ContractPartner PaymentProfileContactWithPhone `json:"contractPartner"`
	InvoiceSettings PaymentProfileInvoiceSettings  `json:"invoiceSettings"`
	Payment         PaymentOption                  `json:"payment"`
}

type PaymentProfileConnectRequest added in v1.11.2

type PaymentProfileConnectRequest struct {
	CustomerNumber string `json:"customerNumber"`
	Password       string `json:"password"`
}

type PaymentProfileContact

type PaymentProfileContact struct {
	FirstName    string                       `json:"firstName"`
	LastName     string                       `json:"lastName"`
	Title        string                       `json:"title,omitempty"`
	Salutation   string                       `json:"salutation"`
	Company      string                       `json:"company,omitempty"`
	Address      PaymentProfileContactAddress `json:"address"`
	EmailAddress string                       `json:"emailAddress"`
}

type PaymentProfileContactAddress

type PaymentProfileContactAddress struct {
	Street      string `json:"street"`
	HouseNumber string `json:"houseNumber"`
	City        string `json:"city"`
	ZIP         string `json:"zip"`
	Country     string `json:"country"`
}

type PaymentProfileContactWithPhone

type PaymentProfileContactWithPhone struct {
	FirstName    string                       `json:"firstName"`
	LastName     string                       `json:"lastName"`
	Title        string                       `json:"title,omitempty"`
	Salutation   string                       `json:"salutation"`
	Company      string                       `json:"company,omitempty"`
	Address      PaymentProfileContactAddress `json:"address"`
	EmailAddress string                       `json:"emailAddress"`
	Phone        string                       `json:"phone"`
}

type PaymentProfileInvoiceSettings

type PaymentProfileInvoiceSettings struct {
	InvoiceRecipient          *PaymentProfileContact `json:"invoiceRecipient,omitempty"`
	AdditionalEmailRecipients []string               `json:"additionalEmailRecipients,omitempty"`
	PrintedInvoices           bool                   `json:"printedInvoices"`
	VatID                     string                 `json:"vatID,omitempty"`
}

type PaymentProfileReferenceInput

type PaymentProfileReferenceInput struct {
	ID string `json:"id"`
}

type Plan

type Plan struct {
	ID        string       `json:"id"`
	Name      string       `json:"name"`
	BasePrice *BasePrice   `json:"basePrice"`
	Features  PlanFeatures `json:"features"`
}

type PlanFeature added in v1.11.0

type PlanFeature struct {
	Included   Quantity    `json:"included"`
	Exceedance Exceedances `json:"exceedance"`
}

type PlanFeatureBackup added in v1.11.0

type PlanFeatureBackup struct {
	MinimumInterval Quantity                  `json:"minimumInterval"`
	Options         []PlanFeatureBackupOption `json:"options,omitempty"`
}

type PlanFeatureBackupOption added in v1.12.0

type PlanFeatureBackupOption struct {
	MinimumInterval Quantity  `json:"minimumInterval"`
	BasePrice       BasePrice `json:"basePrice"`
}

type PlanFeatureScaling added in v1.11.0

type PlanFeatureScaling struct {
	Minimum    Quantity                   `json:"minimum"`
	Maximum    Quantity                   `json:"maximum"`
	Exceedance ExceedancesWithoutOnDemand `json:"exceedance"`
}

type PlanFeatures added in v1.11.0

type PlanFeatures struct {
	Storage PlanFeature        `json:"storage"`
	Stages  PlanFeature        `json:"stages"`
	Backups PlanFeatureBackup  `json:"backups"`
	Scaling PlanFeatureScaling `json:"scaling"`
}

type PlanReferenceInput

type PlanReferenceInput struct {
	ID string `json:"id"`
}

type Quantity added in v1.11.0

type Quantity struct {
	Value uint64 `json:"value"`
	Unit  Unit   `json:"unit"`
}

type SpaceOptionInput added in v1.12.0

type SpaceOptionInput struct {
	BackupIntervalMinutes uint64 `json:"backupIntervalMinutes,omitempty"`
}

type SpaceResourcePreprovisioningInput added in v1.11.0

type SpaceResourcePreprovisioningInput struct {
	Storage *SpaceResourcePreprovisioningInputItem `json:"storage,omitempty"`
	Stages  *SpaceResourcePreprovisioningInputItem `json:"stages,omitempty"`
	Scaling *SpaceResourcePreprovisioningInputItem `json:"scaling,omitempty"`
}

type SpaceResourcePreprovisioningInputItem added in v1.11.0

type SpaceResourcePreprovisioningInputItem struct {
	Quantity uint64 `json:"quantity"`
}

type Unit added in v1.11.0

type Unit int
const (
	UnitBytes     Unit = iota
	UnitGibibytes Unit = iota
	UnitStages
	UnitPods
	UnitMinutes
	UnitMonths
)

func (*Unit) MarshalJSON added in v1.11.0

func (c *Unit) MarshalJSON() ([]byte, error)

func (*Unit) String added in v1.11.0

func (c *Unit) String() string

func (*Unit) UnmarshalJSON added in v1.11.0

func (c *Unit) UnmarshalJSON(input []byte) error

Jump to

Keyboard shortcuts

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