events

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	API checkout.HTTPClient
}

Client ...

func NewClient

func NewClient(config checkout.Config) *Client

NewClient ...

func (*Client) RetrieveEvent

func (c *Client) RetrieveEvent(eventID string) (*Response, error)

RetrieveEvent -

func (*Client) RetrieveEventNotification

func (c *Client) RetrieveEventNotification(eventID string, notificationID string) (*Response, error)

RetrieveEventNotification -

func (*Client) RetrieveEventTypes

func (c *Client) RetrieveEventTypes(request *Request) (*Response, error)

RetrieveEventTypes -

func (*Client) RetrieveEvents

func (c *Client) RetrieveEvents(request *Request) (*Response, error)

RetrieveEvents -

func (*Client) Retry

func (c *Client) Retry(eventID string, webhookID string) (*Response, error)

Retry -

func (*Client) RetryAll

func (c *Client) RetryAll(eventID string) (*Response, error)

RetryAll -

type Event

type Event struct {
	ID            string                 `json:"id,omitempty"`
	Type          string                 `json:"type,omitempty"`
	Version       string                 `json:"version,omitempty"`
	CreatedOn     string                 `json:"created_on,omitempty"`
	Data          *payments.Processed    `json:"data,omitempty"`
	Notifications []Notification         `json:"notifications,omitempty"`
	Links         map[string]common.Link `json:"_links"`
}

Event -

type EventType

type EventType struct {
	Version    string   `json:"version,omitempty"`
	EventTypes []string `json:"event_types,omitempty"`
}

EventType -

type EventTypeRequest

type EventTypeRequest struct {
	Version string `url:"version,omitempty"`
}

EventTypeRequest -

type Events

type Events struct {
	TotalCount uint64    `json:"total_count,omitempty"`
	Limit      uint64    `json:"limit,omitempty"`
	Skip       uint64    `json:"skip,omitempty"`
	From       time.Time `json:"from,omitempty"`
	To         time.Time `json:"to,omitempty"`
	Data       []Event   `json:"data,omitempty"`
}

Events -

type Notification

type Notification struct {
	ID          string                 `json:"id,omitempty"`
	URL         string                 `json:"url,omitempty"`
	Success     *bool                  `json:"success,omitempty"`
	ContentType string                 `json:"content_type,omitempty"`
	Attempts    []NotificationAttempt  `json:"attempts,omitempty"`
	Links       map[string]common.Link `json:"_links"`
}

Notification -

type NotificationAttempt

type NotificationAttempt struct {
	StatusCode   uint64    `json:"status_code,omitempty"`
	ResponseBody string    `json:"response_body,omitempty"`
	RetryMode    string    `json:"retry_mode,omitempty"`
	Timestamp    time.Time `json:"timestamp,omitempty"`
}

NotificationAttempt -

type QueryParameter

type QueryParameter struct {
	From      time.Time `url:"from,omitempty"`
	To        time.Time `url:"to,omitempty"`
	Limit     uint64    `url:"limit,omitempty"`
	PaymentID string    `url:"payment_id,omitempty"`
}

QueryParameter -

type Request

type Request struct {
	*QueryParameter
	*EventTypeRequest
}

Request -

type Response

type Response struct {
	StatusResponse *checkout.StatusResponse `json:"api_response,omitempty"`
	EventTypes     []EventType              `json:"event_types,omitempty"`
	Events         *Events                  `json:"events,omitempty"`
	Event          *Event                   `json:"event,omitempty"`
	Notification   *Notification            `json:"notification,omitempty"`
}

Response -

Jump to

Keyboard shortcuts

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