Documentation
¶
Index ¶
- Variables
- func AuthOnly(ctx context.Context, tranx authorizenet.NewTransaction, test bool) (*authorizenet.TransactionResponse, error)
- func Capture(ctx context.Context, tranx authorizenet.PreviousTransaction, test bool) (*authorizenet.TransactionResponse, error)
- func ChargeSubscription(ctx context.Context, sub authorizenet.Subscription, test bool) (*authorizenet.SubscriptionResponse, error)
- func HanzoToAuthorizeSubscription(sub *order.Subscription) *authorizenet.Subscription
- func PaymentToNewTransaction(pay *payment.Payment) *authorizenet.NewTransaction
- func PaymentToPreviousTransaction(pay *payment.Payment) *authorizenet.PreviousTransaction
- func PopulatePaymentWithResponse(pay *payment.Payment, tran *authorizenet.TransactionResponse) (*payment.Payment, error)
- func PopulateSubscriptionWithResponse(sub *order.Subscription, tran *authorizenet.SubscriptionResponse) *order.Subscription
- func SendRequest(ctx context.Context, input []byte, test bool) ([]byte, error)
- func SendSubscription(ctx context.Context, sub authorizenet.Subscription, test bool) (*authorizenet.SubscriptionResponse, error)
- func SendTransactionRequest(ctx context.Context, input authorizenet.TransactionRequest, test bool) (*authorizenet.TransactionResponse, error)
- func ToStringExpirationDate(month int, year int) string
- type Client
- func (c Client) Authorize(pay *payment.Payment) (*payment.Payment, error)
- func (c Client) CancelSubscription(sub *order.Subscription) (*order.Subscription, error)
- func (c Client) Capture(pay *payment.Payment) (*payment.Payment, error)
- func (c Client) Charge(pay *payment.Payment) (*payment.Payment, error)
- func (c Client) NewSubscription(sub *order.Subscription) (*order.Subscription, error)
- func (c Client) RefundPayment(pay *payment.Payment, refundAmount currency.Cents) (*payment.Payment, error)
- func (c Client) UpdateSubscription(sub *order.Subscription) (*order.Subscription, error)
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 ChargeSubscription ¶
func HanzoToAuthorizeSubscription ¶
func HanzoToAuthorizeSubscription(sub *order.Subscription) *authorizenet.Subscription
func PaymentToNewTransaction ¶
Covert a payment model into a card card we can use for authorization
func PopulateSubscriptionWithResponse ¶
func PopulateSubscriptionWithResponse(sub *order.Subscription, tran *authorizenet.SubscriptionResponse) *order.Subscription
func SendSubscription ¶
func SendTransactionRequest ¶
func ToStringExpirationDate ¶
Types ¶
type Client ¶
type Client struct {
Key string
// contains filtered or unexported fields
}
func (Client) CancelSubscription ¶
func (c Client) CancelSubscription(sub *order.Subscription) (*order.Subscription, error)
Subscribe to a plan
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
Click to show internal directories.
Click to hide internal directories.