bcpay

package
v0.0.0-...-0818f1f Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSign

func GenerateSign(p map[string]any, secret string) string

生成签名

func SHA256

func SHA256(originStr string) string

SHA256 加密和验签

Types

type BalanceResp

type BalanceResp struct {
	Currency     string  `json:"currency"`     // 币种
	PayinValue   float64 `json:"payinValue"`   // 代收余额
	PayoutValue  float64 `json:"payoutValue"`  // 代付余额
	DisableValue float64 `json:"disableValue"` // 冻结余额
}

type Bcpay

type Bcpay struct {
	AppId     string
	SecretKey string
	Url       string
	ReturnUrl string
	NotifyUrl string
}

func (*Bcpay) Balance

func (bc *Bcpay) Balance(ctx context.Context) (BalanceResp, error)

余额查询

func (*Bcpay) Withdraw

func (bc *Bcpay) Withdraw(ctx context.Context, req map[string]any) (base.WithdrawRes, error)

代付订单创建

type Factory

type Factory struct {
}

func (*Factory) CreatePay

func (p *Factory) CreatePay(config base.Config) base.Payment

type Resp

type Resp struct {
	Code  int64  `json:"code"`
	Msg   string `json:"msg"`
	Error string `json:"error"`
	Data  any    `json:"data"`
}

Jump to

Keyboard shortcuts

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