payment

package module
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

payment

通用GO语言付款包

功能特色

  1. 支持支付宝支付
  2. 支持微信支付
  3. 支持PayPal支付
  4. 支持PayJS支付
  5. 支持MugglePay加密货币支付
  6. 支持XunhuPay(虎皮椒)支付

打赏

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, setDefaults ...func(*config.Account))

func Unregister added in v0.2.3

func Unregister(platform string)

Types

type Hook

type Hook interface {
	IsSupported(config.Support) bool
	SetNotifyCallback(callback func(echo.Context) error) Hook
	SetAccount(*config.Account) Hook
	Pay(echo.Context, *config.Pay) (*config.PayResponse, error)
	PayQuery(echo.Context, *config.Query) (*config.Result, error)
	PayNotify(echo.Context) error
	Refund(echo.Context, *config.Refund) (*config.Result, error)
	RefundQuery(echo.Context, *config.Query) (*config.Result, error)
	RefundNotify(echo.Context) error
	VerifySign(echo.Context) error
}

Hook 付款驱动接口

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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