Documentation ¶
Index ¶
- type BraintreeClient
- func (client *BraintreeClient) Authorize(request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)
- func (client *BraintreeClient) AuthorizeWithContext(ctx context.Context, request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)
- func (client *BraintreeClient) Capture(request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)
- func (client *BraintreeClient) CaptureWithContext(ctx context.Context, request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)
- func (client *BraintreeClient) Refund(request *sleet.RefundRequest) (*sleet.RefundResponse, error)
- func (client *BraintreeClient) RefundWithContext(ctx context.Context, request *sleet.RefundRequest) (*sleet.RefundResponse, error)
- func (client *BraintreeClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)
- func (client *BraintreeClient) VoidWithContext(ctx context.Context, request *sleet.VoidRequest) (*sleet.VoidResponse, error)
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(merchantID string, publicKey string, privateKey string, environment common.Environment) *BraintreeClient
NewClient creates a Braintree client with creds and default http client
func NewWithHttpClient ¶
func NewWithHttpClient(merchantID string, publicKey string, privateKey string, environment common.Environment, 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) AuthorizeWithContext ¶ added in v1.1.1297
func (client *BraintreeClient) AuthorizeWithContext(ctx context.Context, request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)
AuthorizeWithContext authorizes 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) CaptureWithContext ¶ added in v1.1.1297
func (client *BraintreeClient) CaptureWithContext(ctx context.Context, request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)
CaptureWithContext captures 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) RefundWithContext ¶ added in v1.1.1297
func (client *BraintreeClient) RefundWithContext(ctx context.Context, request *sleet.RefundRequest) (*sleet.RefundResponse, error)
RefundWithContext captures 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)
func (*BraintreeClient) VoidWithContext ¶ added in v1.1.1297
func (client *BraintreeClient) VoidWithContext(ctx context.Context, request *sleet.VoidRequest) (*sleet.VoidResponse, error)
VoidWithContext voids an authorized transaction with reference (cancels void)