Documentation
¶
Index ¶
- func Query(db *datastore.Datastore) datastore.Query
- type BillingEvent
- func (e *BillingEvent) Defaults()
- func (e *BillingEvent) Init(db *datastore.Datastore)
- func (e BillingEvent) Kind() string
- func (e *BillingEvent) Load(ps []datastore.Property) (err error)
- func (e *BillingEvent) Save() (ps []datastore.Property, err error)
- func (e *BillingEvent) Validator() *val.Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BillingEvent ¶
type BillingEvent struct {
mixin.BaseModel
// Event type, e.g. "payment_intent.succeeded", "invoice.paid", "subscription.updated"
Type string `json:"type"`
// Object type, e.g. "payment_intent", "invoice", "subscription"
ObjectType string `json:"objectType"`
// ID of the object that changed
ObjectId string `json:"objectId"`
// Customer/user this event relates to
CustomerId string `json:"customerId,omitempty"`
// Snapshot of the object at event time
Data Map `json:"data,omitempty" datastore:"-"`
Data_ string `json:"-" datastore:",noindex"`
// Previous state (for update events)
PreviousData Map `json:"previousData,omitempty" datastore:"-"`
PreviousData_ string `json:"-" datastore:",noindex"`
// Whether webhooks have been fully dispatched
Pending bool `json:"pending"`
// Live vs test mode
Livemode bool `json:"livemode"`
}
BillingEvent is an append-only record of a billing state change. Events are the source of truth for all billing mutations and drive webhook delivery to external consumers.
func New ¶
func New(db *datastore.Datastore) *BillingEvent
func (*BillingEvent) Defaults ¶
func (e *BillingEvent) Defaults()
func (*BillingEvent) Init ¶
func (e *BillingEvent) Init(db *datastore.Datastore)
func (BillingEvent) Kind ¶
func (e BillingEvent) Kind() string
func (*BillingEvent) Validator ¶
func (e *BillingEvent) Validator() *val.Validator
Click to show internal directories.
Click to hide internal directories.