billingevent

package
v1.37.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type BillingEvent

type BillingEvent struct {
	mixin.Model[BillingEvent]

	// 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" orm:"default:true"`

	// Live vs test mode
	Livemode bool `json:"livemode" orm:"default:true"`
}

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 (*BillingEvent) Load

func (e *BillingEvent) Load(ps []datastore.Property) (err error)

func (*BillingEvent) Save

func (e *BillingEvent) Save() (ps []datastore.Property, err error)

func (*BillingEvent) Validator

func (e *BillingEvent) Validator() *val.Validator

Jump to

Keyboard shortcuts

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