weixin

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(config model.ClientConfig) model.Client

Types

type Client

type Client struct {
	Config *ClientConfig
	// contains filtered or unexported fields
}

func (*Client) GetOrder

func (w *Client) GetOrder(ctx context.Context, no string) (*model.OrderResp, error)

func (*Client) Init

func (w *Client) Init() error

func (*Client) ParseOrderNotify

func (w *Client) ParseOrderNotify(r []byte) (*model.OrderResp, error)

func (*Client) Refresh

func (w *Client) Refresh(config model.ClientConfig) error

func (*Client) UnifiedOrder

func (w *Client) UnifiedOrder(ctx context.Context, code string, req model.OrderUnifiedReq) (*model.OrderResp, error)

func (*Client) UnifiedRefund

func (w *Client) UnifiedRefund(ctx context.Context, req model.RefundUnifiedReq) (*model.RefundResp, error)

type ClientConfig

type ClientConfig struct {
	AppId             string `json:"appId" validate:"required"`                      //appId
	MchId             string `json:"mchId" validate:"required"`                      //商户ID 或者服务商模式的 sp_mchid
	PrivateKeyContent []byte `json:"privateKeyContent,optional" validate:"required"` //apiclient_key.pem 证书文件的对应字符串
	SerialNumber      string `json:"serialNumber,optional" validate:"required"`      //apiclient_cert.pem 证书文件的证书号
	ApiV3Key          string `json:"apiV3Key" validate:"required"`                   //apiV3Key,商户平台获取
	Status            bool   `json:"status"`                                         // 是否启用
}

ClientConfig API 版本 - V3协议说明 https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay-1.shtml ClientConfig 实现了 pay.ClientConfig 接口

func (ClientConfig) Validate

func (p ClientConfig) Validate() error

Jump to

Keyboard shortcuts

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