mockpay

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Name = `mockpay`

Variables

View Source
var DisableableFeatures = []map[string]string{
	{`id`: config.SupportPayQuery.String(), `text`: echo.T(`查询付款结果`)},
	{`id`: config.SupportPayNotify.String(), `text`: echo.T(`付款结果通知`)},
	{`id`: config.SupportRefund.String(), `text`: echo.T(`退款功能`)},
	{`id`: config.SupportRefundQuery.String(), `text`: echo.T(`查询退款结果`)},
	{`id`: config.SupportRefundNotify.String(), `text`: echo.T(`退款结果通知`)},
}

Functions

func DeleteCachedKey

func DeleteCachedKey(key string)

func GenerateHash

func GenerateHash(data url.Values, secret string) string

func GetAllCachedKeys

func GetAllCachedKeys() []string

func GetDisableableFeatures added in v0.7.8

func GetDisableableFeatures(ctx echo.Context) []map[string]string

func New

func New() payment.Driver

Types

type GatewayPayData

type GatewayPayData struct {
	TradeNo     string
	Currency    string
	TotalAmount float64
	Config      config.Pay
}

type GatewayRefundData

type GatewayRefundData struct {
	RefundNo    string
	TotalAmount float64
	RefundFee   float64
	Currency    string
	Config      config.Refund
}

type ManualNotice

type ManualNotice interface {
	SubmitPayNotice(tradeNo string) error
	SubmitRefundNotice(refundNo string) error
}

type Mockpay

type Mockpay struct {
	// contains filtered or unexported fields
}

func (*Mockpay) IsSupported

func (a *Mockpay) IsSupported(s config.Support) bool

func (*Mockpay) Pay

func (a *Mockpay) Pay(ctx echo.Context, cfg *config.Pay) (*config.PayResponse, error)

func (*Mockpay) PayNotify

func (a *Mockpay) PayNotify(ctx echo.Context) error

func (*Mockpay) PayQuery

func (a *Mockpay) PayQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)

func (*Mockpay) Refund

func (a *Mockpay) Refund(ctx echo.Context, cfg *config.Refund) (*config.Result, error)

func (*Mockpay) RefundNotify

func (a *Mockpay) RefundNotify(ctx echo.Context) error

func (*Mockpay) RefundQuery

func (a *Mockpay) RefundQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)

func (*Mockpay) SetAccount

func (a *Mockpay) SetAccount(account *config.Account) payment.Driver

func (*Mockpay) SetNotifyCallback

func (a *Mockpay) SetNotifyCallback(callback func(echo.Context) error) payment.Driver

func (*Mockpay) SubmitPayNotice

func (a *Mockpay) SubmitPayNotice(tradeNo string) error

func (*Mockpay) SubmitRefundNotice

func (a *Mockpay) SubmitRefundNotice(refundNo string) error

func (*Mockpay) VerifySign

func (a *Mockpay) VerifySign(ctx echo.Context) error

Jump to

Keyboard shortcuts

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