wechat

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WechatConfigInitSet added in v1.0.13

func WechatConfigInitSet(initSet WechatConfigInit)

Types

type Callback

type Callback struct {
	Id           string    `json:"id"`
	CreateTime   time.Time `json:"create_time"`
	ResourceType string    `json:"resource_type"`
	EventType    string    `json:"event_type"`
	Summary      string    `json:"summary"`
	Resource     Resource  `json:"resource"`
}

type Resource

type Resource struct {
	OriginalType   string `json:"original_type"`
	Algorithm      string `json:"algorithm"`
	Ciphertext     string `json:"ciphertext"`
	AssociatedData string `json:"associated_data"`
	Nonce          string `json:"nonce"`
}

type Response

type Response struct {
	Mchid          string    `json:"mchid"`
	Appid          string    `json:"appid"`
	OutTradeNo     string    `json:"out_trade_no"`
	TransactionId  string    `json:"transaction_id"`
	TradeType      string    `json:"trade_type"`
	TradeState     string    `json:"trade_state"`
	TradeStateDesc string    `json:"trade_state_desc"`
	BankType       string    `json:"bank_type"`
	Attach         string    `json:"attach"`
	SuccessTime    time.Time `json:"success_time"`
	Payer          struct {
		Openid string `json:"openid"`
	} `json:"payer"`
	Amount struct {
		Total         int    `json:"total"`
		PayerTotal    int    `json:"payer_total"`
		Currency      string `json:"currency"`
		PayerCurrency string `json:"payer_currency"`
	} `json:"amount"`
}

type WechatClient

type WechatClient interface {
	V3Client() (*wechat3.ClientV3, error)
	CommonWechat() *commonWechat.Wechat
	V2Client() (*wechat.Client, error)
	OfficialAccount() *officialaccount.OfficialAccount
	DecryptToString(resource *Resource) (certificate string, err error)
}

func NewWechatClient

func NewWechatClient() WechatClient

NewWechatClient /*

type WechatConfigInit added in v1.0.13

type WechatConfigInit func() *WehcatConfig

type WechatService

type WechatService struct {
	WehcatConfig *WehcatConfig
}

func (*WechatService) ApiclientKey

func (s *WechatService) ApiclientKey() (string, error)

func (*WechatService) CommonWechat

func (s *WechatService) CommonWechat() *commonWechat.Wechat

func (*WechatService) DecryptToString

func (s *WechatService) DecryptToString(resource *Resource) (certificate string, err error)

func (*WechatService) OfficialAccount

func (s *WechatService) OfficialAccount() *officialaccount.OfficialAccount

func (*WechatService) V2Client

func (s *WechatService) V2Client() (*wechat.Client, error)

func (*WechatService) V3Client

func (s *WechatService) V3Client() (*wechat3.ClientV3, error)

type WehcatConfig

type WehcatConfig struct {
	AppId              string
	Appkey             string
	MchId              string
	SerialNo           string
	ApiKey3            string
	ApiclientKeyPath   string
	ApiclientCerPath   string
	NotifyUrl          string
	IsProd             bool
	ApiclientCer12Path string
}

func WechatConfig

func WechatConfig() *WehcatConfig

Jump to

Keyboard shortcuts

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