Documentation
¶
Index ¶
- Variables
- func Query(db *datastore.Datastore) datastore.Query
- type BillingType
- type Status
- type Subscription
- func (s *Subscription) Defaults()
- func (s *Subscription) Init(db *datastore.Datastore)
- func (s Subscription) Kind() string
- func (s *Subscription) Load(ps []datastore.Property) (err error)
- func (s Subscription) NumberFromId() (i int, err error)
- func (s Subscription) PeriodsRemaining() int
- func (s *Subscription) Save() (ps []datastore.Property, err error)
- func (s Subscription) TrialPeriodsRemaining() int
- func (s *Subscription) Validator() *val.Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var IgnoreFieldMismatch = datastore.IgnoreFieldMismatch
Functions ¶
Types ¶
type BillingType ¶
type BillingType string
const ( Charge BillingType = "charge_automatically" Invoice BillingType = "send_invoice" )
type Subscription ¶
type Subscription struct {
mixin.BaseModel
Number int `json:"number,omitempty" datastore:"-"`
// Immutable buyer data from time of payment, may or may not be associated
// with a user.
Buyer Buyer `json:"buyer"`
Type BillingType `json:"billing_type"`
PlanId string `json:"planId"`
UserId string `json:"userId"`
FeePercent float64 `json:"application_fee_percent"`
EndCancel bool `json:"cancel_at_period_end"`
PeriodStart time.Time `json:"current_period_start"`
PeriodEnd time.Time `json:"current_period_end"`
Start time.Time `json:"start"`
Ended time.Time `json:"ended_at"`
Canceled bool `json:"canceled"`
CanceledAt time.Time `json:"canceled_at"`
TrialStart time.Time `json:"trial_start"`
TrialEnd time.Time `json:"trial_end"`
Plan plan.Plan `json:"plan"`
Quantity int `json:"quantity"`
Status Status `json:"status"`
Metadata Map `json:"metadata" datastore:"-"`
Metadata_ string `json:"-" datastore:"-"`
// Stripe livemode
Live bool `json:"live"`
// Internal testing flag
Test bool `json:"-"`
Account accounts.Account `json:"account,omitempty"`
Ref refs.EcommerceRef `json:"ref,omitempty"`
}
func Fake ¶
func Fake(db *datastore.Datastore) *Subscription
func New ¶
func New(db *datastore.Datastore) *Subscription
func (*Subscription) Defaults ¶
func (s *Subscription) Defaults()
func (*Subscription) Init ¶
func (s *Subscription) Init(db *datastore.Datastore)
func (Subscription) Kind ¶
func (s Subscription) Kind() string
func (Subscription) NumberFromId ¶
func (s Subscription) NumberFromId() (i int, err error)
func (Subscription) PeriodsRemaining ¶
func (s Subscription) PeriodsRemaining() int
func (Subscription) TrialPeriodsRemaining ¶
func (s Subscription) TrialPeriodsRemaining() int
func (*Subscription) Validator ¶
func (s *Subscription) Validator() *val.Validator
Click to show internal directories.
Click to hide internal directories.