listener

package
v0.0.0-...-45c4399 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func New

func New(debug bool) *Listener

func (*Listener) WebhooksHandler

func (l *Listener) WebhooksHandler(cb func(err error, n *Subscription)) http.HandlerFunc

Listen for webhooks

type Subscription

type Subscription struct {
	ID           string `json:"id"`
	ResourceType string `json:"resource_type"`
	EventType    string `json:"event_type"`
	Summary      string `json:"summary"`
	Resource     struct {
		ID         string `json:"id"`
		Subscriber struct {
			ID        string `json:"id"`
			Summary   string `json:"summary"`
			EventType string `json:"event_type"`
			Name      struct {
				GivenName string `json:"given_name"`
				SurName   string `json:"surname"`
			} `json:"name"`
			Email string `json:"email_address"`
		} `json:"subscriber"`
		ParentPayment string `json:"parent_payment"`
		Amount        struct {
			Total    string `json:"total"`
			Currency string `json:"currency"`
		} `json:"amount"`
	} `json:"resource"`
}

Jump to

Keyboard shortcuts

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