billingevent

package
v1.46.20 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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