braintree

package
v1.0.246 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionTypeSale = "sale"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	FirstName         string  `xml:"first-name,omitempty"`
	LastName          string  `xml:"last-name,omitempty"`
	StreetAddress     *string `xml:"street-address,omitempty"`
	Locality          *string `xml:"locality,omitempty"`
	Region            *string `xml:"region,omitempty"`
	PostalCode        *string `xml:"postal-code,omitempty"`
	CountryCodeAlpha2 *string `xml:"country-code-alpha2,omitempty"`
}

type BraintreeClient

type BraintreeClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(credentials *Credentials) *BraintreeClient

func NewWithHttpClient

func NewWithHttpClient(credentials *Credentials, httpClient *http.Client) *BraintreeClient

func (*BraintreeClient) Authorize

func (*BraintreeClient) Capture

func (client *BraintreeClient) Capture(request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)

func (*BraintreeClient) Refund

func (client *BraintreeClient) Refund(request *sleet.RefundRequest) (*sleet.RefundResponse, error)

func (*BraintreeClient) Void

func (client *BraintreeClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)

type Credentials

type Credentials struct {
	MerchantID string
	PublicKey  string
	PrivateKey string
}

type CreditCard

type CreditCard struct {
	Number         string `xml:"number,omitempty"`
	ExpirationDate string `xml:"expiration-date,omitempty"`
	CVV            string `xml:"cvv,omitempty"`
}

type Transaction

type Transaction struct {
	ID                           string      `xml:"id"`
	Status                       string      `xml:"status"`
	Type                         string      `xml:"type"`
	CurrencyISOCode              string      `xml:"currency-iso-code"`
	Amount                       string      `xml:"amount"`
	OrderIdD                     string      `xml:"order-id"`
	CreditCard                   *CreditCard `xml:"credit-card"`
	BillingAddress               *Address    `xml:"billing"`
	CreatedAt                    *time.Time  `xml:"created-at"`
	UpdatedAt                    *time.Time  `xml:"updated-at"`
	AVSErrorResponseCode         string      `xml:"avs-error-response-code"`
	AVSPostalCodeResponseCode    string      `xml:"avs-postal-code-response-code"`
	AVSStreetAddressResponseCode string      `xml:"avs-street-address-response-code"`
	CVVResponseCode              string      `xml:"cvv-response-code"`
}

type TransactionRequest

type TransactionRequest struct {
	XMLName        string      `xml:"transaction"`
	Type           string      `xml:"type,omitempty"`
	Amount         string      `xml:"amount"`
	OrderID        string      `xml:"order-id,omitempty"`
	CreditCard     *CreditCard `xml:"credit-card,omitempty"`
	BillingAddress *Address    `xml:"billing,omitempty"`
}

Jump to

Keyboard shortcuts

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