wx_mch

package
v0.0.0-...-3b54ddd Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

wx_mch

Documentation

Index

Constants

View Source
const (
	TransfersParamsCheckNameNoCheck    = "NO_CHECK"
	TransfersParamsCheckNameForceCheck = "FORCE_CHECK"
)

Variables

This section is empty.

Functions

func Init

func Init(MchAppid, Mchid, MckKey, CertPemPath, KeyPemPath, CAPemPath string)

请先初始化 几个path请使用绝对path 或者 运行二进制的相对path

func SecurePost

func SecurePost(url string, xmlContent []byte) ([]byte, error)

func SignData

func SignData(src interface{}, key string) (sign string)

签名

Types

type TransfersParams

type TransfersParams struct {
	PartnerTradeNo string // 商户订单号,需保持唯一性 (只能是字母或者数字,不能包含有符号)
	Openid         string // 商户appid下,某用户的openid
	CheckName      string // NO_CHECK:不校验真实姓名 FORCE_CHECK:强校验真实姓名
	ReUserName     string // 可选, 收款用户真实姓名。如果check_name设置为FORCE_CHECK,则必填用户真实姓名
	Amount         int    // 企业付款金额,单位为分
	Desc           string // 企业付款操作说明信息。必填。
	SpbillCreateIp string // 调用接口的机器Ip地址
}

企业付款参数 https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2

type TransfersRsp

type TransfersRsp struct {
	XMLName        struct{} `xml:"xml"`
	ReturnCode     string   `xml:"return_code"`
	ReturnMsg      string   `xml:"return_msg"`
	MchAppid       string   `xml:"mch_appid"`
	Mchid          string   `xml:"mchid"`
	DeviceInfo     string   `xml:"device_info"`
	NonceStr       string   `xml:"nonce_str"`
	ResultCode     string   `xml:"result_code"`
	PartnerTradeNo string   `xml:"partner_trade_no"`
	PaymentNo      string   `xml:"payment_no"`
	PaymentTime    string   `xml:"payment_time"`
}

func Transfers

func Transfers(p TransfersParams) (rsp TransfersRsp, err error)

Jump to

Keyboard shortcuts

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