authorizenet

package
v1.4.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package authorizenet is a Authorize.Net implementation of payment method interface declared in "github.com/ottemo/commerce/app/models/checkout" package

Index

Constants

View Source
const (
	// ConstTransactionApproved constants for transaction state
	ConstTransactionApproved      = "1"
	ConstTransactionDeclined      = "2"
	ConstTransactionError         = "3"
	ConstTransactionWaitingReview = "4"

	ConstLogStorage = "authorizenet.log"

	// Authorize.Net (Direct Post)
	ConstPaymentCodeDPM = "authorizeNetDPM"
	ConstPaymentNameDPM = "Authorize.Net (Direct Post)"

	ConstDPMActionAuthorizeOnly       = "AUTH_ONLY"
	ConstDPMActionAuthorizeAndCapture = "AUTH_CAPTURE"

	ConstConfigPathDPMGroup = "payment.authorizeNetDPM"

	ConstConfigPathDPMEnabled = "payment.authorizeNetDPM.enabled"
	ConstConfigPathDPMAction  = "payment.authorizeNetDPM.action"
	ConstConfigPathDPMTitle   = "payment.authorizeNetDPM.title"

	ConstConfigPathDPMLogin   = "payment.authorizeNetDPM.login"
	ConstConfigPathDPMKey     = "payment.authorizeNetDPM.key"
	ConstConfigPathDPMGateway = "payment.authorizeNetDPM.gateway"

	ConstConfigPathDPMReceiptURL  = "payment.authorizeNetDPM.receiptURL"
	ConstConfigPathDPMDeclineURL  = "payment.authorizeNetDPM.declineURL"
	ConstConfigPathDPMReceiptHTML = "payment.authorizeNetDPM.receiptHTML"
	ConstConfigPathDPMDeclineHTML = "payment.authorizeNetDPM.declineHTML"

	ConstConfigPathDPMTest     = "payment.authorizeNetDPM.test"
	ConstConfigPathDPMDebug    = "payment.authorizeNetDPM.debug"
	ConstConfigPathDPMCheckout = "payment.authorizeNetDPM.checkout"

	ConstErrorModule = "payment/authorizenet"
	ConstErrorLevel  = env.ConstErrorLevelActor

	ConstDefaultDeclineTemplate = `` /* 739-byte string literal not displayed */

	ConstDefaultReceiptTemplate = `` /* 779-byte string literal not displayed */

	// Authorize.Net (REST Api)
	ConstPaymentAuthorizeNetRestAPICode = "authorizenet_rest"
	ConstPaymentAuthorizeNetRestAPIName = "Authorize.Net"

	ConstConfigPathAuthorizeNetRestAPIGroup = "payment.authorizeNetRestApi"

	ConstConfigPathAuthorizeNetRestAPIEnabled = "payment.authorizeNetRestApi.enabled"
	ConstConfigPathAuthorizeNetRestAPITitle   = "payment.authorizeNetRestApi.title"

	ConstConfigPathAuthorizeNetRestAPIAPILoginID     = "payment.authorizeNetRestApi.apiLoginId"
	ConstConfigPathAuthorizeNetRestAPITransactionKey = "payment.authorizeNetRestApi.transactionKey"
	ConstConfigPathAuthorizeNetRestAPITest           = "payment.authorizeNetRestApi.test"
)

Package global constants

Variables

This section is empty.

Functions

func APIReceipt

func APIReceipt(context api.InterfaceApplicationContext) (interface{}, error)

APIReceipt processes Authorize.net receipt response can be used for redirecting customer to it on exit from authorize.net

func APIRelay

func APIRelay(context api.InterfaceApplicationContext) (interface{}, error)

APIRelay processes Authorize.net relay response

Types

type DirectPostMethod

type DirectPostMethod struct{}

DirectPostMethod is a implementer of InterfacePaymentMethod for a Authorize.Net Direct Post method

func (*DirectPostMethod) Authorize

func (it *DirectPostMethod) Authorize(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Authorize makes payment method authorize operation

func (*DirectPostMethod) Capture

func (it *DirectPostMethod) Capture(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Capture makes payment method capture operation

func (*DirectPostMethod) DeleteSavedCard

func (it *DirectPostMethod) DeleteSavedCard(token visitor.InterfaceVisitorCard) (interface{}, error)

Delete saved card from the payment system. **This method is for future use**

func (*DirectPostMethod) GetCode

func (it *DirectPostMethod) GetCode() string

GetCode returns payment method code

func (DirectPostMethod) GetInternalName

func (it DirectPostMethod) GetInternalName() string

GetInternalName returns the name of the payment method

func (*DirectPostMethod) GetName

func (it *DirectPostMethod) GetName() string

GetName returns the user customized name of the payment method

func (*DirectPostMethod) GetType

func (it *DirectPostMethod) GetType() string

GetType returns type of payment method

func (*DirectPostMethod) IsAllowed

func (it *DirectPostMethod) IsAllowed(checkoutInstance checkout.InterfaceCheckout) bool

IsAllowed checks for method applicability

func (*DirectPostMethod) IsTokenable

func (it *DirectPostMethod) IsTokenable(checkoutInstance checkout.InterfaceCheckout) bool

IsTokenable returns possibility to save token for this payment method

func (*DirectPostMethod) Refund

func (it *DirectPostMethod) Refund(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Refund will return funds on the given order :: Not Implemented Yet

func (*DirectPostMethod) Void

func (it *DirectPostMethod) Void(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Void will mark the order and capture as void

type RestMethod

type RestMethod struct{}

RestMethod is a implementer of InterfacePaymentMethod for a Authorize.Net REST API method

func (*RestMethod) Authorize

func (it *RestMethod) Authorize(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Authorize makes payment method authorize operation

func (*RestMethod) AuthorizeWithoutSave

func (it *RestMethod) AuthorizeWithoutSave(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

AuthorizeWithoutSave make payment without save token

func (*RestMethod) Capture

func (it *RestMethod) Capture(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Capture makes payment method capture operation

func (*RestMethod) ConnectToAuthorize

func (it *RestMethod) ConnectToAuthorize() (bool, error)

ConnectToAuthorize connect to Authorize.Net

func (*RestMethod) CreatePaymentProfile

func (it *RestMethod) CreatePaymentProfile(paymentInfo map[string]interface{}, profileID string) (string, map[string]interface{}, error)

CreatePaymentProfile create billing profile in Authorize.Net

func (*RestMethod) CreateProfile

func (it *RestMethod) CreateProfile(paymentInfo map[string]interface{}) (string, error)

CreateProfile create profile in Authorize.Net

func (*RestMethod) DeleteSavedCard

func (it *RestMethod) DeleteSavedCard(token visitor.InterfaceVisitorCard) (interface{}, error)

Delete saved card from the payment system.

func (*RestMethod) GetCode

func (it *RestMethod) GetCode() string

GetCode returns payment method code

func (RestMethod) GetInternalName

func (it RestMethod) GetInternalName() string

GetInternalName returns the name of the payment method

func (*RestMethod) GetName

func (it *RestMethod) GetName() string

GetName returns the user customized name of the payment method

func (*RestMethod) GetType

func (it *RestMethod) GetType() string

GetType returns type of payment method

func (*RestMethod) IsAllowed

func (it *RestMethod) IsAllowed(checkoutInstance checkout.InterfaceCheckout) bool

IsAllowed checks for method applicability

func (*RestMethod) IsTokenable

func (it *RestMethod) IsTokenable(checkoutInstance checkout.InterfaceCheckout) bool

IsTokenable returns possibility to save token for this payment method

func (*RestMethod) Refund

func (it *RestMethod) Refund(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Refund will return funds on the given order :: Not Implemented Yet

func (*RestMethod) SaveToken

func (it *RestMethod) SaveToken(orderInstance order.InterfaceOrder, creditCardInfo map[string]interface{}) (visitor.InterfaceVisitorCard, error)

SaveToken save token data to db

func (*RestMethod) Void

func (it *RestMethod) Void(orderInstance order.InterfaceOrder, paymentInfo map[string]interface{}) (interface{}, error)

Void will mark the order and capture as void

Jump to

Keyboard shortcuts

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