Documentation
¶
Index ¶
- func Query(db *datastore.Datastore) datastore.Query
- type WebhookEndpoint
- func (w *WebhookEndpoint) Defaults()
- func (w *WebhookEndpoint) Init(db *datastore.Datastore)
- func (w WebhookEndpoint) Kind() string
- func (w *WebhookEndpoint) Load(ps []datastore.Property) (err error)
- func (w *WebhookEndpoint) MatchesEvent(eventType string) bool
- func (w *WebhookEndpoint) Save() (ps []datastore.Property, err error)
- func (w *WebhookEndpoint) Validator() *val.Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WebhookEndpoint ¶
type WebhookEndpoint struct {
mixin.BaseModel
// 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) Init ¶
func (w *WebhookEndpoint) Init(db *datastore.Datastore)
func (WebhookEndpoint) Kind ¶
func (w WebhookEndpoint) Kind() string
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.