gateway

package
v0.0.0-...-8d4382c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

**************************************************

** @Desc : 处理下游请求的一些公用的逻辑
** @Time : 2019/10/28 18:09
** @Author : yuebin
** @File : base_gateway
** @Last Modified by : yuebin
** @Last Modified time: 2019/10/28 18:09
** @Software: GoLand

***************************************************

**************************************************

** @Desc : This file for ...
** @Time : 2019/10/26 16:56
** @Author : yuebin
** @File : error_gateway
** @Last Modified by : yuebin
** @Last Modified time: 2019/10/26 16:56
** @Software: GoLand

***************************************************

**************************************************

** @Desc : 供下游订单状态查询和代付结果查询
** @Time : 2019/11/6 13:59
** @Author : yuebin
** @File : order_query
** @Last Modified by : yuebin
** @Last Modified time: 2019/11/6 13:59
** @Software: GoLand

***************************************************

**************************************************

** @Desc : This file for ...
** @Time : 2019/12/5 14:05
** @Author : yuebin
** @File : payfor_gateway
** @Last Modified by : yuebin
** @Last Modified time: 2019/12/5 14:05
** @Software: GoLand

***************************************************

**************************************************

** @Desc : 下游请求扫码支付的处理逻辑
** @Time : 2019/10/24 11:15
** @Author : yuebin
** @File : gateway
** @Last Modified by : yuebin
** @Last Modified time: 2019/10/24 11:15
** @Software: GoLand

***************************************************

**************************************************

** @Desc : 接受上游通道商的订单结果异步回调
** @Time : 2019/11/22 23:27
** @Author : yuebin
** @File : supplier_notify
** @Last Modified by : yuebin
** @Last Modified time: 2019/11/22 23:27
** @Software: GoLand

***************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceResponse

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

type BaseGateway

type BaseGateway struct {
	beego.Controller
	Params       map[string]string   //请求的基本参数
	ClientIp     string              //商户ip
	MerchantInfo models.MerchantInfo //商户信息
	Msg          string              //信息
	Code         int                 //状态码 200正常
	RoadInfo     models.RoadInfo
	RoadPoolInfo models.RoadPoolInfo
	OrderAmount  float64
	PayWayCode   string
	PlatformRate float64
	AgentRate    float64
}

func (*BaseGateway) ChooseRoad

func (c *BaseGateway) ChooseRoad()

选择通道

func (*BaseGateway) GenerateRecord

func (c *BaseGateway) GenerateRecord() (models.OrderInfo, models.OrderProfitInfo)

* 生成订单一系列的记录

func (*BaseGateway) GenerateSuccessData

func (c *BaseGateway) GenerateSuccessData(scanData controller.ScanData) *ScanSuccessData

func (*BaseGateway) GetMerchantInfo

func (c *BaseGateway) GetMerchantInfo()

获取商户信息

func (*BaseGateway) GetOrderInfo

func (c *BaseGateway) GetOrderInfo() models.OrderInfo

获取基本订单记录

func (*BaseGateway) GetOrderProfit

func (c *BaseGateway) GetOrderProfit(orderInfo models.OrderInfo) models.OrderProfitInfo

计算收益,平台利润,代理利润

func (*BaseGateway) IpIsWhite

func (c *BaseGateway) IpIsWhite() bool

判断ip是否在白名单中

func (*BaseGateway) JudgeParams

func (c *BaseGateway) JudgeParams()

判断参数的

func (*BaseGateway) NotifyUrlIsValid

func (c *BaseGateway) NotifyUrlIsValid()

func (*BaseGateway) OrderIsValid

func (c *BaseGateway) OrderIsValid()

判断金额订单号是否为空或者有重复

func (*BaseGateway) OrderPeriodIsValid

func (c *BaseGateway) OrderPeriodIsValid()

func (*BaseGateway) OrderPriceIsValid

func (c *BaseGateway) OrderPriceIsValid()

判断订单金额

func (*BaseGateway) OsTypeIsValid

func (c *BaseGateway) OsTypeIsValid()

func (*BaseGateway) PayPrepare

func (c *BaseGateway) PayPrepare()

获取商户请求过来的基本参数参数

func (*BaseGateway) PayWayCodeIsValid

func (c *BaseGateway) PayWayCodeIsValid()

func (*BaseGateway) ProductIsValid

func (c *BaseGateway) ProductIsValid()

func (*BaseGateway) ReturnUrlIsValid

func (c *BaseGateway) ReturnUrlIsValid()

func (*BaseGateway) RoadIsValid

func (c *BaseGateway) RoadIsValid(roadInfo models.RoadInfo) bool

判断通道是否是合法的

type ErrorGatewayController

type ErrorGatewayController struct {
	beego.Controller
}

func (*ErrorGatewayController) ErrorParams

func (c *ErrorGatewayController) ErrorParams()

type OrderQueryFailData

type OrderQueryFailData struct {
	PayKey     string `json:"payKey"`
	StatusCode string `json:"statusCode"`
	Msg        string `json:"msg"`
}

type PayForGateway

type PayForGateway struct {
	beego.Controller
}

func (*PayForGateway) Balance

func (c *PayForGateway) Balance()

* 商户查找余额

func (*PayForGateway) PayFor

func (c *PayForGateway) PayFor()

* 接受下游商户的代付请求

func (*PayForGateway) PayForQuery

func (c *PayForGateway) PayForQuery()

* 代付结果查询,

type PayForQueryResponse

type PayForQueryResponse struct {
	ResultMsg       string `json:"resultMsg,omitempty"`
	MerchantOrderId string `json:"merchantOrderId,omitempty"`
	SettAmount      string `json:"settAmount,omitempty"`
	SettFee         string `json:"settFee,omitempty"`
	SettStatus      string `json:"settStatus,omitempty"`
	Sign            string `json:"sign,omitempty"`
}

type PayForResponse

type PayForResponse struct {
	ResultCode      string `json:"resultCode,omitempty"`
	ResultMsg       string `json:"resultMsg,omitempty"`
	MerchantOrderId string `json:"merchantOrderId,omitempty"`
	SettAmount      string `json:"settAmount,omitempty"`
	SettFee         string `json:"settFee,omitempty"`
	Sign            string `json:"sign,omitempty"`
}

type QueryController

type QueryController struct {
	beego.Controller
}

func (*QueryController) OrderQuery

func (c *QueryController) OrderQuery()

** 改接口是为下游商户提供订单查询

type ScanController

type ScanController struct {
	BaseGateway
}

func (*ScanController) Scan

func (c *ScanController) Scan()

处理扫码的请求

func (*ScanController) SolveFailJSON

func (c *ScanController) SolveFailJSON()

处理错误的返回

type ScanFailData

type ScanFailData struct {
	PayKey     string `json:"payKey"`
	StatusCode string `json:"statusCode"`
	Msg        string `json:"msg"`
}

type ScanSuccessData

type ScanSuccessData struct {
	OrderNo    string `json:"orderNo"`
	Sign       string `json:"sign"`
	OrderPrice string `json:"orderPrice"`
	PayKey     string `json:"payKey"`
	PayUrl     string `json:"payURL"`
	StatusCode string `json:"statusCode"`
	Msg        string `json:"msg"`
}

Jump to

Keyboard shortcuts

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