authorizenet

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FailedToCreateCustomerError          = errors.New("Failed to create Authorize customer.")
	FailedToUpdateCustomerError          = errors.New("Failed to update Authorize customer.")
	MinimumRefundTimeNotReachedError     = errors.New("Minimum refund time not reached.")
	AuthorizeNotApprovedError            = errors.New("Authorize attempt rejected")
	CaptureNotApprovedError              = errors.New("Capture attempt rejected")
	ChargeNotApprovedError               = errors.New("Capture attempt rejected")
	RefundGreaterThanPaymentError        = errors.New("The requested refund amount is greater than the paid amount")
	UnableToRefundUnpaidTransactionError = errors.New("Unable to refund unpaid transaction")
	NewSubscriptionFailedError           = errors.New("NewSubscription Failed Error")
	UpdateSubscriptionFailedError        = errors.New("UpdateSubscription Failed Error")
)

Functions

func AuthOnly

func AuthOnly(ctx context.Context, tranx authorizenet.NewTransaction, test bool) (*authorizenet.TransactionResponse, error)

func Capture

func Capture(ctx context.Context, tranx authorizenet.PreviousTransaction, test bool) (*authorizenet.TransactionResponse, error)

func ChargeSubscription

func ChargeSubscription(ctx context.Context, sub authorizenet.Subscription, test bool) (*authorizenet.SubscriptionResponse, error)

func HanzoToAuthorizeSubscription

func HanzoToAuthorizeSubscription(sub *order.Subscription) *authorizenet.Subscription

func PaymentToNewTransaction

func PaymentToNewTransaction(pay *payment.Payment) *authorizenet.NewTransaction

Covert a payment model into a card card we can use for authorization

func PaymentToPreviousTransaction

func PaymentToPreviousTransaction(pay *payment.Payment) *authorizenet.PreviousTransaction

func PopulatePaymentWithResponse

func PopulatePaymentWithResponse(pay *payment.Payment, tran *authorizenet.TransactionResponse) (*payment.Payment, error)

func PopulateSubscriptionWithResponse

func PopulateSubscriptionWithResponse(sub *order.Subscription, tran *authorizenet.SubscriptionResponse) *order.Subscription

func SendRequest

func SendRequest(ctx context.Context, input []byte, test bool) ([]byte, error)

func SendSubscription

func SendSubscription(ctx context.Context, sub authorizenet.Subscription, test bool) (*authorizenet.SubscriptionResponse, error)

func SendTransactionRequest

func SendTransactionRequest(ctx context.Context, input authorizenet.TransactionRequest, test bool) (*authorizenet.TransactionResponse, error)

func ToStringExpirationDate

func ToStringExpirationDate(month int, year int) string

Types

type Client

type Client struct {
	Key string
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, loginId string, transactionKey string, key string, test bool) *Client

func (Client) Authorize

func (c Client) Authorize(pay *payment.Payment) (*payment.Payment, error)

Do authorization, return token

func (Client) CancelSubscription

func (c Client) CancelSubscription(sub *order.Subscription) (*order.Subscription, error)

Subscribe to a plan

func (Client) Capture

func (c Client) Capture(pay *payment.Payment) (*payment.Payment, error)

Capture charge

func (Client) Charge

func (c Client) Charge(pay *payment.Payment) (*payment.Payment, error)

Create new charge

func (Client) NewSubscription

func (c Client) NewSubscription(sub *order.Subscription) (*order.Subscription, error)

func (Client) RefundPayment

func (c Client) RefundPayment(pay *payment.Payment, refundAmount currency.Cents) (*payment.Payment, error)

Attempts to refund payment and updates the payment in datastore

func (Client) UpdateSubscription

func (c Client) UpdateSubscription(sub *order.Subscription) (*order.Subscription, error)

Update subscribe to a plan

Jump to

Keyboard shortcuts

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