Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WebhookEndpoint ¶
type WebhookEndpoint struct {
mixin.Model[WebhookEndpoint]
// URL to POST events to
Url string `json:"url"`
// HMAC signing secret (auto-generated)
Secret string `json:"secret,omitempty"`
// Enabled/disabled status
Status string `json:"status"`
// Event types to receive, e.g. ["invoice.paid", "payment_intent.succeeded"]
// Empty list means all events.
Events []string `json:"events,omitempty" datastore:"-"`
Events_ string `json:"-" datastore:",noindex"`
Description string `json:"description,omitempty"`
Metadata Map `json:"metadata,omitempty" datastore:"-"`
Metadata_ string `json:"-" datastore:",noindex"`
}
WebhookEndpoint configures an HTTP endpoint that receives billing events.
func New ¶
func New(db *datastore.Datastore) *WebhookEndpoint
func (*WebhookEndpoint) Defaults ¶
func (w *WebhookEndpoint) Defaults()
func (*WebhookEndpoint) MatchesEvent ¶
func (w *WebhookEndpoint) MatchesEvent(eventType string) bool
MatchesEvent returns true if this endpoint should receive the given event type.
func (*WebhookEndpoint) Save ¶
func (w *WebhookEndpoint) Save() (ps []datastore.Property, err error)
func (*WebhookEndpoint) Validator ¶
func (w *WebhookEndpoint) Validator() *val.Validator
Click to show internal directories.
Click to hide internal directories.