yiling

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceCreateAndPay = "unipay.acquire.createandpay" //条码支付
	ServiceQuery        = "unipay.acquire.query"        //查询
	ServiceRefund       = "unipay.acquire.refund"       //退款
	ServiceRefundQuery  = "unipay.acquire.queryrefund"  //退款查询
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BizErr

type BizErr struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
}

BizErr 用于判断通联的业务逻辑是否有错误

func (*BizErr) Error

func (e *BizErr) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(merchantNo, key string) (*Client, error)

NewClient 初始化扫呗客户端 merchantNo string // 支付系统:商户号 key string // 商户系统令牌

type RspBase

type RspBase struct {
	SysCode      string `json:"sys_code"`    //系统异常 sys_code 类型:FAIL/SUCCESS
	ResultCode   string `json:"result_code"` //业务异常 result_code 类型:FAIL/SUCCESS/DOING
	ResultMsg    string `json:"result_msg"`
	MerchantName string `json:"merchantName"` //商户名称
	MerchantNum  string `json:"merchantNum"`  //门店门店编号

}

type RspPay

type RspPay struct {
	RspBase
	ChannelId        string `json:"channelId"`        //支付通道:0未知类型
	PayClient        string `json:"payClient"`        //支付客户端类型:1微信,2,4支付宝,3百度钱包,5翼支付,6云闪付,7刷卡,8浙北电子钱包,9QQ钱包,10沃支付,11京东支付,0未知类型
	OrderType        int    `json:"orderType"`        //订单类型:1普通支付,2普通退款,3撤销,4押金冻结,5押金解冻,6押金撤销,7押金支付,8押金支付后退款,9押金支付撤销,0未知类型
	PayType          int    `json:"payType"`          //订单支付方式:1扫码,2条码,3微信公众号&小程序&支付宝服务窗,6app,7银行卡,10刷脸,12无卡支付,0位置类型
	Status           int    `json:"status"`           //订单状态:0处理中,2成功,6关闭&撤销,8失败,99或者0未知类型
	InputFee         int    `json:"inputFee"`         //输入金额,单位分
	TotalFee         int    `json:"totalFee"`         //订单状态:0处理中,2成功,6关闭&撤销,8失败,99或者0未知类型
	BuyerFee         int    `json:"buyerFee"`         //用户支付购买金额,单位分
	RefundFee        int    `json:"refundFee"`        //总退款金额,单位分
	SellerFee        int    `json:"sellerFee"`        //商家卖出金额,单位分
	DiscountFee      int    `json:"discountFee"`      //优惠金额,单位分
	RateFee          int    `json:"rateFee"`          //交易手续费,单位分
	BusinessId       string `json:"businessId"`       //商户id
	TerminalNum      string `json:"terminalNum"`      //设备终端编号,根据门店设备终端号生成
	CashierNum       string `json:"cashierNum"`       //收银员编号
	OrderNum         string `json:"orderNum"`         //订单编号
	OrderNumParent   string `json:"orderNumParent"`   //主订单编号
	OrderNumExternal string `json:"orderNumExternal"` //商户订单编号
	OrderNumChannel  string `json:"orderNumChannel"`  //上游官方单号
	OrderNumOfficial string `json:"orderNumOfficial"` //支付宝,微信,银联官方单号
	TransStart       string `json:"transStart"`       //交易开始时间,格式yyyy-MM-dd HH:mm:ss
	TransTime        string `json:"transTime"`        //交易结束时间,格式yyyy-MM-dd HH:mm:ss
	DataExtra        string `json:"dataExtra"`        //订单支付相关信息(json字符串)
	TransBuyerId     string `json:"transBuyerId"`     //用户支付卡号
	TransBizCode     string `json:"transBizCode"`     //订单标记
	TransSubject     string `json:"transSubject"`     //订单支付title,标题,详见支付页面详情
	Remark           string `json:"remark"`           //订单备注
	Attach           string `json:"attach"`           //商户订单扩展回传字段(json字符串)
	DiscountVar      string `json:"discountVar"`      //优惠金额类型(json字符串):997单品优惠,101折扣券,102商户优惠券,40支付宝红包
	ClientIp         string `json:"clientIp"`         //支付终端
}

Jump to

Keyboard shortcuts

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