braintree

package
v1.1.392 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

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)

Jump to

Keyboard shortcuts

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