braintree

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: 7 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	ConstGeneralConfigPathGroup = "payment.braintreeGeneral"

	ConstGeneralConfigPathEnabled    = "payment.braintreeGeneral.enabled"
	ConstGeneralMethodConfigPathName = "payment.braintreeGeneral.name" // User customized name of the payment method

	ConstGeneralConfigPathEnvironment = "payment.braintreeGeneral.environment"
	ConstGeneralConfigPathMerchantID  = "payment.braintreeGeneral.merchantID"
	ConstGeneralConfigPathPublicKey   = "payment.braintreeGeneral.publicKey"
	ConstGeneralConfigPathPrivateKey  = "payment.braintreeGeneral.privateKey"

	ConstEnvironmentSandbox    = string(braintree.Sandbox)
	ConstEnvironmentProduction = string(braintree.Production)

	ConstErrorModule = "payment/braintree"
	ConstErrorLevel  = env.ConstErrorLevelActor
)

Package global constants

Variables

This section is empty.

Functions

This section is empty.

Types

type CreditCardMethod

type CreditCardMethod struct{}

CreditCardMethod is a implementer of InterfacePaymentMethod for a Credit Card payment method

func (*CreditCardMethod) Authorize

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

Authorize makes payment method authorize operations

  • just create token if set in paymentInfo
  • otherwise create transaction
  • `orderInstance = nil` when creating a token

func (*CreditCardMethod) Capture

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

Capture makes payment method capture operation - at time of implementation this method is not used anywhere

func (*CreditCardMethod) DeleteSavedCard

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

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

func (*CreditCardMethod) GetCode

func (it *CreditCardMethod) GetCode() string

GetCode returns payment method code for use in business logic

func (*CreditCardMethod) GetInternalName

func (it *CreditCardMethod) GetInternalName() string

GetInternalName returns the human readable name of the payment method

func (*CreditCardMethod) GetName

func (it *CreditCardMethod) GetName() string

GetName returns the user customized name of the payment method

func (*CreditCardMethod) GetType

func (it *CreditCardMethod) GetType() string

GetType returns type of payment method according to "github.com/ottemo/commerce/app/models/checkout"

func (*CreditCardMethod) IsAllowed

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

IsAllowed checks for payment method applicability

func (*CreditCardMethod) IsTokenable

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

IsTokenable returns possibility to save token for this payment method

func (*CreditCardMethod) Refund

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

Refund will return funds on the given order - at time of implementation this method is not used anywhere

func (*CreditCardMethod) Void

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

Void will mark the order and capture as void - at time of implementation this method is not used anywhere

Jump to

Keyboard shortcuts

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