Documentation ¶
Index ¶
- type BraintreeClient
- func (client *BraintreeClient) Authorize(request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)
- func (client *BraintreeClient) Capture(request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)
- func (client *BraintreeClient) Refund(request *sleet.RefundRequest) (*sleet.RefundResponse, error)
- func (client *BraintreeClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)
- type Credentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BraintreeClient ¶
type BraintreeClient struct {
// contains filtered or unexported fields
}
BraintreeClient uses creds and httpClient to make calls to Braintree service Client functions return error for http error and will return Success=true if action is performed successfully
func NewClient ¶
func NewClient(credentials *Credentials) *BraintreeClient
NewClient creates a Braintree client with creds and default http client
func NewWithHttpClient ¶
func NewWithHttpClient(credentials *Credentials, httpClient *http.Client) *BraintreeClient
NewWithHttpClient creates a Braintree client with creds and user specified http client for custom behavior
func (*BraintreeClient) Authorize ¶
func (client *BraintreeClient) Authorize(request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)
Authorize a transaction. This transaction must be captured to receive funds
func (*BraintreeClient) Capture ¶
func (client *BraintreeClient) Capture(request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)
Capture an authorized transaction with reference and amount
func (*BraintreeClient) Refund ¶
func (client *BraintreeClient) Refund(request *sleet.RefundRequest) (*sleet.RefundResponse, error)
Refund a captured transaction with reference and specified amount
func (*BraintreeClient) Void ¶
func (client *BraintreeClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)
Void an authorized transaction with reference (cancels void)
type Credentials ¶
Credentials specifies account information needed to make API calls to Braintree TODO: Support taking in production environments as well