workflows

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Type      ActionType `json:"type,omitempty"`
	URL       string     `json:"url,omitempty"`
	Headers   *Headers   `json:"headers,omitempty"`
	Signature *Signature `json:"signature,omitempty"`
}

type ActionResponse

type ActionResponse struct {
	ID        string        `json:"id,omitempty"`
	Type      ActionType    `json:"type,omitempty"`
	URL       string        `json:"url,omitempty"`
	Headers   Headers       `json:"headers,omitempty"`
	Signature Signature     `json:"signature,omitempty"`
	Links     []common.Link `json:"links,omitempty"`
}

type ActionType

type ActionType string
const (
	WebhookType ActionType = "webhook"
)

type Client

type Client struct {
	API checkout.HTTPClient
}

func NewClient

func NewClient(config checkout.Config) *Client

func (*Client) PartiallyUpdate

func (c *Client) PartiallyUpdate(workflowID string, request *Request) (*Response, error)

func (*Client) Register

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

func (*Client) Remove

func (c *Client) Remove(workflowID string) (*Response, error)

func (*Client) RetrieveAll

func (c *Client) RetrieveAll() (*Response, error)

func (*Client) RetrieveSingle

func (c *Client) RetrieveSingle(workflowID string) (*Response, error)

func (*Client) Test

func (c *Client) Test(workflowID string, request *TestRequest) (*Response, error)

func (*Client) Update

func (c *Client) Update(workflowID string, request *Request) (*Response, error)

type Condition

type Condition struct {
	Type   ConditionType `json:"type,omitempty"`
	Events Events        `json:"events,omitempty"`
}

type ConditionResponse

type ConditionResponse struct {
	ID                 string        `json:"id,omitempty"`
	Type               ConditionType `json:"type,omitempty"`
	Events             Events        `json:"events,omitempty"`
	Entities           []string      `json:"entities,omitempty"`
	ProcessingChannels []string      `json:"processing_channels,omitempty"`
	Links              []common.Link `json:"links,omitempty"`
}

type ConditionType

type ConditionType string
const (
	EventType         ConditionType = "event"
	EntityType        ConditionType = "entity"
	ProcessingChannel ConditionType = "processing_channel"
)

type Events

type Events struct {
	Gateway []WebhookEvent `json:"gateway,omitempty"`
	Dispute []WebhookEvent `json:"dispute,omitempty"`
}

type Headers

type Headers struct {
	Authorization string `json:"Authorization,omitempty"`
}

type Request

type Request struct {
	*Workflow
}

type Response

type Response struct {
	StatusResponse *checkout.StatusResponse `json:"api_response,omitempty"`
	Workflows      []WorkflowResponse       `json:"workflows,omitempty"`
	Workflow       *WorkflowResponse        `json:"workflow,omitempty"`
}

type Signature

type Signature struct {
	Method string `json:"method,omitempty"`
	Key    string `json:"key,omitempty"`
}

type TestRequest

type TestRequest struct {
	EventTypes []WebhookEvent `json:"event_types"`
}

type WebhookEvent

type WebhookEvent string
const (
	// Gateway
	CardVerifiedEvent             WebhookEvent = "card_verified"
	CardVerificationDeclinedEvent WebhookEvent = "card_verification_declined"
	PaymentApprovedEvent          WebhookEvent = "payment_approved"
	PaymentPendingEvent           WebhookEvent = "payment_pending"
	PaymentDeclinedEvent          WebhookEvent = "payment_declined"
	PaymentExpiredEvent           WebhookEvent = "payment_expired"
	PaymentVoidedEvent            WebhookEvent = "payment_voided"
	PaymentCanceledEvent          WebhookEvent = "payment_canceled"
	PaymentVoidDeclinedEvent      WebhookEvent = "payment_void_declined"
	PaymentCapturedEvent          WebhookEvent = "payment_captured"
	PaymentCaptureDeclinedEvent   WebhookEvent = "payment_capture_declined"
	PaymentCapturePendingEvent    WebhookEvent = "payment_capture_pending"
	PaymentRefundedEvent          WebhookEvent = "payment_refunded"
	PaymentRefundDeclinedEvent    WebhookEvent = "payment_refund_declined"
	PaymentRefundPendingEvent     WebhookEvent = "payment_refund_pending"
	PaymentChargebackEvent        WebhookEvent = "payment_chargeback"
	PaymentRetrievalEvent         WebhookEvent = "payment_retrieval"
	SourceUpdatedEvent            WebhookEvent = "source_updated"
	PaymentPaidEvent              WebhookEvent = "payment_paid"

	// Dispute
	DisputeCanceledEvent         WebhookEvent = "dispute_canceled"
	DisputeEvidenceRequiredEvent WebhookEvent = "dispute_evidence_required"
	DisputeExpiredEvent          WebhookEvent = "dispute_expired"
	DisputeLostEvent             WebhookEvent = "dispute_lost"
	DisputeResolvedEvent         WebhookEvent = "dispute_resolved"
	DisputeWonEvent              WebhookEvent = "dispute_won"
)

type Workflow

type Workflow struct {
	Name       string      `json:"name,omitempty"`
	Active     bool        `json:"active,omitempty"`
	Conditions []Condition `json:"conditions,omitempty"`
	Actions    []Action    `json:"actions,omitempty"`
}

type WorkflowResponse

type WorkflowResponse struct {
	ID         string              `json:"id,omitempty"`
	Name       string              `json:"name,omitempty"`
	Active     bool                `json:"active,omitempty"`
	Conditions []ConditionResponse `json:"conditions,omitempty"`
	Actions    []ActionResponse    `json:"actions,omitempty"`
}

Jump to

Keyboard shortcuts

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