braintree

package
v1.0.325 Latest Latest
Warning

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

Go to latest
Published: May 18, 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(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

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

type Credentials struct {
	MerchantID string
	PublicKey  string
	PrivateKey string
}

Credentials specifies account information needed to make API calls to Braintree TODO: Support taking in production environments as well

Jump to

Keyboard shortcuts

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