Documentation
¶
Index ¶
- type Client
- func (c Client) CancelCharge(ctx context.Context, req *entity.CancelChargeReq) (*entity.CancelChargeResp, error)
- func (c Client) CreateCharge(ctx context.Context, req *entity.CreateChargeReq) (*entity.CreateChargeResp, error)
- func (c Client) ListCharges(ctx context.Context, req *entity.ListChargesReq) (*entity.ListChargesResp, error)
- func (c Client) ResolveCharge(ctx context.Context, req *entity.ResolveChargeReq) (*entity.ResolveChargeResp, error)
- func (c Client) ShowCharge(ctx context.Context, req *entity.ShowChargeReq) (*entity.ShowChargeResp, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the main client to interact with Coinbase Commerce API.
func (Client) CancelCharge ¶
func (c Client) CancelCharge(ctx context.Context, req *entity.CancelChargeReq) (*entity.CancelChargeResp, error)
CancelCharge cancels a charge that has been previously created. Supply the unique charge code or id that was returned when the charge was created. This information is also returned when a charge is first created.
Note: Only new charges can be successfully canceled. Once payment is detected, charge can no longer be canceled.
Reference: https://commerce.coinbase.com/docs/api/#cancel-a-charge
func (Client) CreateCharge ¶
func (c Client) CreateCharge(ctx context.Context, req *entity.CreateChargeReq) (*entity.CreateChargeResp, error)
CreateCharge charge a customer with certain amount of currency. To get paid in cryptocurrency, you need to create a charge object and provide the user with a cryptocurrency address to which they must send cryptocurrency. Once a charge is created a customer must broadcast a payment to the blockchain before the charge expires. Reference: https://commerce.coinbase.com/docs/api/#create-a-charge
func (Client) ListCharges ¶
func (c Client) ListCharges(ctx context.Context, req *entity.ListChargesReq) (*entity.ListChargesResp, error)
ListCharges lists all the charges. Reference: https://commerce.coinbase.com/docs/api/#list-charges
func (Client) ResolveCharge ¶
func (c Client) ResolveCharge(ctx context.Context, req *entity.ResolveChargeReq) (*entity.ResolveChargeResp, error)
ResolveCharge resolves a charge that has been previously marked as unresolved. Supply the unique charge code or id that was returned when the charge was created. This information is also returned when a charge is first created.
Note: Only unresolved charges can be successfully resolved
Reference: https://commerce.coinbase.com/docs/api/#resolve-a-charge
func (Client) ShowCharge ¶
func (c Client) ShowCharge(ctx context.Context, req *entity.ShowChargeReq) (*entity.ShowChargeResp, error)
ShowCharge retrieves the details of a charge that has been previously created. Supply the unique charge code or id that was returned when the charge was created. This information is also returned when a charge is first created. Reference: https://commerce.coinbase.com/docs/api/#show-a-charge