Documentation
¶
Index ¶
- Constants
- func CompareWebhookSignature(_ context.Context, req *entity.WebhookResource, ...) error
- func CreateWebhookSignature(_ context.Context, req *entity.WebhookResource, sharedSecretKey string) (string, error)
- func DefaultHeaders(key string) map[string]string
- func NewRestyClient(cfg Config) *resty.Client
- type Charges
- func (c *Charges) Cancel(ctx context.Context, req *entity.CancelChargeReq) (*entity.CancelChargeResp, error)
- func (c *Charges) Create(ctx context.Context, req *entity.CreateChargeReq) (*entity.CreateChargeResp, error)
- func (c *Charges) List(ctx context.Context, req *entity.ListChargesReq) (*entity.ListChargesResp, error)
- func (c *Charges) Resolve(ctx context.Context, req *entity.ResolveChargeReq) (*entity.ResolveChargeResp, error)
- func (c *Charges) Show(ctx context.Context, req *entity.ShowChargeReq) (*entity.ShowChargeResp, error)
- type ChargesItf
- type Checkouts
- func (c *Checkouts) Create(ctx context.Context, req *entity.CreateCheckoutReq) (*entity.CreateCheckoutResp, error)
- func (c *Checkouts) Delete(ctx context.Context, req *entity.DeleteCheckoutReq) (*entity.DeleteCheckoutResp, error)
- func (c *Checkouts) List(ctx context.Context, req *entity.ListCheckoutsReq) (*entity.ListCheckoutsResp, error)
- func (c *Checkouts) Show(ctx context.Context, req *entity.ShowCheckoutReq) (*entity.ShowCheckoutResp, error)
- func (c *Checkouts) Update(ctx context.Context, req *entity.UpdateCheckoutReq) (*entity.UpdateCheckoutResp, error)
- type CheckoutsItf
- type Config
- type Events
- type EventsItf
- type Invoices
- func (c *Invoices) Create(ctx context.Context, req *entity.CreateInvoiceReq) (*entity.CreateInvoiceResp, error)
- func (c *Invoices) List(ctx context.Context, req *entity.ListInvoicesReq) (*entity.ListInvoicesResp, error)
- func (c *Invoices) Resolve(ctx context.Context, req *entity.ResolveInvoiceReq) (*entity.ResolveInvoiceResp, error)
- func (c *Invoices) Show(ctx context.Context, req *entity.ShowInvoiceReq) (*entity.ShowInvoiceResp, error)
- func (c *Invoices) Void(ctx context.Context, req *entity.VoidInvoiceReq) (*entity.VoidInvoiceResp, error)
- type InvoicesItf
Constants ¶
View Source
const Version = "2018-03-22"
Variables ¶
This section is empty.
Functions ¶
func CompareWebhookSignature ¶
func CreateWebhookSignature ¶
func DefaultHeaders ¶
func NewRestyClient ¶
func NewRestyClient(cfg Config) *resty.Client
Types ¶
type Charges ¶
type Charges struct {
// contains filtered or unexported fields
}
func NewCharges ¶
func (*Charges) Cancel ¶
func (c *Charges) Cancel(ctx context.Context, req *entity.CancelChargeReq) (*entity.CancelChargeResp, error)
func (*Charges) Create ¶
func (c *Charges) Create(ctx context.Context, req *entity.CreateChargeReq) (*entity.CreateChargeResp, error)
func (*Charges) List ¶
func (c *Charges) List(ctx context.Context, req *entity.ListChargesReq) (*entity.ListChargesResp, error)
func (*Charges) Resolve ¶
func (c *Charges) Resolve(ctx context.Context, req *entity.ResolveChargeReq) (*entity.ResolveChargeResp, error)
func (*Charges) Show ¶
func (c *Charges) Show(ctx context.Context, req *entity.ShowChargeReq) (*entity.ShowChargeResp, error)
type ChargesItf ¶
type ChargesItf interface { Create(ctx context.Context, req *entity.CreateChargeReq) (*entity.CreateChargeResp, error) Show(ctx context.Context, req *entity.ShowChargeReq) (*entity.ShowChargeResp, error) List(ctx context.Context, req *entity.ListChargesReq) (*entity.ListChargesResp, error) Cancel(ctx context.Context, req *entity.CancelChargeReq) (*entity.CancelChargeResp, error) Resolve(ctx context.Context, req *entity.ResolveChargeReq) (*entity.ResolveChargeResp, error) }
type Checkouts ¶
type Checkouts struct {
// contains filtered or unexported fields
}
func NewCheckouts ¶
func (*Checkouts) Create ¶
func (c *Checkouts) Create(ctx context.Context, req *entity.CreateCheckoutReq) (*entity.CreateCheckoutResp, error)
func (*Checkouts) Delete ¶
func (c *Checkouts) Delete(ctx context.Context, req *entity.DeleteCheckoutReq) (*entity.DeleteCheckoutResp, error)
func (*Checkouts) List ¶
func (c *Checkouts) List(ctx context.Context, req *entity.ListCheckoutsReq) (*entity.ListCheckoutsResp, error)
func (*Checkouts) Show ¶
func (c *Checkouts) Show(ctx context.Context, req *entity.ShowCheckoutReq) (*entity.ShowCheckoutResp, error)
func (*Checkouts) Update ¶
func (c *Checkouts) Update(ctx context.Context, req *entity.UpdateCheckoutReq) (*entity.UpdateCheckoutResp, error)
type CheckoutsItf ¶
type CheckoutsItf interface { List(ctx context.Context, req *entity.ListCheckoutsReq) (*entity.ListCheckoutsResp, error) Show(ctx context.Context, req *entity.ShowCheckoutReq) (*entity.ShowCheckoutResp, error) Create(ctx context.Context, req *entity.CreateCheckoutReq) (*entity.CreateCheckoutResp, error) Update(ctx context.Context, req *entity.UpdateCheckoutReq) (*entity.UpdateCheckoutResp, error) Delete(ctx context.Context, req *entity.DeleteCheckoutReq) (*entity.DeleteCheckoutResp, error) }
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.
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
func (*Events) List ¶
func (c *Events) List(ctx context.Context, req *entity.ListEventsReq) (*entity.ListEventsResp, error)
func (*Events) Show ¶
func (c *Events) Show(ctx context.Context, req *entity.ShowEventReq) (*entity.ShowEventResp, error)
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 (*Invoices) Create ¶
func (c *Invoices) Create(ctx context.Context, req *entity.CreateInvoiceReq) (*entity.CreateInvoiceResp, error)
func (*Invoices) List ¶
func (c *Invoices) List(ctx context.Context, req *entity.ListInvoicesReq) (*entity.ListInvoicesResp, error)
func (*Invoices) Resolve ¶
func (c *Invoices) Resolve(ctx context.Context, req *entity.ResolveInvoiceReq) (*entity.ResolveInvoiceResp, error)
func (*Invoices) Show ¶
func (c *Invoices) Show(ctx context.Context, req *entity.ShowInvoiceReq) (*entity.ShowInvoiceResp, error)
func (*Invoices) Void ¶
func (c *Invoices) Void(ctx context.Context, req *entity.VoidInvoiceReq) (*entity.VoidInvoiceResp, error)
type InvoicesItf ¶
type InvoicesItf interface { List(ctx context.Context, req *entity.ListInvoicesReq) (*entity.ListInvoicesResp, error) Show(ctx context.Context, req *entity.ShowInvoiceReq) (*entity.ShowInvoiceResp, error) Create(ctx context.Context, req *entity.CreateInvoiceReq) (*entity.CreateInvoiceResp, error) Void(ctx context.Context, req *entity.VoidInvoiceReq) (*entity.VoidInvoiceResp, error) Resolve(ctx context.Context, req *entity.ResolveInvoiceReq) (*entity.ResolveInvoiceResp, error) }
Click to show internal directories.
Click to hide internal directories.