api

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "2018-03-22"

Variables

This section is empty.

Functions

func CompareWebhookSignature

func CompareWebhookSignature(_ context.Context, req *entity.WebhookResource, receivedSignature, sharedSecretKey string) error

func CreateWebhookSignature

func CreateWebhookSignature(_ context.Context, req *entity.WebhookResource, sharedSecretKey string) (string, error)

func DefaultHeaders

func DefaultHeaders(key string) map[string]string

func NewRestyClient

func NewRestyClient(cfg Config) *resty.Client

Types

type Charges

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

func NewCharges

func NewCharges(cfg Config) *Charges

func (*Charges) Cancel

func (*Charges) Create

func (*Charges) List

func (*Charges) Resolve

func (*Charges) Show

type Checkouts

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

func NewCheckouts

func NewCheckouts(cfg Config) *Checkouts

func (*Checkouts) Create

func (*Checkouts) Delete

func (*Checkouts) List

func (*Checkouts) Show

func (*Checkouts) Update

type Config

type Config struct {
	// Key is the authentication API key.
	// Most requests to the Commerce API must be authenticated with an API key.
	// You can create an API key in your Settings page after creating a Coinbase Commerce account.
	// Reference: https://commerce.coinbase.com/docs/api/#authentication
	Key string
	// Timeout describes total waiting time before a request is treated as timeout.
	// Optional.
	// Default: 1 min.
	Timeout time.Duration
	// RetryCount describes total number of retry in case error occurred.
	// Optional.
	// Default: 0 = disable retry mechanism.
	RetryCount int
	// RetryMaxWaitTime describes total waiting time between each retry.
	// Optional.
	// Default: 2 second.
	RetryMaxWaitTime time.Duration
	// Debug describes the client to enter debug mode.
	// Debug mode will dump the request and response on each API call.
	// Be warn, credentials data will be dumped too.
	// Ensure you're only this mode on safe environment like local.
	// Optional.
	// Default: false.
	Debug bool
	// HostURL describes the host url target.
	// HostURL can be filled with your fake server host url for testing purpose.
	// Optional.
	// Default: https://api.commerce.coinbase.com
	HostURL string
}

Config is the necessary configuration to call API.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates configuration correctness and fill fields with default configuration if left empty.

type Events

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

func NewEvents

func NewEvents(cfg Config) *Events

func (*Events) List

func (*Events) Show

type EventsItf

type EventsItf interface {
	List(ctx context.Context, req *entity.ListEventsReq) (*entity.ListEventsResp, error)
	Show(ctx context.Context, req *entity.ShowEventReq) (*entity.ShowEventResp, error)
}

type Invoices

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

func NewInvoices

func NewInvoices(cfg Config) *Invoices

func (*Invoices) Create

func (*Invoices) List

func (*Invoices) Resolve

func (*Invoices) Show

func (*Invoices) Void

Jump to

Keyboard shortcuts

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