wechat

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 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

MiniProgram 微信小程序

func (*Wechat) Notify

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

Notify 微信支付 V3 版本 API 回调通知处理器

func (*Wechat) OfficialAccount

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

OfficialAccount 公众号

func (*Wechat) Pay

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

Pay 微信支付 使用 v2 版本的API支付接口

func (*Wechat) Payment

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

Payment 微信支付 使用 V3 版本的支付 API 接口

func (*Wechat) Provide

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

func (*Wechat) Refund

func (w *Wechat) Refund() (*refunddomestic.RefundsApiService, error)

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