Versions in this module Expand all Collapse all v1 v1.0.1 Apr 19, 2021 v1.0.0 Jan 24, 2021 Changes in this version + var Brands = map[string]*regexp.Regexp + var ErrCardDeclined = errors.New("gomerchant: the card was declined.") + var ErrExpiredCard = errors.New("gomerchant: the card has expired.") + var ErrIncorrectCVC = errors.New("gomerchant: the card's security code is incorrect.") + var ErrIncorrectNumber = errors.New("gomerchant: the card number is incorrect.") + var ErrIncorrectZip = errors.New("gomerchant: the card's zip code failed validation.") + var ErrInvalidCVC = errors.New("gomerchant: the card's security code is invalid.") + var ErrInvalidExpiryMonth = errors.New("gomerchant: the card's expiration month is invalid.") + var ErrInvalidExpiryYear = errors.New("gomerchant: the card's expiration year is invalid.") + var ErrInvalidNumber = errors.New("gomerchant: the card number is not a valid credit card number.") + var ErrMissing = errors.New("gomerchant: there is no card on a customer that is being charged.") + var ErrNotSupportedPaymentMethod = errors.New("not supported payment method") + var ErrProcessingError = errors.New("gomerchant: an error occurred while processing the card.") + type Address struct + Address1 string + Address2 string + City string + Company string + Country string + Name string + Phone string + State string + ZIP string + type AuthorizeParams struct + Amount uint64 + BillingAddress *Address + Currency string + Customer string + Description string + OrderID string + PaymentMethod *PaymentMethod + ShippingAddress *Address + type AuthorizeResponse struct + HandleRequest bool + RequestHandler func(http.ResponseWriter, *http.Request, Params) error + TransactionID string + type CaptureParams struct + type CaptureResponse struct + TransactionID string + type CompleteAuthorizeParams struct + type CompleteAuthorizeResponse struct + type CreateCreditCardParams struct + CreditCard *CreditCard + CustomerID string + type CreditCard struct + CVC string + ExpMonth uint + ExpYear uint + Name string + Number string + func (creditCard CreditCard) Brand() string + func (creditCard CreditCard) ValidNumber() bool + type CreditCardManager interface + CreateCreditCard func(creditCardParams CreateCreditCardParams) (CreditCardResponse, error) + DeleteCreditCard func(deleteCreditCardParams DeleteCreditCardParams) (DeleteCreditCardResponse, error) + GetCreditCard func(creditCardParams GetCreditCardParams) (GetCreditCardResponse, error) + ListCreditCards func(listCreditCardsParams ListCreditCardsParams) (ListCreditCardsResponse, error) + type CreditCardResponse struct + CreditCardID string + CustomerID string + type CustomerCreditCard struct + Brand string + CreditCardID string + CustomerID string + CustomerName string + ExpMonth uint + ExpYear uint + MaskedNumber string + type DeleteCreditCardParams struct + CreditCardID string + CustomerID string + type DeleteCreditCardResponse struct + type GetCreditCardParams struct + CreditCardID string + CustomerID string + type GetCreditCardResponse struct + CreditCard *CustomerCreditCard + type IntegrationGateway interface + type ListCreditCardsParams struct + CustomerID string + type ListCreditCardsResponse struct + CreditCards []*CustomerCreditCard + type Params map[string]interface + func (params Params) Get(key string) (interface{}, bool) + func (params Params) IgnoreBlankFields() Params + func (params Params) Set(key string, value interface{}) + type PaymentGateway interface + Authorize func(amount uint64, params AuthorizeParams) (AuthorizeResponse, error) + Capture func(transactionID string, params CaptureParams) (CaptureResponse, error) + CompleteAuthorize func(paymentID string, params CompleteAuthorizeParams) (CompleteAuthorizeResponse, error) + Query func(transactionID string) (Transaction, error) + Refund func(transactionID string, amount uint, params RefundParams) (RefundResponse, error) + Void func(transactionID string, params VoidParams) (VoidResponse, error) + type PaymentMethod struct + CreditCard *CreditCard + SavedCreditCard *SavedCreditCard + type RefundParams struct + Captured bool + type RefundResponse struct + TransactionID string + type SavedCreditCard struct + CreditCardID string + CustomerID string + type Transaction struct + Amount int + Cancelled bool + Captured bool + CreatedAt *int64 + Currency string + ID string + Paid bool + Status string + type VoidParams struct + Captured bool + type VoidResponse struct + TransactionID string