payment

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

payment

通用GO语言付款包

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutFloat

func CutFloat(money float64, precision int32) string

CutFloat 非四舍五入的方式保留小数位数 @param money 金额 @param precision 小数位数

func Get

func Get(platform string) (hook func() Hook)

func MulFloat

func MulFloat(money float64, multiple float64, precision int32) string

MulFloat 小数相乘 @param money 金额 @param multiple 乘数 @param precision 小数位数

func Name

func Name(platform string) string

func NotifyIsPay added in v0.0.5

func NotifyIsPay(result param.StringMap) bool

NotifyIsPay 是付款通知

func NotifyIsRefund added in v0.0.5

func NotifyIsRefund(result param.StringMap) bool

NotifyIsRefund 是退款通知

func Platforms

func Platforms() map[string]string

func Register

func Register(platform string, name string, hook func() Hook)

Types

type Finish added in v0.0.6

type Finish interface {
	Finish(echo.Context) (param.StringMap, error)
}

Finish 付款完成后的数据获取处理

type Hook

type Hook interface {
	SetNotifyCallback(callback func(echo.Context) error) Hook
	SetAccount(*config.Account) Hook
	Pay(*config.Pay) (param.StringMap, error)
	Notify(echo.Context) error
	Refund(*config.Refund) (param.StringMap, error)
}

Hook 付款驱动接口

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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