pay

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliConf

type AliConf struct {
	AppId      string `json:"app_id,optional"`
	PrivateKey string `json:"private_key,optional"`
	PublicKey  string `json:"public_key,optional"`
	IsProd     bool   `json:"is_prod,optional"`
	NotifyUrl  string `json:"notifyUrl,optional"`
}

AliConf 微信支付配置

type AliPayTool

type AliPayTool struct {
	Conf   AliConf
	Client *alipay.Client
}

func NewAliPyTool

func NewAliPyTool(conf AliConf) *AliPayTool

func (*AliPayTool) AlipayNotify

func (p *AliPayTool) AlipayNotify(req *http.Request)

func (*AliPayTool) QueryRefund

func (p *AliPayTool) QueryRefund(orderNo, refundNo string) (*alipay.TradeFastpayRefundQueryResponse, error)

QueryRefund 查询退款接口

func (*AliPayTool) Refund

Refund 退款接口

func (*AliPayTool) TradeCreate

func (p *AliPayTool) TradeCreate(ctx context.Context, openId string, payNo string, payAmount string, description string) (*alipay.TradeCreateResponse, error)

TradeCreate 统一收单交易创建接口

func (*AliPayTool) TradeQuery

func (p *AliPayTool) TradeQuery(orderNo string) *alipay.TradeQueryResponse

TradeQuery 交易查询接口

type WxConf

type WxConf struct {
	AppMiniId string `json:"appMiniId,optional"` //小程序 APPID
	//AppId      string `json:"appId,optional"`      //公众号 APPID
	//APPId      string `json:"AppId,optional"`      //APP   APPID
	MchId      string `json:"mchId,optional"`      //微信商户id
	SerialNo   string `json:"serialNo,optional"`   //商户证书的证书序列号
	ApiV3Key   string `json:"apiV3Key,optional"`   //apiV3Key,商户平台获取
	PrivateKey string `json:"privateKey,optional"` //privateKey:私钥 apiclient_key.pem 读取后的内容
	AppSecret  string `json:"appSecret,optional"`
	NotifyUrl  string `json:"notifyUrl,optional"` //支付通知回调服务端地址
}

WxConf 微信支付配置

type WxPayTool

type WxPayTool struct {
	Conf   WxConf
	Client *wechat.ClientV3
}

func NewWxPayTool

func NewWxPayTool(conf WxConf) (*WxPayTool, error)

func (*WxPayTool) Notify

func (p *WxPayTool) Notify(req *http.Request) (error, *wechat.V3DecryptBusifavorResult)

func (*WxPayTool) WxJsPay

func (p *WxPayTool) WxJsPay(ctx context.Context, openId string, total int64, tradeNo string, description string) (*wechat.PrepayRsp, error)

WxJsPay 支付,在微信支付服务后台生成预支付交易单

func (*WxPayTool) WxQueryRefund

func (p *WxPayTool) WxQueryRefund(refundNo string) (*wechat.RefundQueryRsp, error)

WxQueryRefund 查询退款状态

func (*WxPayTool) WxRefund

func (p *WxPayTool) WxRefund(ctx context.Context, refund int64, total int64, transactionId string, refundNo string, reason string) (*wechat.RefundRsp, string)

WxRefund 退款

func (*WxPayTool) WxTestV3Query

func (p *WxPayTool) WxTestV3Query(no string) *wechat.QueryOrderRsp

WxTestV3Query 交易查询

Jump to

Keyboard shortcuts

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