Documentation ¶
Overview ¶
**************************************************
** @Desc : This file for ... ** @Time : 2019/10/28 16:38 ** @Author : yuebin ** @File : alipay ** @Last Modified by : yuebin ** @Last Modified time: 2019/10/28 16:38 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for ... ** @Time : 2019/11/19 18:12 ** @Author : yuebin ** @File : consts.go ** @Last Modified by : yuebin ** @Last Modified time: 2019/11/19 18:12 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : 处理网关模块的一些需要操作数据库的功能 ** @Time : 2019/12/7 16:40 ** @Author : yuebin ** @File : gateway_solve ** @Last Modified by : yuebin ** @Last Modified time: 2019/12/7 16:40 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : 注册上游支付接口 ** @Time : 2019/10/28 14:48 ** @Author : yuebin ** @File : init ** @Last Modified by : yuebin ** @Last Modified time: 2019/10/28 14:48 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : 快付支付的实现逻辑 ** @Time : 2019/10/28 14:12 ** @Author : yuebin ** @File : kuaifu ** @Last Modified by : yuebin ** @Last Modified time: 2019/10/28 14:12 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : 订单结算,将订单上面的钱加入到账户余额中 ** @Time : 2019/11/22 11:34 ** @Author : yuebin ** @File : order_settle ** @Last Modified by : yuebin ** @Last Modified time: 2019/11/22 11:34 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : 处理订单状态,用户加款等核心业务 ** @Time : 2019/10/31 11:44 ** @Author : yuebin ** @File : pay_solve ** @Last Modified by : yuebin ** @Last Modified time: 2019/10/31 11:44 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : 代付处理 ** @Time : 2019/11/28 18:52 ** @Author : yuebin ** @File : payfor_solve ** @Last Modified by : yuebin ** @Last Modified time: 2019/11/28 18:52 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for ... ** @Time : 2019/10/28 9:39 ** @Author : yuebin ** @File : supplier_interface ** @Last Modified by : yuebin ** @Last Modified time: 2019/10/28 9:39 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for ... ** @Time : 2019/10/28 16:38 ** @Author : yuebin ** @File : weixin ** @Last Modified by : yuebin ** @Last Modified time: 2019/10/28 16:38 ** @Software: GoLand
***************************************************
Index ¶
- Constants
- func Init()
- func InsertOrderAndOrderProfit(orderInfo models.OrderInfo, orderProfitInfo models.OrderProfitInfo) bool
- func MerchantAbleAmount(merchantLoad models.MerchantLoadInfo) bool
- func MerchantLoadSolve()
- func OrderSettle()
- func PayForFail(payFor models.PayforInfo) bool
- func PayForSuccess(payFor models.PayforInfo) bool
- func RequestPayFor(payFor models.PayforInfo)
- func SendPayFor(payFor models.PayforInfo) bool
- func SolvePayFor()
- func SolvePayForConfirm()
- type AlipayImpl
- func (c *AlipayImpl) BalanceQuery(roadInfo models.RoadInfo) float64
- func (c *AlipayImpl) Fast(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) bool
- func (c *AlipayImpl) H5(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *AlipayImpl) PayFor(info models.PayforInfo) string
- func (c *AlipayImpl) PayForNotify() string
- func (c *AlipayImpl) PayForQuery(payFor models.PayforInfo) (string, string)
- func (c *AlipayImpl) PayNotify()
- func (c *AlipayImpl) PayQuery(orderInfo models.OrderInfo) bool
- func (c *AlipayImpl) Scan(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *AlipayImpl) Syt(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *AlipayImpl) Web(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) bool
- type KuaiFuImpl
- func (c *KuaiFuImpl) BalanceQuery(roadInfo models.RoadInfo) float64
- func (c *KuaiFuImpl) Fast(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) bool
- func (c *KuaiFuImpl) H5(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *KuaiFuImpl) PayFor(payFor models.PayforInfo) string
- func (c *KuaiFuImpl) PayForNotify() string
- func (c *KuaiFuImpl) PayForQuery(payFor models.PayforInfo) (string, string)
- func (c *KuaiFuImpl) PayNotify()
- func (c *KuaiFuImpl) PayQuery(orderInfo models.OrderInfo) bool
- func (c *KuaiFuImpl) Scan(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *KuaiFuImpl) Syt(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *KuaiFuImpl) Web(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) bool
- type PayInterface
- type PaySolveController
- func (c *PaySolveController) CompareOrderAndFactAmount(factAmount float64, orderInfo models.OrderInfo) int
- func (c *PaySolveController) CreateOrderNotifyInfo(orderInfo models.OrderInfo, tradeStatus string)
- func (c *PaySolveController) SolveOrderFreeze(bankOrderId string) bool
- func (c *PaySolveController) SolveOrderRoll(bankOrderId string) bool
- func (c *PaySolveController) SolveOrderUnfreeze(bankOrderId string) bool
- func (c *PaySolveController) SolvePayFail(orderInfo models.OrderInfo, str string) bool
- func (c *PaySolveController) SolvePaySuccess(bankOrderId string, factAmount float64, trxNo string) bool
- func (c *PaySolveController) SolveRefund(bankOrderId string) bool
- type ScanData
- type WeiXinImpl
- func (c *WeiXinImpl) BalanceQuery(roadInfo models.RoadInfo) float64
- func (c *WeiXinImpl) Fast(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) bool
- func (c *WeiXinImpl) H5(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *WeiXinImpl) PayFor(payFor models.PayforInfo) string
- func (c *WeiXinImpl) PayForNotify() string
- func (c *WeiXinImpl) PayForQuery(payFor models.PayforInfo) (string, string)
- func (c *WeiXinImpl) PayNotify()
- func (c *WeiXinImpl) PayQuery(orderInfo models.OrderInfo) bool
- func (c *WeiXinImpl) Scan(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *WeiXinImpl) Syt(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) ScanData
- func (c *WeiXinImpl) Web(orderInfo models.OrderInfo, roadInfo models.RoadInfo, ...) bool
Constants ¶
const ( HOST = "localhost" KF_SCAN_HOST = "http://" + HOST + "/gateway/scanPay/payService" KF_PAYFOR_HOST = "http://" + HOST + "/gateway/remittance/pay" KF_BALANCE_QUERY = "http://" + HOST + "/gateway/remittance/getBalance" KF_ORDER_QUERY = "http://" + HOST + "/gateway/scanPay/orderQuery" KF_PAYFOR_QUERY = "http://" + HOST + "/gateway/remittance/query" KF_PAY_KEY = "xxxxxxx" KF_PAY_SECRET = "xxxxxx" )
const (
PayNotify = ""
)
Variables ¶
This section is empty.
Functions ¶
func InsertOrderAndOrderProfit ¶
func InsertOrderAndOrderProfit(orderInfo models.OrderInfo, orderProfitInfo models.OrderProfitInfo) bool
* 插入支付订单记录和订单利润记录,保证一致性
func MerchantAbleAmount ¶
func MerchantAbleAmount(merchantLoad models.MerchantLoadInfo) bool
* 对应的商户的账户可用金额进行调整操作
func PayForFail ¶
func PayForFail(payFor models.PayforInfo) bool
func PayForSuccess ¶
func PayForSuccess(payFor models.PayforInfo) bool
func RequestPayFor ¶
func RequestPayFor(payFor models.PayforInfo)
func SendPayFor ¶
func SendPayFor(payFor models.PayforInfo) bool
Types ¶
type AlipayImpl ¶
type AlipayImpl struct { }
func (*AlipayImpl) BalanceQuery ¶
func (c *AlipayImpl) BalanceQuery(roadInfo models.RoadInfo) float64
func (*AlipayImpl) Fast ¶
func (c *AlipayImpl) Fast(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) bool
func (*AlipayImpl) H5 ¶
func (c *AlipayImpl) H5(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*AlipayImpl) PayFor ¶
func (c *AlipayImpl) PayFor(info models.PayforInfo) string
func (*AlipayImpl) PayForNotify ¶
func (c *AlipayImpl) PayForNotify() string
func (*AlipayImpl) PayForQuery ¶
func (c *AlipayImpl) PayForQuery(payFor models.PayforInfo) (string, string)
func (*AlipayImpl) PayNotify ¶
func (c *AlipayImpl) PayNotify()
func (*AlipayImpl) Scan ¶
func (c *AlipayImpl) Scan(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*AlipayImpl) Syt ¶
func (c *AlipayImpl) Syt(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*AlipayImpl) Web ¶
func (c *AlipayImpl) Web(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) bool
type KuaiFuImpl ¶
type KuaiFuImpl struct {
beego.Controller
}
func (*KuaiFuImpl) BalanceQuery ¶
func (c *KuaiFuImpl) BalanceQuery(roadInfo models.RoadInfo) float64
func (*KuaiFuImpl) Fast ¶
func (c *KuaiFuImpl) Fast(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) bool
func (*KuaiFuImpl) H5 ¶
func (c *KuaiFuImpl) H5(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*KuaiFuImpl) PayFor ¶
func (c *KuaiFuImpl) PayFor(payFor models.PayforInfo) string
func (*KuaiFuImpl) PayForNotify ¶
func (c *KuaiFuImpl) PayForNotify() string
func (*KuaiFuImpl) PayForQuery ¶
func (c *KuaiFuImpl) PayForQuery(payFor models.PayforInfo) (string, string)
func (*KuaiFuImpl) Scan ¶
func (c *KuaiFuImpl) Scan(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*KuaiFuImpl) Syt ¶
func (c *KuaiFuImpl) Syt(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*KuaiFuImpl) Web ¶
func (c *KuaiFuImpl) Web(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) bool
type PayInterface ¶
type PayInterface interface { Scan(models.OrderInfo, models.RoadInfo, models.MerchantInfo) ScanData H5(models.OrderInfo, models.RoadInfo, models.MerchantInfo) ScanData Fast(models.OrderInfo, models.RoadInfo, models.MerchantInfo) bool Syt(models.OrderInfo, models.RoadInfo, models.MerchantInfo) ScanData Web(models.OrderInfo, models.RoadInfo, models.MerchantInfo) bool PayNotify() PayQuery(models.OrderInfo) bool PayFor(models.PayforInfo) string PayForNotify() string PayForQuery(models.PayforInfo) (string, string) BalanceQuery(models.RoadInfo) float64 }
func GetPaySupplierByCode ¶
func GetPaySupplierByCode(code string) PayInterface
type PaySolveController ¶
type PaySolveController struct { }
func (*PaySolveController) CompareOrderAndFactAmount ¶
func (c *PaySolveController) CompareOrderAndFactAmount(factAmount float64, orderInfo models.OrderInfo) int
比较订单金额和实际支付金额的大小
func (*PaySolveController) CreateOrderNotifyInfo ¶
func (c *PaySolveController) CreateOrderNotifyInfo(orderInfo models.OrderInfo, tradeStatus string)
支付完成后,处理给商户的回调信息
func (*PaySolveController) SolveOrderFreeze ¶
func (c *PaySolveController) SolveOrderFreeze(bankOrderId string) bool
处理订单冻结
func (*PaySolveController) SolveOrderRoll ¶
func (c *PaySolveController) SolveOrderRoll(bankOrderId string) bool
func (*PaySolveController) SolveOrderUnfreeze ¶
func (c *PaySolveController) SolveOrderUnfreeze(bankOrderId string) bool
订单解冻
func (*PaySolveController) SolvePayFail ¶
func (c *PaySolveController) SolvePayFail(orderInfo models.OrderInfo, str string) bool
处理支付失败
func (*PaySolveController) SolvePaySuccess ¶
func (c *PaySolveController) SolvePaySuccess(bankOrderId string, factAmount float64, trxNo string) bool
处理支付成功的加款等各项操作
func (*PaySolveController) SolveRefund ¶
func (c *PaySolveController) SolveRefund(bankOrderId string) bool
type ScanData ¶
type ScanData struct { Supplier string //上游的通道供应商 PayType string //支付类型 OrderNo string //下游商户请求订单号 BankNo string //本系统的请求订单号 OrderPrice string //订单金额 FactPrice string //实际的展示在客户面前的金额 Status string //状态码 '00' 成功 PayUrl string //支付二维码链接地址 Msg string //附加的信息 }
定义扫码支付的返回值
type WeiXinImpl ¶
type WeiXinImpl struct { }
func (*WeiXinImpl) BalanceQuery ¶
func (c *WeiXinImpl) BalanceQuery(roadInfo models.RoadInfo) float64
func (*WeiXinImpl) Fast ¶
func (c *WeiXinImpl) Fast(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) bool
func (*WeiXinImpl) H5 ¶
func (c *WeiXinImpl) H5(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*WeiXinImpl) PayFor ¶
func (c *WeiXinImpl) PayFor(payFor models.PayforInfo) string
func (*WeiXinImpl) PayForNotify ¶
func (c *WeiXinImpl) PayForNotify() string
func (*WeiXinImpl) PayForQuery ¶
func (c *WeiXinImpl) PayForQuery(payFor models.PayforInfo) (string, string)
func (*WeiXinImpl) PayNotify ¶
func (c *WeiXinImpl) PayNotify()
func (*WeiXinImpl) Scan ¶
func (c *WeiXinImpl) Scan(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*WeiXinImpl) Syt ¶
func (c *WeiXinImpl) Syt(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) ScanData
func (*WeiXinImpl) Web ¶
func (c *WeiXinImpl) Web(orderInfo models.OrderInfo, roadInfo models.RoadInfo, merchantInfo models.MerchantInfo) bool