paypal

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

Documentation

Overview

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

Index

Constants

View Source
const (
	ConstLogStorage = "paypal.log"

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

	ConstPaymentActionSale          = "Sale"
	ConstPaymentActionAuthorization = "Authorization"

	ConstPaymentCode = "paypal_express"
	ConstPaymentName = "PayPal Express"

	ConstConfigPathGroup = "payment.paypalExpress"

	ConstConfigPathEnabled = "payment.paypalExpress.enabled"
	ConstConfigPathTitle   = "payment.paypalExpress.title"

	ConstConfigPathUser = "payment.paypalExpress.user"
	ConstConfigPathPass = "payment.paypalExpress.password"

	ConstConfigPathSignature = "payment.paypalExpress.signature"
	ConstConfigPathAction    = "payment.paypalExpress.action"

	ConstConfigPathPayPalExpressGateway = "payment.paypalExpress.gateway"
	ConstConfigPathPayPalPayFlowGateway = "payment.paypalPayflowPro.gateway"
	ConstPaymentPayPalGatewaySandbox    = "sandbox"
	ConstPaymentPayPalGatewayProduction = "production"
	ConstPaymentPayPalGateway           = "gateway"
	ConstPaymentPayPalHost              = "host"
	ConstPaymentPayPalNvp               = "nvp"
	ConstPaymentPayPalUrl               = "url"

	ConstPaymentPayPalPayflowCode = "paypal_payflow"
	ConstPaymentPayPalPayflowName = "PayPal Payflow"

	ConstConfigPathPayPalPayflowGroup = "payment.paypalPayflowPro"

	ConstConfigPathPayPalPayflowEnabled   = "payment.paypalPayflowPro.enabled"
	ConstConfigPathPayPalPayflowTokenable = "payment.paypalPayflowPro.tokanable"
	ConstConfigPathPayPalPayflowTitle     = "payment.paypalPayflowPro.title"

	ConstConfigPathPayPalPayflowUser   = "payment.paypalPayflowPro.user"
	ConstConfigPathPayPalPayflowPass   = "payment.paypalPayflowPro.password"
	ConstConfigPathPayPalPayflowVendor = "payment.paypalPayflowPro.vendor"
)

Package global constants

Variables

This section is empty.

Functions

func APIDecline

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

APIDecline processes PayPal decline response

func APIReceipt

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

APIReceipt processes PayPal receipt response

func CompleteTransaction

func CompleteTransaction(orderInstance order.InterfaceOrder, token string, payerID string) (map[string]string, error)

CompleteTransaction makes NVP request to PayPal for a given purchase order using PayPal token and payer id

Types

type Express

type Express struct{}

Express is a implementer of InterfacePaymentMethod for a PayPal Express method

func (*Express) Authorize

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

Authorize makes payment method authorize operation

func (*Express) Capture

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

Capture payment method capture operation

func (*Express) DeleteSavedCard

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

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

func (*Express) GetCode

func (it *Express) GetCode() string

GetCode returns payment method code

func (Express) GetInternalName

func (it Express) GetInternalName() string

GetInternalName returns the name of the payment method

func (*Express) GetName

func (it *Express) GetName() string

GetName returns the user customized name of the payment method

func (*Express) GetType

func (it *Express) GetType() string

GetType returns the type of payment method

func (*Express) IsAllowed

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

IsAllowed checks for method applicability

func (*Express) IsTokenable

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

IsTokenable checks for method applicability

func (*Express) Refund

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

Refund makes payment method refund operation

func (*Express) Void

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

Void makes payment method void operation

type PayFlowAPI

type PayFlowAPI struct{}

PayFlowAPI is a implementer of PayPal Pro payflow API methods

func (*PayFlowAPI) Authorize

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

Authorize makes payment method authorize operation (currently it's a Authorize zero amount + Sale operations)

func (*PayFlowAPI) AuthorizeZeroAmount

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

AuthorizeZeroAmount will do Account Verification and return transaction ID for refer transaction if all info is valid

func (*PayFlowAPI) Capture

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

Capture payment method capture operation

func (*PayFlowAPI) DeleteSavedCard

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

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

func (*PayFlowAPI) GetAccessToken

func (it *PayFlowAPI) GetAccessToken(originRequestParams string) (string, error)

GetAccessToken returns application access token

func (*PayFlowAPI) GetCode

func (it *PayFlowAPI) GetCode() string

GetCode returns PayPal code value for this payment method

func (PayFlowAPI) GetInternalName

func (it PayFlowAPI) GetInternalName() string

GetInternalName returns the name of the payment method

func (*PayFlowAPI) GetName

func (it *PayFlowAPI) GetName() string

GetName returns the user customized name of the payment method

func (*PayFlowAPI) GetType

func (it *PayFlowAPI) GetType() string

GetType returns the type of payment method

func (*PayFlowAPI) IsAllowed

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

IsAllowed checks for method applicability

func (*PayFlowAPI) IsTokenable

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

IsTokenable checks for method applicability

func (*PayFlowAPI) Refund

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

Refund makes payment method refund operation

func (*PayFlowAPI) Void

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

Void makes payment method void operation

type RestAPI

type RestAPI struct{}

RestAPI is a implementer of InterfacePaymentMethod for a PayPal REST API method (currently not working)

Jump to

Keyboard shortcuts

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