commands

package
v0.0.0-...-1b8c519 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreditCardCommand

func NewCreditCardCommand(
	ex cuirass.Executor, gateway *AuthorizeNetGateway,
	order *Order,
	payment *PaymentInformation,
	amount *big.Rat) *cuirass.Command

func NewGetOrderCommand

func NewGetOrderCommand(ex cuirass.Executor, orderId int) *cuirass.Command

func NewGetPaymentInformationCommand

func NewGetPaymentInformationCommand(user *UserAccount) *cuirass.Command

func NewGetUserAccountCommand

func NewGetUserAccountCommand(cookie *http.Cookie) *cuirass.Command

Types

type AuthorizeNetGateway

type AuthorizeNetGateway struct {
}

func (*AuthorizeNetGateway) Submit

func (g *AuthorizeNetGateway) Submit(
	creditCardNumber, expirationMonth, expirationYear string,
	authCapture TransactionType,
	amount *big.Rat,
	order *Order) Result

type CreditCardAuthorizationResult

type CreditCardAuthorizationResult struct {
	Success                          bool
	AuthorizationCode, TransactionId string
	ErrorMessage                     string
}

func NewFailedResponse

func NewFailedResponse(message string) CreditCardAuthorizationResult

func NewSuccessResponse

func NewSuccessResponse(transactionId, authorizationCode string) CreditCardAuthorizationResult

type Expiration

type Expiration struct {
	Month, Year int
}

type Order

type Order struct {
	OrderId int
	User    *UserAccount
}

func NewOrder

func NewOrder(ex cuirass.Executor, ctx context.Context, orderId int) (*Order, error)

type PaymentInformation

type PaymentInformation struct {
	UserAccount      *UserAccount
	CreditCardNumber string
	Expiration       Expiration
}

func NewPaymentInformation

func NewPaymentInformation(
	userAccount *UserAccount,
	creditCardNumber string,
	expirationMonth, expirationYear int) *PaymentInformation

type Result

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

func NewResult

func NewResult(approved bool) Result

func (*Result) IsApproved

func (r *Result) IsApproved() bool

func (*Result) IsDeclined

func (r *Result) IsDeclined() bool

func (*Result) ReasonResponseCode

func (r *Result) ReasonResponseCode() int

func (*Result) ResponseText

func (r *Result) ResponseText() string

func (*Result) Target

func (r *Result) Target() *Target

type Target

type Target struct{}

func NewTarget

func NewTarget() *Target

func (*Target) AuthorizationCode

func (t *Target) AuthorizationCode() string

func (*Target) TransactionId

func (t *Target) TransactionId() string

type TransactionType

type TransactionType int
const AuthCapture TransactionType = 0

type UserAccount

type UserAccount struct {
	Id          uint64
	Name        string
	AccountType int
}

func NewUserAccount

func NewUserAccount(id uint64, name string, accountType int) *UserAccount

Jump to

Keyboard shortcuts

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