pay

package
v0.0.0-...-7a73484 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

*

  • @Author: Gosin
  • @Date: 2019/12/12 15:38

*

  • @Author: YangYun
  • @Date: 2020/8/25 16:56

Index

Constants

View Source
const (
	PAY_Suc  = 1
	PAY_Fail = 2

	CLEAR_STATUS_none = 0
	CLEAR_STATUS_ing  = 1
	CLEAR_STATUS_suc  = 2
	CLEAR_STATUS_fail = 3

	//平安分账信息 - 支付模式 0-冻结支付 1-普通支付
	PINGAN_PAYMODEL_dj     = 0
	PINGAN_PAYMODEL_normal = 1
)
View Source
const (
	TYPE_charge_in  = 1 // 入账
	TYPE_charge_out = 2 // 出账

	ORDER_TYPE_pay                   = 1 // 收取支付手续费
	ORDER_TYPE_insure_fund_fee       = 2 // 保险清分手续费
	ORDER_TYPE_renew_insure_fund_fee = 3 // 续保清分手续费

	FUND_SOURCE_TYPE_bus          = 1 // 商家来源
	FUND_SOURCE_TYPE_insure       = 2 // 保险公司来源
	FUND_SOURCE_TYPE_renew_insure = 3 // 续保公司来源

	AGENT_TYPE_sand = 2 //上海杉德清算
	AGENT_TYPE_ccb  = 3 //杭州建行清算
)
View Source
const (
	PayCodeField     = "payCode"  // 支付标识
	PayAuthCodeField = "authCode" // 授权码
)
View Source
const (
	// 接入方式
	//0:Android SDK
	//1:iOS SDK
	//2:windows SDK
	//3:直连
	Access_Android_SDK = "0"
	Acess_iOS_SDK      = "1"
	Access_Windows_SDK = "2"
	Access_OPEN_SDK    = "3"
)
View Source
const (
	PayWayWx      = "1" //微信支付(小程序)
	PayWayAli     = "2" // 支付宝支付
	PayWayYinlian = "3" // 银联支付
)
View Source
const (
	TraTypeOffical = "5" //公众号
	TraTypeProgram = "8" //小程序
)

交易类型

View Source
const (
	PayWayYinLianBScan = 0 // 银联B扫C
	PayWayAliBScan     = 1 //.支付宝B扫C
	PaWayWxBScan       = 2 // 微信B扫C
	PayWayYinLianCScan = 3 //.银联C扫B
	PayWayWechat       = 5 //公众号支付
	PayWayAliC         = 7 //支付宝C扫B
	PayWayMinProgram   = 8 //小程序交易

)
View Source
const (
	FeeType01 = 0 // 手续费平摊且分账管理方比例相加100%
	FeeType02 = 1 // 手续费平摊且分账管理方比例+商户比例100%
	FeeType03 = 2 //手续费由主商户承担且分账管理方比例相加100%;
	FeeType04 = 3 //手续费主商户承担且分账管理方比例+商户比例100%(自定义模式下必传,其他情况无需传该参数)
)

分账计算类型

View Source
const (
	AccModel01 = 1 //自定义
	AccModel02 = 2 //非自定义
)

AccModel分账模式:1自定义 2非自定义

View Source
const (
	AccWay01 = 1 //整单分账
	AccWay02 = 2 //商品分账
)

AccWay分账类型

Variables

This section is empty.

Functions

This section is empty.

Types

type AliPay

type AliPay struct {
	Zfbappid        string `json:"zfbappid" mapstructure:"zfbappid"`                // 支付宝appid(支付宝支付必传)
	ZfbBuyerAccount string `json:"zfbBuyerAccount" mapstructure:"zfbBuyerAccount" ` // 买家账号(支付宝支付,非必须)
}

type ArgsGetAliUserInfo

type ArgsGetAliUserInfo struct {
	GrantType     string `json:"grant_type"`
	Code          string `json:"code"`
	RefreshTtoken string `json:"refresh_token"`
	Cid           string //地区信息
}

type ArgsGetInsureAcct

type ArgsGetInsureAcct struct {
	PayChannel    int //支付渠道
	InsureChannel int //保险渠道
}

type ArgsGetOpenid

type ArgsGetOpenid struct {
	Code string
	Cid  string //地区信息
}

type ArgsGetPaypalTag

type ArgsGetPaypalTag struct {
	AgetId   string `mapstructure:"agetId" json:"agetId"`     // 机构号
	CustId   string `mapstructure:"custId" json:"custId"`     // 商户号
	Ip       string `mapstructure:"ip" json:"ip"`             // ip
	PayCode  string `mapstructure:"payCode" json:"payCode"`   // 支付标识
	AuthCode string `mapstructure:"authCode" json:"authCode"` // 授权码
	Cid      string `mapstructure:"cid" json:"cid"`           //地区信息
}

获取银联用户标识

type ArgsGetwxInfo

type ArgsGetwxInfo struct {
	AgentId   string // 机构号
	CustId    string // 商户号
	TimeStamp string //时间戳
	Version   string // 版本号 默认 1.0.0
	Cid       string //地区信息
}

type ArgsMerchantAccountQuery

type ArgsMerchantAccountQuery struct {
	AgetId    string `mapstructure:"agetId"`    //机构号
	CustId    string `mapstructure:"custId"`    //商户号(商户号与商圈编号二选一)
	AreaId    string `mapstructure:"areaId"`    //商圈编号(商户号与商圈编号二选一)
	Page      string `mapstructure:"page"`      // 默认1	页码
	Number    string `mapstructure:"number"`    // 默认10	行数
	TimeStamp string `mapstructure:"timeStamp"` //时间戳
	Version   string `mapstructure:"version"`   //版本号 默认 1.0.0
	Cid       string `mapstructure:"cid"`       //地区信息
}

商圈分账规则查询参数

type ArgsNotify

type ArgsNotify struct {
	PayChannel int // 支付渠道
	Data       string
}

type ArgsOrderAccount

type ArgsOrderAccount struct {
	AgetId  string `mapstructure:"agetId" json:"agetId"`   // 机构号
	CustId  string `mapstructure:"custId" json:"custId"`   //  商户号
	OrderNo string `mapstructure:"orderNo" json:"orderNo"` //平台订单号
	AreaId  string `mapstructure:"areaId" json:"areaId"`   //商圈编号
	FeeType string `mapstructure:"feeType" json:"feeType"` // 	分账计算类型
	// :0.手续费平摊且分账管理方比例相加100%;
	//1.手续费平摊且分账管理方比例+
	// 商户比例100%;
	//2.
	//手续费由主商户承担且分账管理方比例相加100%
	//;3.手续费主商户承担且分账管理方比例+商户比例100%(自定义模式下必传,其他情况无需传该参数)
	AccModel       string             `mapstructure:"accModel" json:"accModel"`                       // 分账模式:1自定义 2非自定义
	AccWay         string             `mapstructure:"accWay" json:"accWay"`                           //分账类型:1整单分账 2商品分账
	OrderAccDetail OrderAccDetailInfo `mapstructure:"orderAccDetail" json:"orderAccDetail,omitempty"` // 整单详情(自定义模式下,整单分账类型必传,其他情况无需传该参数)
	GoodsAccDetail GoodsAccDetailInfo `mapstructure:"goodsAccDetail" json:"goodsAccDetail,omitempty"` //商品详情(自定义模式下,商品分账类型必传,其他情况无需传该参数)(数组对象)
	AccId          string             `mapstructure:"accId" json:"accId"`                             // accId 分账规则编号(非自定义模式下,整单分账类型必传,其他情况无需传该参数)
	GoodsDetail    []GoodsDetai       `mapstructure:"goodsDetail" json:"goodsDetail,omitempty"`       // 商品详情
	Remark         string             `mapstructure:"remark" json:"remark,omitempty"`                 //备注
	TimeStamp      string             `mapstructure:"timeStamp" json:"timeStamp"`                     //时间戳
	Version        string             `mapstructure:"version" json:"version"`                         //版本号 默认 1.0.0
	Cid            string             `mapstructure:"cid" json:"cid"`                                 //地区信息
}

sign每一个参数 经过 lib data['sign'] = 即可

func (*ArgsOrderAccount) Check

func (orderaccount *ArgsOrderAccount) Check() error

type ArgsReplyDownload

type ArgsReplyDownload struct {
	CustId string //结构号
	Date   string //日期 格式为 2016-01-02 15:14:05
	Path   string //下载的位置信息 可以动态配置
	Cid    string //地区信息
}

新大陆国通的 对账文件和分账文件 接口定义

func (*ArgsReplyDownload) Format

func (this *ArgsReplyDownload) Format() string

生成对账文件名称

type ArgsSplitaccount

type ArgsSplitaccount struct {
	CustId string //结构号
	Date   string //日期 格式为 2016-01-02 15:14:05
	Path   string //下载的位置信息 可以动态配置
	Cid    string //地区信息
}

分账文件请求对象

func (*ArgsSplitaccount) FormatFenzhang

func (this *ArgsSplitaccount) FormatFenzhang() string

生成分账文件名称 机构号+日期+ACC 如:20210615 的对账文件为 6100000127-20210615ACC

type ArgsTradeQuery

type ArgsTradeQuery struct {
	OrderNo   string // 订单号
	AgetId    string // 机构号
	CustId    string // 商户号
	CustLogin string // 商户手机号码
	TimeStamp string // 时间戳
	Version   string // 版本号 默认为 1.0.0
	Cid       string //地区信息
}

交易查询接口参数

type ArgsunionOrderFunc

type ArgsunionOrderFunc func(order *ArgsunionidOrder)

func WithOrderAccess

func WithOrderAccess(access string) ArgsunionOrderFunc

func WithOrderAgentId

func WithOrderAgentId(agetid string) ArgsunionOrderFunc

func WithOrderAtqTag

func WithOrderAtqTag(atqATag string) ArgsunionOrderFunc

func WithOrderCustLogin

func WithOrderCustLogin(custLogin string) ArgsunionOrderFunc

func WithOrderCustid

func WithOrderCustid(custid string) ArgsunionOrderFunc

func WithOrderDefaultTitle

func WithOrderDefaultTitle() ArgsunionOrderFunc

默认返回

func WithOrderDriveNo

func WithOrderDriveNo(driverNo string) ArgsunionOrderFunc

func WithOrderIp

func WithOrderIp(ip string) ArgsunionOrderFunc

func WithOrderLatitude

func WithOrderLatitude(lat string) ArgsunionOrderFunc

func WithOrderLon

func WithOrderLon(lon string) ArgsunionOrderFunc

func WithOrderNo

func WithOrderNo(orderNo string) ArgsunionOrderFunc

属性赋值到参数类型

func WithOrderOpenid

func WithOrderOpenid(openid string) ArgsunionOrderFunc

func WithOrderPayWay

func WithOrderPayWay(payWay string) ArgsunionOrderFunc

func WithOrderProdOrderNo

func WithOrderProdOrderNo(prodOrderNo string) ArgsunionOrderFunc

func WithOrderRemark

func WithOrderRemark(remark string) ArgsunionOrderFunc

func WithOrderTitle

func WithOrderTitle(title string) ArgsunionOrderFunc

func WithOrderTraType

func WithOrderTraType(traType string) ArgsunionOrderFunc

func WithOrderTxamt

func WithOrderTxamt(txamt string) ArgsunionOrderFunc

单位分 根据对应的是否需要进行格式化和string float64 进行uint64 转换

func WithOrderTxamtOrder

func WithOrderTxamtOrder(txamOrder string) ArgsunionOrderFunc

func WithOrderWxAppid

func WithOrderWxAppid(wxappid string) ArgsunionOrderFunc

func WithOrderZfBappid

func WithOrderZfBappid(zfbappid string) ArgsunionOrderFunc

func WithOrderZfbaBufferAccount

func WithOrderZfbaBufferAccount(zfacount string) ArgsunionOrderFunc

func WithOrderuserId

func WithOrderuserId(userid string) ArgsunionOrderFunc

type ArgsuniondOrderFuncs

type ArgsuniondOrderFuncs []ArgsunionOrderFunc

func DefaultOption

func DefaultOption(orderNo, txamt, txamntOrder, access, ip, openid, payway string) ArgsuniondOrderFuncs

返回默认参数 订单号 金额 原始金额 ip 方式 用户openid 支付方式

type ArgsunionidOrder

type ArgsunionidOrder struct {
	OrderNO         string `json:"orderNo" mapstructure:"orderNo"`                  // 必须第三方订单号  yyyyMMddHHmmssSSS+三位随机数字
	Title           string `json:"title" mapstructure:"title"`                      // 非必须	   订单标题
	DriveNo         string `json:"driveNo"  mapstructure:"driveNo"`                 // 必须  码牌编号(自定义)
	AgetId          string `json:"agetId" mapstructure:"agetId"`                    //机构号
	CustId          string `json:"custId" mapstructure:"custId"`                    // 必须		商户号
	Txamt           string `json:"txamt" mapstructure:"txamt"`                      // 必须  订单金额(单位分)
	TxamtOrder      string `json:"txamtOrder" mapstructure:"txamtOrder" `           //必须		原订单金额(单位分
	Access          string `json:"access"  mapstructure:"access"`                   //必须		接入方式 0:Android SDK 1:iOS SDK 2:windows SDK 3:直连
	Latitude        string `json:"latitude"  mapstructure:"latitude"`               // 非必须		纬度
	Longitude       string `json:"longitude"  mapstructure:"longitude"`             // 非必须		经度
	Remark          string `json:"remark"  mapstructure:"remark"`                   // 非必须		备注
	Ip              string `json:"ip"  mapstructure:"ip"`                           // 必须		 消费者ip
	Openid          string `json:"openid"  mapstructure:"openid"`                   //  必须 消费者的openid
	TraType         string `json:"traType"  mapstructure:"traType"`                 // 非必须		交易类型:5公众号 8小程序 (微信支付必传)
	WxAppid         string `json:"wxAppid"  mapstructure:"wxAppid"`                 //微信支付方式 微信公众号支付
	PrdOrderNo      string `json:"prdOrderNo"  mapstructure:"prdOrderNo"`           // 小程序订单号
	UserId          string `json:"userId" mapstructure:"userId"`                    // 小程序ID
	Zfbappid        string `json:"zfbappid" mapstructure:"zfbappid"`                //支付宝appid
	ZfbBuyerAccount string `json:"zfbBuyerAccount" mapstructure:"zfbBuyerAccount" ` // 买家账号(支付宝支付,非必须)
	AtqTag          string `json:"atqTag"  mapstructure:"atqTag"`                   // 非必须		支付通道,获取银联用户标识时有返回(银联支付必传)
	CustLogin       string `json:"custLogin" mapstructure:"custLogin"`              // 非必须		手机号(银联支付必传)
	PayWay          string `json:"payWay" mapstructure:"payWay"`                    // 须		支付方式 1.微信支付(小程序) 2.支付宝支付 3.银联支付
	Cid             string `json:"cid" mapstructure:"cid"`                          //新增一个地区信息 需要在那边删除即可
}

统一下订单请求参数

func NewArgsunionidOrder

func NewArgsunionidOrder(f ...ArgsunionOrderFunc) *ArgsunionidOrder

type FIXDetail

type FIXDetail struct {
	ACC_CUST_ID string `mapstructure:"ACC_CUST_ID" json:"ACC_CUST_ID,omitempty"` // 分账商户号全局唯一,不唯一则失败
	ACC_DATE    string `mapstructure:"ACC_DATE" json:"ACC_DATE,omitempty"`       // 分账固额(元
}

type GetwxInfo

type GetwxInfo struct {
	CustId    string `json:"custId"`    // 商户号
	CustLogin string `json:"custLogin"` // 手机号
	Appid     string `json:"appid"`     // 微信公众账号
	Secret    string `json:"secret"`    // 微信公众号密钥
	Describe  string `json:"describe"`  //附加字段,说明
}

公众号查询返回值

type GoodsAccDetailInfo

type GoodsAccDetailInfo struct {
	GOOD_NAME      string          `mapstructure:"GOOD_NAME"json:"GOOD_NAME,omitempty"`       //商品名称
	GOOD_ACC_AMT   string          `mapstructure:"GOOD_ACC_AMT" json:"GOOD_ACC_AM,omitempty"` // 商品分账金额(元)
	FIX_DETAIL     []FIXDetail     `mapstructure:"FIX_DETAIL" json:"FIX_DETAIL,omitempty"`    //固额详情(对象数组)
	PERCENT_DETAIL []PERCENTDetail `mapstructure:"PERCENT_DETAIL" json:"PERCENT_DETAIL,omitempty"`
}

type GoodsDetai

type GoodsDetai struct {
	GOOD_ID    string `mapstructure:"GOOD_ID" json:"GOOD_ID,omitempty"`       //GOOD_ID商品编号
	GOOD_COUNT string `mapstructure:"GOOD_COUNT" json:"GOOD_COUNT,omitempty"` //商品数量
}

type Insure

type Insure interface {
	//获取平台保险和续在不同支付渠道的开户账号
	GetInsureAcct(ctx context.Context, args *ArgsGetInsureAcct, reply *ReplyGetInsureAcct) error
}

保险

type InsureAcc

type InsureAcc struct {
	AcctName   string //账户名
	AcctNo     string //账户号
	MerchantId string //子账户会员代码
}

type MerchantAccountQueryInfo

type MerchantAccountQueryInfo struct {
	AllNum  string `json:"allNum"`  //总记录数
	AreaId  string `json:"areaId"`  //商圈编号
	CustId  string `json:"custId"`  //商户号
	AccId   string `json:"accId"`   //分账规则编号
	FeeType string `json:"feeType"` //分账计算类型:
	AccType string `json:"accType"` //分账规则(1.比例 2.固定金额)
	AccShar string `json:"accShar"` //分账值
	BuzId   string `json:"buzId"`   //商品编号(非必须)
	BuzName string `json:"buzName"` //商品名称(非必须)
	AccName string `json:"accName"` //结算户名
	AccNo   string `json:"accNo"`   //结算卡号
}

返回商圈分账规则查询基础信息 分账计算类型: 0.手续费平摊且分账管理方比例相加100%; 1.手续费平摊且分账管理方比例+商户比例100%; 2.手续费由主商户承担且分账管理方比例相加100%; 3.手续费主商户承担且分账管理方比例+商户比例100%

type OrderAccDetailInfo

type OrderAccDetailInfo struct {
	FIX_DETAIL     []FIXDetail     `mapstructure:"FIX_DETAIL" json:"FIX_DETAIL,omitempty"` // 固额详情
	PERCENT_DETAIL []PERCENTDetail `mapstructure:"PERCENT_DETAIL" json:"PERCENT_DETAIL,omitempty"`
}

type OrderList

type OrderList struct {
	PayModel   string //支付模式 0-冻结支付 1-普通支付
	TranFee    string //手续费  单位 :元; 金额为两位小数格式,例如0.01。注意是字符串、而非数字类型。
	SubAccNo   string //入账会员子账户
	Subamount  string `json:"subamount"`  //子订单金额 单位 :元; 金额为两位小数格式,例如0.01。注意是字符串、而非数字类型。
	SuborderId string `json:"suborderId"` //子订单号 不可超过22位,且全局唯一
	Object     string `json:"object"`     //子订单简单描述
}

订单备注中的订单订单列表结构体

type OrderRemark

type OrderRemark struct {
	Oderlist     []OrderList `json:"oderlist"`
	SFJOrdertype string      //订单类型 1=子订单
	Remarktype   string      `json:"remarktype"` //备注类型 默认取值 JHS0100000
	PlantCode    string      `json:"plantCode"`  //平台代码
}

订单备注明细结构体

type PERCENTDetail

type PERCENTDetail struct {
	ACC_CUST_ID string `mapstructure:"ACC_CUST_ID" json:"ACC_CUST_ID,omitempty"` //分账商户号全局唯一,不唯一则失败
	ACC_DATE    string `mapstructure:"ACC_DATE" json:"ACC_DATE,omitempty"`       // 分账比例(0.1即为10%)
}

type Pay

type Pay interface {
	// 获取支付二维码
	PayQr(ctx context.Context, args *PayInfo, reply *string) error
	// 获取H5支付连接
	PayH5(ctx context.Context, args *PayInfo, reply *string) error
	// 获取H5支付连接
	PayH5New(ctx context.Context, args *PayInfo, reply *PayH5) error
	// 获取小程序支付数据
	PayWxapp(ctx context.Context, args *PayInfo, reply *string) error
	// 微信公众号支付数据
	PayWxOfficial(ctx context.Context, args *PayInfo, reply *string) error
	// 获取app支付串
	PayApp(ctx context.Context, args *PayInfo, reply *string) error
	// 获取app支付串
	PayAppSign(ctx context.Context, args *PayInfo, reply *string) error
	// 支付回调
	Notify(ctx context.Context, args *ArgsNotify, reply *bool) error
	//支付回调响应(工行有这个要求)
	NotifyResponse(ctx context.Context, args *ArgsNotify, reply *ReplyNotifyResponse)
	// 获取支付成功的订单信息
	PayInfo(ctx context.Context, orderSn *string, reply *PayNotify) error
	// 支付成功清分资金记账处理 支付成功后消息任务调度
	PayAgent(ctx context.Context, orderSn *string, reply *bool) error
	// 分账数据初始化 每日处理前一日的清分数据 在具体清分操作前调用
	AngelChannel(ctx context.Context, timeUnix *int, reply *bool) error
	// 商家建行分账清分
	CcbAgent(ctx context.Context, timeUnix *int, reply *bool) error
	// 商家建行分账结果处理
	CcbAgentFund(ctx context.Context, timeUnix *int, reply *bool) error
	// 商家杉德分账清分
	SandAgent(ctx context.Context, timeUnix *int, reply *bool) error
	// 商家杉德分账异步结果处理
	SandAgentFund(ctx context.Context, timeUnix *int, reply *bool) error
	// 保险公司杉德分账清分
	SandAgentInsure(ctx context.Context, timeUnix *int, reply *bool) error
	// 保险公司杉德分账异步结果处理
	SandAgentFundInsure(ctx context.Context, timeUnix *int, reply *bool) error
	// 续保公司杉德分账清分
	SandAgentRenewInsure(ctx context.Context, timeUnix *int, reply *bool) error
	// 续保公司杉德分账异步结果处理
	SandAgentFundRenewInsure(ctx context.Context, timeUnix *int, reply *bool) error
	// 共享卡杉德分账清分
	SandAgentShareCard(ctx context.Context, timeUnix *int, reply *bool) error
	// 共享卡杉德分账异步结果处理
	SandAgentFundShareCard(ctx context.Context, timeUnix *int, reply *bool) error
	//根据订单号,获取代付状态信息
	GetAgentInfoByOrderSn(ctx context.Context, orderSn *string, reply *ReplyGetAgentInfoByOrderSn) error
	//根据clearId,获取代付状态信息
	GetAgentInfoByClearid(ctx context.Context, clearId *int, reply *ReplyGetAgentInfoByOrderSn) error
}

type PayH5

type PayH5 struct {
	PayURL  string
	PayBoby string
	PaySign string
}

PayH5 PayH5

type PayInfo

type PayInfo struct {
	OrderSn           string // 订单编号
	BusId             int    // 购买商家总店id
	RealAmount        string // 订单总金额
	InsureAmount      string // 保险费用
	RenewInsureAmount string // 续保费用
	PlatformAmount    string // 平台手续费
	BusAmount         string // 商户收取金额
	PayChannel        int    // 支付渠道
	InsuranceChannel  int    // 保险渠道
	ChosePayType      int    // 支付方式
	Wx
	Version      string
	CreateIP     string
	StoreID      string
	PayExtra     string
	AccsplitFlag string
	SignType     string
	FormUrl      string      // 成功后跳转连接
	Cid          int         //当前被下单商户所属城市,如该商户在上海,则传321
	OrderRemark  []OrderList //分账标签-平安银行渠道适用,其他渠道忽略
}

type PayNotify

type PayNotify struct {
	OrderSn    string // 订单编号
	PayTime    int64  // 交易时间 时间戳
	PayAmount  string // 支付金额
	PayFee     string // 手续费
	PaySn      string // 支付流水号
	PayStatus  int    // 订单状态
	PayChannel int    //支付渠道
	PayType    int    //付款方式
}

type ProgramPay

type ProgramPay struct {
	PrdOrderNo string `json:"prdOrderNo"  mapstructure:"prdOrderNo"` // 小程序订单号
	UserId     string `json:"userId" mapstructure:"userId"`          // 小程序ID
}

小程序支付参数配置payWay

type ReiationFileDownload

type ReiationFileDownload interface {
	FileDownload(ctx context.Context, args *ArgsReplyDownload, reply *bool) error                 //对账文件下载
	SplitaccountDownload(ctx context.Context, args *ArgsSplitaccount, reply *bool) error          //分账文件下载
	FenzhangInfo(ctx context.Context, args *ArgsSplitaccount, reply *ReplyFenzhangInfoInfo) error //分账处理
	DuizhangInfo(ctx context.Context, args *ArgsReplyDownload, reply *ReplyDuizhangInfo) error
}

对账文件下载接口 下载ftp文件到本地服务器

type ReplyAliPay

type ReplyAliPay struct {
	Getprepayid  string `json:"getprepayid"`  // 可支付标识,当为1时为可支付
	Prepayid     string `json:" prepayid"`    // 预支付ID
	OrderNo      string `json:"orderNo"`      // 订单号(用作退款)
	AgetId       string `json:"agetId"`       // 机构编号
	ThreeOrderNo string `json:"threeOrderNo"` // 第三方订单号
	OrderTime    string `json:"orderTime"`    // 订单生成时间
}

支付宝支付返回

type ReplyDuizhan

type ReplyDuizhan struct {
	JY_TXAMT     string `json:"JY_TXAMT"`     //实际交易金额(分)
	JY_TYPE      string `json:"JY_TYPE"`      //交易类型(正向交易1 反向交易2)
	JY_FEE       string `json:"JY_FEE"`       //实收手续费(分)
	JY_ORDER_NO  string `json:"JY_ORDER_NO"`  //平台订单号
	JY_FLOW_NO   string `json:"JY_FLOW_NO"`   //第三方订单号
	JY_OLD_TXAMT string `json:"JY_OLD_TXAMT"` //原交易金额(分)
	JY_DATE      string `json:"JY_DATE"`      // 交易清算日期
	JY_TIME      string `json:"JY_TIME"`      //交易完成时间
	DEVICE_NO    string `json:"DEVICE_NO"`    //设备编号
	CUST_AMT     string `json:"CUST_AMT"`     //商户出资(分)
	CUST_ID      string `json:"CUST_ID"`      //商户号
}

type ReplyDuizhangInfo

type ReplyDuizhangInfo struct {
	ReplyDuizhangSumCount                 //对账第一行信息
	Res                   []*ReplyDuizhan `json:"res"` //对账结果信息
}

对账结果

type ReplyDuizhangSumCount

type ReplyDuizhangSumCount struct {
	SUM_COUNT        string `json:"SUM_COUNT"`        //总正向交易笔数
	SUM_TXAMT        string `json:"SUM_TXAMT"`        //总正向交易金额(分)
	RE_SUM_COUNT     string `json:"RE_SUM_COUNT"`     //总退款笔数
	RE_SUM_OLD_TXAMT string `json:"RE_SUM_OLD_TXAMT"` //总退款金额(分)
	SUM_CUST_AMT     string `json:"SUM_CUST_AMT"`     //总商户出资(分)
	SUM_FEE          string `json:"SUM_FEE"`          //总手续费(分)
	SUM_OLD_TXAMT    string `json:"SUM_OLD_TXAMT"`    //
}

type ReplyFenzhangInfoInfo

type ReplyFenzhangInfoInfo struct {
	ReplySplitaccountCount                              //嵌入 字段第一行信息
	Res                    []*ReplySplitaccountDownload `json:"res"` //读取的信息
}

分账结果

type ReplyGetAgentInfoByOrderSn

type ReplyGetAgentInfoByOrderSn struct {
	BusClearId int //商户单日资金结算表id
	Status     int //代付状态
	BusId      int //商家id
	AgentType  int //清算类型 2=上海杉德清算 3=杭州建行清算
}

type ReplyGetAliUserInfo

type ReplyGetAliUserInfo struct {
	AccessToken  string `json:"access_token"`
	UserId       string `json:"user_id"`
	AlipayUserId string `json:"alipay_user_id"`
	ExpiresIn    int    `json:"expires_in"`
	ReExpiresIn  int    `json:"re_expires_in"`
	RefreshToken string `json:"refresh_token"`
}

type ReplyGetInsureAcct

type ReplyGetInsureAcct struct {
	Insure      InsureAcc
	RenewInsure InsureAcc
}

保险和续保账号

type ReplyGetOpenid

type ReplyGetOpenid struct {
	AccessToken  string `json:"access_token"`
	ExipreIn     string `json:"exipre_in"`
	RefreshToken string `json:"refresh_token"`
	Openid       string `json:"openid"`
	Scope        string `json:"scope"`
}

type ReplyGetPaypalTag

type ReplyGetPaypalTag struct {
	ResponseData
	Data UserTaginfoBase `json:"data"`
}

type ReplyGetwxInfo

type ReplyGetwxInfo struct {
	ResponseData
	Data GetwxInfo `json:"data"`
}

type ReplyMerchantAccountQuery

type ReplyMerchantAccountQuery struct {
	ResponseData
	Data MerchantAccountQueryInfo `json:"data"`
}

商圈分账规则查询响应结果

type ReplyNotify

type ReplyNotify struct {
	CUST_ID        string `json:"CUST_ID"`        // 商户号
	AGET_ID        string `json:"AGET_ID"`        // 代理商编号
	THREE_ORDER_NO string `json:"THREE_ORDER_NO"` //第三方订单号(服务商订单号)
	NETR_AMT       string `json:"NETR_AMT"`       //实付金额
	CUST_AMT       string `json:"CUST_AMT"`       // 商户出资
	CUST_FEE       string `json:"CUST_FEE"`       //商户手续费
	DISCOUNT_FLAG  string `json:"DISCOUNT_FLAG"`  //活动标识(补贴类型 0无 1机构补贴 2公司补贴)
	OPEN_ID        string `json:"OPEN_ID"`        //消费者OPEN_ID
	TRADING_IP     string `json:"TRADING_IP"`     // 消费者IP
	ORDER_NO       string `json:"ORDER_NO"`       //平台订单号
	T_ORDER_NO     string `json:"T_ORDER_NO"`     // 官方退款订单号
	PAY_WAY        string `json:"PAY_WAY"`        // 交易类型(0.银联B扫C 1.支付宝B扫C 2.微信B扫C 3.银联C扫B 5.公众号支付 7.支付宝C扫B 8.小程序交易)
	TXAMT          string `json:"TXAMT"`          //原订单金额
	DEVICE_NO      string `json:"DEVICE_NO"`      //设备号
	ORDER_TIME     string `json:"ORDER_TIME"`     //订单完成时间

	CARD_TYPE string `json:"CARD_TYPE"` //卡类型:01借记卡、 02贷记卡、03其他
	// contains filtered or unexported fields
}

异步通知返回结果

type ReplyNotifyResponse

type ReplyNotifyResponse struct {
	ResponseJsonStr string
}

type ReplyOrderAccount

type ReplyOrderAccount struct {
	ResponseData
}

type ReplySplitaccountCount

type ReplySplitaccountCount struct {
	SUM_COUNT int `json:"SUM_COUNT"` //总条数
}

type ReplySplitaccountDownload

type ReplySplitaccountDownload struct {
	ORDER_NO    string `json:"ORDER_NO"`    //平台订单号
	PAY_CHANNEL string `json:"PAY_CHANNEL"` //交易通道(1.支付宝 2.微信支付 9.银联小微 11银联刷卡)
	ORDER_TIME  string `json:"ORDER_TIME"`  //交易时间
	USTLDAT     string `json:"USTLDAT"`     //清算日期
	TXAMT       string `json:"TXAMT"`       //交易金额(分)
	FEE         string `json:"FEE"`         //手续费(分)
	NETR_AMT    string `json:"NETR_AMT"`    //实收金额(分)
	ACC_WAY     string `json:"ACC_WAY"`     //分账类型(1.整单分账 2.商品分账)
	CUST_ID     string `json:"CUST_ID"`     //交易商户号
	GOOD_NAME   string `json:"GOOD_NAME"`   //商品名称(当分账类型为2时才有值,分账类型为1时该字段为空字符串)
	ACC_CUST_ID string `json:"ACC_CUST_ID"` //分账商户号
	ACC_AMT_C   string `json:"ACC_AMT_C"`   //分账商户所分得金额(分)
}

分账文件相关

type ReplyTradeQuery

type ReplyTradeQuery struct {
	ResponseData
	Data TradeQueryinfo `json:"data"`
}

type ReplyUniondOrder

type ReplyUniondOrder struct {
	Code string      `json:"code"` // 000000表示成功 ,具体参见返回码
	Msg  string      `json:"msg"`  // 返回信息
	Data interface{} `json:"data"` // object
}

统一下单响应对象

type ReplyWxpay

type ReplyWxpay struct {
	GetPrepayId    string `json:"getPrepayId"`    // 可支付标识,当为1时为可支付
	PrePayId       string `json:" prePayId"`      // 预支付ID
	JsapiAppid     string `json:"jsapiAppid"`     // appid(微信支付)
	JsapiTimestamp string `json:"jsapiTimestamp"` // 时间戳(微信支付)
	JsapiNoncestr  string `json:"jsapiNoncestr"`  // 随机字符串(微信支付)
	JsapiPackage   string `json:"jsapiPackage"`   //  jsapiPackage(微信支付)
	JsapiSignType  string `json:"jsapiSignType"`  // 签名类型(微信支付)
	JsapiPaySign   string `json:"jsapiPaySign"`   // jsapiPaySign(微信支付)
	ThreeOrderNo   string `json:"threeOrderNo"`   // 第三方订单号
	AgetId         string `json:"agetId"`         //  机构编号
	OrderNo        string `json:"orderNo"`        //订单号(用作退款)
	OrderTime      string `json:"orderTime"`      // 订单生成时间
}

微信支付返回

type ReplyYinPay

type ReplyYinPay struct {
	GetPrepayId  string `json:"getPrepayId"`  // 可支付标识,当为1时为可支付
	Prepayid     string `json:" prepayid"`    // 预支付ID
	OrderNo      string `json:"orderNo"`      // 订单号(用作退款)
	AgetId       string `json:"agetId"`       // 机构编号
	ThreeOrderNo string `json:"threeOrderNo"` // 第三方订单号
	Redirecturl  string `json:"redirecturl"`  // 银联返回重定向地址(银联支付)
	OrderTime    string `json:"orderTime"`    // 订单生成时间
}

银联支付返回

type ResponseData

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

type TradeQueryinfo

type TradeQueryinfo struct {
	NetrAmt      string `json:"netrAmt"`      // 实付金额(成功时返回) 非必须
	CustAmt      string `json:"custAmt"`      // 商户出资(成功时返回) 非必须
	CustFee      string `json:"custFee"`      //商户手续费(成功时返回)
	DiscountFlag string `json:"discountFlag"` //活动标识(成功时返回;补贴类型 0无 1机构补贴 2公司补贴)
	OrderNo      string `json:"orderNo"`      // 平台订单号(成功时返回,用于退款时查看)
	AgetId       string `json:"agetId"`       // 机构编号
	ThreeOrderNo string `json:"threeOrderNo"` //第三方订单号
	OpenId       string `json:"openId"`       //消费者OPEN_ID(成功时返回)
	TradingIp    string `json:"tradingIp"`    //消费者IP(成功时返回)
	TorderNo     string `json:"torderNo"`     // 官方退款订单号
	Txamt        string `json:"txamt"`        // 原订单金额
	PayWay       string `json:"payWay"`       // 0银联主扫 1支付宝主扫 2微信主扫 3付款码支付(银联被扫) 5公众号支付(微信被扫) 7服务窗支付(支付宝被扫)8小程序普通交易(成功时返回)
	OrderTime    string `json:"orderTime"`    // 订单完成时间(成功时返回)
	CardType     string `json:"cardType"`     //卡类型:01借记卡、 02贷记卡、03其他
}

返回查询的结构体信息 omitempty

type UserTaginfoBase

type UserTaginfoBase struct {
	UserId string `json:"userid"` //用户标识
	AtqTag string `json:"atqTag"` //支付通道
}

type Wx

type Wx struct {
	AppId  string // 微信appid
	OpenId string // 微信openid
}

type WxPay

type WxPay struct {
	WxAppid string `json:"wxAppid"  mapstructure:"wxAppid"` // 微信公众账号(微信支付必传)
}

微信支付参数

type Xindalu

type Xindalu interface {

	// 获取银联用户标识
	GetPaypalTag(ctx context.Context, args *ArgsGetPaypalTag, reples *ReplyGetPaypalTag) error // 获取银联用户标识

	// 交易查询接口
	TradeQuery(ctx context.Context, args *ArgsTradeQuery, replies *ReplyTradeQuery) error // 交易查询接口

	// 公众号查询
	GetwxInfo(ctx context.Context, args *ArgsGetwxInfo, relies *ReplyGetwxInfo) error // 公众号查询

	//统一下单
	UnionidOrder(ctx context.Context, args *ArgsunionidOrder, replies *ReplyUniondOrder) error

	//异步通知
	Notify(ctx context.Context, replies *ReplyNotify) error

	//订单分账
	OrderAccount(ctx context.Context, args *ArgsOrderAccount, replies *ReplyOrderAccount) error

	//分账规则查询
	MerchantAccountQuery(ctx context.Context, args *ArgsMerchantAccountQuery, replies *ReplyMerchantAccountQuery) error

	//获取用户openid
	GetOpenid(ctx context.Context, args *ArgsGetOpenid, reply *ReplyGetOpenid) error

	//获取支付宝用户userid信息
	GetAliUserInfo(ctx context.Context, args *ArgsGetAliUserInfo, reply *ReplyGetAliUserInfo) error
}

Jump to

Keyboard shortcuts

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