Documentation ¶
Index ¶
- Variables
- type MigrateWebhookFailHandler
- type Stripe
- func (sApi *Stripe) Client() *client.API
- func (sApi *Stripe) CreateWebhook(input WebhookInput) (*stripe.WebhookEndpoint, error)
- func (sApi *Stripe) MigrateWebhook(input WebhookInput, onFail MigrateWebhookFailHandler)
- func (sApi *Stripe) PublicSettings() StripePublicSettings
- func (sApi *Stripe) WebUrl(stripeId string) string
- func (sApi *Stripe) WebhookHandlerFunc(onWebhook StripeEventHandler, onError func(err error)) http.HandlerFunc
- type StripeEventHandler
- type StripePublicSettings
- type WebhookInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoWebhook = errors.Errorf("Stripe webhook does not exist")
View Source
var ErrNoWebhookSecret = errors.Errorf("FATAL: Webhook exists but webhook secret is not configured, find it at https://dashboard.stripe.com/")
Functions ¶
This section is empty.
Types ¶
type MigrateWebhookFailHandler ¶ added in v0.0.25
type MigrateWebhookFailHandler func(err error)
type Stripe ¶
type Stripe struct {
// contains filtered or unexported fields
}
func (*Stripe) CreateWebhook ¶
func (sApi *Stripe) CreateWebhook(input WebhookInput) (*stripe.WebhookEndpoint, error)
func (*Stripe) MigrateWebhook ¶
func (sApi *Stripe) MigrateWebhook(input WebhookInput, onFail MigrateWebhookFailHandler)
MigrateWebhook asynchronously checks stripe API for an existing webhook and updates the subscribed events if needed. onFail is called if a webhook for the given url does not exist or the webhook secret is not set.
func (*Stripe) PublicSettings ¶ added in v0.1.4
func (sApi *Stripe) PublicSettings() StripePublicSettings
func (*Stripe) WebhookHandlerFunc ¶
func (sApi *Stripe) WebhookHandlerFunc(onWebhook StripeEventHandler, onError func(err error)) http.HandlerFunc
type StripeEventHandler ¶
type StripePublicSettings ¶ added in v0.1.4
type StripePublicSettings struct {
StripePublicKey string `json:"stripePublicKey"`
}
type WebhookInput ¶
type WebhookInput struct { // Events to subscribe to i.e. checkout.session.completed, // payment_intent.succeeded, charge.refunded. // https://stripe.com/docs/api/events/types Events []string // The full url for the webhook i.e. https://example.com/webhook/stripe Url string }
Click to show internal directories.
Click to hide internal directories.