wechat

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TradeSuccess    = "SUCCESS"    // 支付成功
	TradeRefund     = "REFUND"     // 转入退款
	TradeNotPay     = "NOTPAY"     // 未支付
	TradeClosed     = "CLOSED"     // 已关闭
	TradeRevoked    = "REVOKED"    // 已撤销
	TradeUserPaying = "USERPAYING" // 用户支付中
	TradePayError   = "PAYERROR"   // 支付失败
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MiniProgram

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

type OfficialAccount

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

type Option

type Option func(*Options)

func WithAppId

func WithAppId(appId string) Option

func WithCertSerialNum

func WithCertSerialNum(certSerialNum string) Option

func WithMiniAppId

func WithMiniAppId(appId string) Option

func WithMiniSecret

func WithMiniSecret(secret string) Option

func WithOfficialAppId

func WithOfficialAppId(appId string) Option

func WithOfficialEncodingAesKey

func WithOfficialEncodingAesKey(key string) Option

func WithOfficialSecret

func WithOfficialSecret(secret string) Option

func WithOfficialToken

func WithOfficialToken(token string) Option

func WithPayAppId

func WithPayAppId(appId string) Option

func WithPayKey

func WithPayKey(key string) Option

func WithPayMchid

func WithPayMchid(mchid string) Option

func WithPayNotifyUrl

func WithPayNotifyUrl(notifyUrl string) Option

func WithPayPrivateKey

func WithPayPrivateKey(privateKey string) Option

func WithPayPrivateKeyFile

func WithPayPrivateKeyFile(privateKeyFile string) Option

type Options

type Options struct {
	MiniProgram      // 小程序配置
	OfficialAccount  // 公众号配置
	payments.Options // 支付配置
	// contains filtered or unexported fields
}

type Wechat

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

func New

func New(opts ...Option) *Wechat

func (*Wechat) MiniProgram

func (w *Wechat) MiniProgram() *miniprogram.MiniProgram

func (*Wechat) Notify

func (w *Wechat) Notify() (*notify.Handler, error)

func (*Wechat) OfficialAccount

func (w *Wechat) OfficialAccount() *officialaccount.OfficialAccount

func (*Wechat) Pay

func (w *Wechat) Pay() *pay.Pay

func (*Wechat) Payment

func (w *Wechat) Payment(payType payments.PaymentType) (payments.Payment, error)

func (*Wechat) Provide

func (w *Wechat) Provide(ctx context.Context) interface{}

func (*Wechat) SetCache

func (w *Wechat) SetCache(cache cache.Cache)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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