pay

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

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

Go to latest
Published: May 10, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseOrder

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

关闭订单.

func DownloadBill

func DownloadBill(filepath string, req map[string]string, httpClient *http.Client) (written int64, err error)

下载对账单到到文件.

func DownloadBillToWriter

func DownloadBillToWriter(writer io.Writer, req map[string]string, httpClient *http.Client) (written int64, err error)

下载对账单到 io.Writer.

func MicroPay

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

提交刷卡支付.

func OrderQuery

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

查询订单.

func Refund

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

申请退款.

NOTE: 请求需要双向证书.

func RefundQuery

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

查询退款.

func Reverse

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

撤销订单.

NOTE: 请求需要双向证书.

func UnifiedOrder

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

统一下单.

Types

type OrderCoupon

type OrderCoupon struct {
	CouponBatchId string // 代金券批次ID
	CouponType    string // 代金券类型, CASH--充值代金券, NO_CASH---非充值代金券
	CouponId      string // 代金券ID
	CouponFee     int64  // 单个代金券支付金额
}

type OrderQueryRequest

type OrderQueryRequest struct {
	TransactionId string // 微信的订单号,优先使用
	OutTradeNo    string // 商户系统内部的订单号,当没提供transaction_id时需要传这个。
	NonceStr      string // 随机字符串,不长于32位。NOTE: 如果为空则系统会自动生成一个随机字符串。
}

type OrderQueryResponse

type OrderQueryResponse struct {
	AppId string // 微信开放平台审核通过的应用APPID
	MchId string // 微信支付分配的商户号

	OpenId         string // 用户在商户appid下的唯一标识
	TradeType      string // 调用接口提交的交易类型,取值如下:JSAPI,NATIVE,APP,MICROPAY,详细说明见参数规定
	TradeState     string // 交易状态
	BankType       string // 银行类型,采用字符串类型的银行标识
	TotalFee       int64  // 订单总金额,单位为分
	CashFee        int64  // 现金支付金额订单现金支付金额,详见支付金额
	TransactionId  string // 微信支付订单号
	OutTradeNo     string // 商户系统的订单号,与请求一致。
	TimeEnd        string // 订单支付时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则
	TradeStateDesc string // 对当前查询订单状态的描述和下一步操作的指引

	// 下面字段都是可选返回的(详细见微信支付文档), 为空值表示没有返回, 程序逻辑里需要判断
	DeviceInfo         string        // 微信支付分配的终端设备号
	IsSubscribe        *bool         // 用户是否关注公众账号
	SettlementTotalFee *int64        // 应结订单金额=订单金额-非充值代金券金额,应结订单金额<=订单金额。
	FeeType            string        // 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
	CashFeeType        string        // 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
	CouponFee          *int64        // “代金券”金额<=订单金额,订单金额-“代金券”金额=现金支付金额,详见支付金额
	CouponCount        *int          // 代金券使用数量
	Coupons            []OrderCoupon // 代金券列表
	Attach             string        // 附加数据,原样返回
}

func OrderQuery2

func OrderQuery2(clt *core.Client, req *OrderQueryRequest) (resp *OrderQueryResponse, err error)

type RefundRequest

type RefundRequest struct {
	DeviceInfo    string // 终端设备号
	NonceStr      string // 随机字符串,不长于32位。NOTE: 如果为空则系统会自动生成一个随机字符串。
	TransactionId string // 微信生成的订单号,在支付通知中有返回
	OutTradeNo    string // 商户侧传给微信的订单号
	OutRefundNo   string // 商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔
	TotalFee      int64  // 订单总金额,单位为分,只能为整数,详见支付金额
	RefundFee     int64  // 退款总金额,订单总金额,单位为分,只能为整数,详见支付金额
	RefundFeeType string // 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
	OperUserId    string // 操作员帐号, 默认为商户号
}

type RefundResponse

type RefundResponse struct {
	AppId string // 微信分配的公众账号ID
	MchId string // 微信支付分配的商户号

	TransactionId string // 微信订单号
	OutTradeNo    string // 商户系统内部的订单号
	OutRefundNo   string // 商户退款单号
	RefundId      string // 微信退款单号
	RefundFee     int64  // 退款总金额,单位为分,可以做部分退款
	TotalFee      int64  // 订单总金额,单位为分,只能为整数,详见支付金额
	CashFee       int64  // 现金支付金额,单位为分,只能为整数,详见支付金额

	// 下面字段都是可选返回的(详细见微信支付文档), 为空值表示没有返回, 程序逻辑里需要判断
	DeviceInfo          string // 微信支付分配的终端设备号,与下单一致
	RefundChannel       string // 退款渠道
	FeeType             string // 订单金额货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
	SettlementRefundFee *int64 // 退款金额=申请退款金额-非充值代金券退款金额,退款金额<=申请退款金额
	SettlementTotalFee  *int64 // 应结订单金额=订单金额-非充值代金券金额,应结订单金额<=订单金额。
	CashRefundFee       *int64 // 现金退款金额,单位为分,只能为整数,详见支付金额

}

func Refund2

func Refund2(clt *core.Client, req *RefundRequest) (resp *RefundResponse, err error)

type UnifiedOrderRequest

type UnifiedOrderRequest struct {
	DeviceInfo     string // 终端设备号(门店号或收银设备ID),注意:PC网页或公众号内支付请传"WEB"
	NonceStr       string // 随机字符串,不长于32位。NOTE: 如果为空则系统会自动生成一个随机字符串。
	Body           string // 商品或支付单简要描述
	Detail         string // 商品名称明细列表
	Attach         string // 附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据
	OutTradeNo     string // 商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
	FeeType        string // 符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
	TotalFee       int64  // 订单总金额,单位为分,详见支付金额
	SpbillCreateIP string // APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。
	TimeStart      string // 订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则
	TimeExpire     string // 订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则
	GoodsTag       string // 商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠
	NotifyURL      string // 接收微信支付异步通知回调地址,通知url必须为直接可访问的url,不能携带参数。
	TradeType      string // 取值如下:JSAPI,NATIVE,APP,详细说明见参数规定
	ProductId      string // trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。
	LimitPay       string // no_credit--指定不能使用信用卡支付
	OpenId         string // rade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。
}

type UnifiedOrderResponse

type UnifiedOrderResponse struct {
	AppId string // 微信开放平台审核通过的应用APPID
	MchId string // 微信支付分配的商户号

	TradeType string // 调用接口提交的交易类型,取值如下:JSAPI,NATIVE,APP,详细说明见参数规定
	PrepayId  string // 微信生成的预支付回话标识,用于后续接口调用中使用,该值有效期为2小时

	// 下面字段都是可选返回的(详细见微信支付文档), 为空值表示没有返回, 程序逻辑里需要判断
	DeviceInfo string // 调用接口提交的终端设备号。
	CodeURL    string // trade_type 为 NATIVE 时有返回,可将该参数值生成二维码展示出来进行扫码支付
	MWebURL    string // trade_type 为 MWEB 时有返回
}

func UnifiedOrder2

func UnifiedOrder2(clt *core.Client, req *UnifiedOrderRequest) (resp *UnifiedOrderResponse, err error)

Jump to

Keyboard shortcuts

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