payment

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapUserConfig

func MapUserConfig(userConfig *UserConfig) (*object.HashMap, error)

Types

type Http

type Http struct {
	Timeout float64
	BaseURI string
}

type Log

type Log struct {
	Level string
	File  string
}

type OAuth

type OAuth struct {
	Callback string
	Scopes   []string
}

type Payment

type Payment struct {
	kernel2.ApplicationPaymentInterface
	*kernel.ServiceContainer

	Config *kernel.Config

	Order   *order.Client
	JSSDK   *jssdk.Client
	Sandbox *sandbox.Client

	Refund *refund.Client
	Bill   *bill.Client

	RedPack       *redpack.Client
	Transfer      *transfer.Client
	Reverse       *reverse.Client
	ProfitSharing *profitSharing.Client

	Base *base.Client
}

func NewPayment

func NewPayment(config *UserConfig) (*Payment, error)

func (*Payment) CodeUrlScheme

func (app *Payment) CodeUrlScheme(codeUrl string) string

func (*Payment) GetAccessToken

func (app *Payment) GetAccessToken() *kernel.AccessToken

func (*Payment) GetComponent

func (app *Payment) GetComponent(name string) interface{}

func (*Payment) GetConfig

func (app *Payment) GetConfig() *kernel.Config

func (*Payment) GetContainer

func (app *Payment) GetContainer() *kernel.ServiceContainer

func (*Payment) GetExternalRequest

func (app *Payment) GetExternalRequest() (r *http.Request)

func (*Payment) GetKey

func (app *Payment) GetKey(endpoint string) (string, error)

func (*Payment) HandlePaidNotify

func (app *Payment) HandlePaidNotify(request *http.Request, closure func(message *request.RequestNotify, transaction *models.Transaction, fail func(message string)) interface{}) (*response.HttpResponse, error)

func (*Payment) HandleRefundedNotify

func (app *Payment) HandleRefundedNotify(request *http.Request, closure func(message *request.RequestNotify, transaction *models.Refund, fail func(message string)) interface{}) (*response.HttpResponse, error)

func (*Payment) HandleScannedNotify

func (app *Payment) HandleScannedNotify(request *http.Request, closure func(message *request.RequestNotify, fail func(message string), alert func(message string)) interface{}) (*response.HttpResponse, error)

func (*Payment) InSandbox

func (app *Payment) InSandbox() bool

func (*Payment) Scheme

func (app *Payment) Scheme(productID string) string

func (*Payment) SetExternalRequest

func (app *Payment) SetExternalRequest(r *http.Request)

func (*Payment) SetSubMerchant

func (app *Payment) SetSubMerchant(mchId string, appId string) kernel2.ApplicationPaymentInterface

type UserConfig

type UserConfig struct {
	AppID       string
	MchID       string
	MchApiV3Key string
	Key         string
	CertPath    string
	KeyPath     string
	SerialNo    string

	ResponseType string
	Log          Log
	OAuth        OAuth
	Http         Http
	NotifyURL    string
	Cache        kernel.CacheInterface
	HttpDebug    bool
	Debug        bool
	Sandbox      bool
}

Jump to

Keyboard shortcuts

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