payutil

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesGcmDecrypt

func AesGcmDecrypt(ciphertext, key, associated_data, nonce string) (result string, err error)

func ParsePKCS1PublicKey

func ParsePKCS1PublicKey(data []byte) (key *rsa.PublicKey, err error)

func RSAEncryptPKCS1

func RSAEncryptPKCS1(plaintext, key []byte) (string, error)

func Report

func Report(clt *core.Client, req map[string]string) (resp map[string]string, err error)

Report 交易保障.

func Report2

func Report2(clt *core.Client, req *ReportRequest) (err error)

Report2 交易保障.

Types

type ReportRequest

type ReportRequest struct {
	XMLName      struct{}  `xml:"xml" json:"-"`
	DeviceInfo   string    `xml:"device_info"`   // 微信支付分配的终端设备号,商户自定义
	NonceStr     string    `xml:"nonce_str"`     // 随机字符串,不长于32位。NOTE: 如果为空则系统会自动生成一个随机字符串。
	SignType     string    `xml:"sign_type"`     // 签名类型,目前支持HMAC-SHA256和MD5,默认为MD5
	InterfaceURL string    `xml:"interface_url"` // 刷卡支付终端上报统一填:https://api.mch.weixin.qq.com/pay/batchreport/micropay/total
	UserIP       string    `xml:"user_ip"`       // 发起接口调用时的机器IP
	Trades       string    `xml:"trades"`        // 上报数据包
	ExecuteTime  int       `xml:"execute_time"`  // 接口耗时情况,单位为毫秒
	ReturnCode   string    `xml:"return_code"`   // 返回状态码
	ReturnMsg    string    `xml:"return_msg"`    // 返回信息
	ResultCode   string    `xml:"result_code"`   // 业务结果
	ErrCode      string    `xml:"err_code"`      // 错误代码
	ErrCodeDesc  string    `xml:"err_code_des"`  // 错误代码描述
	OutTradeNo   string    `xml:"out_trade_no"`  // 商户订单号
	Time         time.Time `xml:"time"`          // 商户上报时间
}

Jump to

Keyboard shortcuts

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