Commit ce89200b authored by wangp's avatar wangp

lakala_wxh5_ok

parent 350066fd
......@@ -4,8 +4,6 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"system_pay/controller/base"
"system_pay/models"
"system_pay/repository/pay"
)
// 卡拉卡统一支付回调
......@@ -26,31 +24,36 @@ func (l *PayController) WxNotice(c *gin.Context) {
fmt.Println("拉卡拉微信回调start")
var ph2 interface{}
ph2 = new(interface{})
err := c.ShouldBind(ph2)
if err != nil {
response := new(base.ResponseDataWxNotice)
response.Code = "FAIL"
response.Message = "执行失败"
base.ResponseWxNotice(c, response)
return
}
fmt.Println(ph2)
//ph2 := make(map[string]interface{}, 0)
////ph2 = new(interface{})
//err := c.ShouldBind(ph2)
//if err != nil {
// response := new(base.ResponseDataWxNotice)
// response.Code = "FAIL"
// response.Message = "执行失败1"
// base.ResponseWxNotice(c, response)
// return
//}
//fmt.Println(ph2)
ph := new(models.WxNoticeInput)
err = c.ShouldBind(ph)
if err != nil {
response := new(base.ResponseDataWxNotice)
response.Code = "FAIL"
response.Message = "执行失败"
base.ResponseWxNotice(c, response)
return
}
fmt.Println(ph)
//ph := new(models.WxNoticeInput)
//err := c.ShouldBindJSON(ph)
//if err != nil {
// response := new(base.ResponseDataWxNotice)
// response.Code = "FAIL"
// response.Message = "执行失败2"
// base.ResponseWxNotice(c, response)
// return
//}
////fmt.Println(ph)
//
//// 拉卡拉统一支付微信回调
//response, err := pay.WxNotice(ph)
//
//fmt.Println("拉卡拉微信回调end")
// 拉卡拉统一支付微信回调
response, err := pay.WxNotice(ph, ph2)
response := new(base.ResponseDataWxNotice)
response.Code = "SUCCESS"
response.Message = "执行成功"
base.ResponseWxNotice(c, response)
fmt.Println("拉卡拉微信回调end")
}
......@@ -19,7 +19,7 @@ type PayController struct {
// @Tags 拉卡拉统一支付
// @Accept application/json
// @Produce application/json
// @Param body body interface{} true "参数"
// @Param body body models.PlaceAnOrderParamInput true "参数"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja 日文 默认中文"
// @Success 200
// @router /api/v1/pay/unified_order [post]
......
......@@ -43,7 +43,7 @@ var doc = `{
"in": "body",
"required": true,
"schema": {
"type": "object"
"$ref": "#/definitions/models.PlaceAnOrderParamInput"
}
},
{
......@@ -99,11 +99,79 @@ var doc = `{
}
},
"definitions": {
"models.PlaceAnOrderParamInput": {
"type": "object",
"properties": {
"app_id": {
"type": "string"
},
"attach_info": {
"type": "string"
},
"customer": {
"type": "string"
},
"dynamic_id": {
"type": "string"
},
"goods_des": {
"type": "string"
},
"goods_detail": {
"type": "string"
},
"goods_price": {
"type": "number"
},
"is_serve": {
"type": "integer"
},
"notice_url": {
"type": "string"
},
"open_id": {
"type": "string"
},
"operator": {
"type": "string"
},
"pay_type": {
"type": "integer"
},
"platform_info": {
"type": "string"
},
"platform_type": {
"type": "integer"
},
"quit_url": {
"type": "string"
},
"return_url": {
"type": "string"
},
"source_code": {
"type": "integer"
},
"store_sn": {
"type": "string"
},
"sub_mchid": {
"type": "string"
},
"wap_name": {
"type": "string"
},
"wap_url": {
"type": "string"
}
}
},
"models.WxNoticeInput": {
"type": "object",
"properties": {
"channel_id": {
"type": "integer"
"type": "string"
},
"merchant_no": {
"type": "string"
......@@ -118,16 +186,22 @@ var doc = `{
"type": "string"
},
"order_status": {
"type": "number"
"type": "string"
},
"order_trade_info": {
"type": "object"
},
"out_order_no": {
"type": "string"
},
"pay_order_no": {
"type": "integer"
"type": "string"
},
"split_info": {
"type": "object"
},
"term_no": {
"type": "integer"
"type": "string"
},
"total_amount": {
"type": "string"
......
......@@ -27,7 +27,7 @@
"in": "body",
"required": true,
"schema": {
"type": "object"
"$ref": "#/definitions/models.PlaceAnOrderParamInput"
}
},
{
......@@ -83,11 +83,79 @@
}
},
"definitions": {
"models.PlaceAnOrderParamInput": {
"type": "object",
"properties": {
"app_id": {
"type": "string"
},
"attach_info": {
"type": "string"
},
"customer": {
"type": "string"
},
"dynamic_id": {
"type": "string"
},
"goods_des": {
"type": "string"
},
"goods_detail": {
"type": "string"
},
"goods_price": {
"type": "number"
},
"is_serve": {
"type": "integer"
},
"notice_url": {
"type": "string"
},
"open_id": {
"type": "string"
},
"operator": {
"type": "string"
},
"pay_type": {
"type": "integer"
},
"platform_info": {
"type": "string"
},
"platform_type": {
"type": "integer"
},
"quit_url": {
"type": "string"
},
"return_url": {
"type": "string"
},
"source_code": {
"type": "integer"
},
"store_sn": {
"type": "string"
},
"sub_mchid": {
"type": "string"
},
"wap_name": {
"type": "string"
},
"wap_url": {
"type": "string"
}
}
},
"models.WxNoticeInput": {
"type": "object",
"properties": {
"channel_id": {
"type": "integer"
"type": "string"
},
"merchant_no": {
"type": "string"
......@@ -102,16 +170,22 @@
"type": "string"
},
"order_status": {
"type": "number"
"type": "string"
},
"order_trade_info": {
"type": "object"
},
"out_order_no": {
"type": "string"
},
"pay_order_no": {
"type": "integer"
"type": "string"
},
"split_info": {
"type": "object"
},
"term_no": {
"type": "integer"
"type": "string"
},
"total_amount": {
"type": "string"
......
definitions:
models.PlaceAnOrderParamInput:
properties:
app_id:
type: string
attach_info:
type: string
customer:
type: string
dynamic_id:
type: string
goods_des:
type: string
goods_detail:
type: string
goods_price:
type: number
is_serve:
type: integer
notice_url:
type: string
open_id:
type: string
operator:
type: string
pay_type:
type: integer
platform_info:
type: string
platform_type:
type: integer
quit_url:
type: string
return_url:
type: string
source_code:
type: integer
store_sn:
type: string
sub_mchid:
type: string
wap_name:
type: string
wap_url:
type: string
type: object
models.WxNoticeInput:
properties:
channel_id:
type: integer
type: string
merchant_no:
type: string
order_create_time:
......@@ -12,13 +57,17 @@ definitions:
order_info:
type: string
order_status:
type: number
type: string
order_trade_info:
type: object
out_order_no:
type: string
pay_order_no:
type: integer
type: string
split_info:
type: object
term_no:
type: integer
type: string
total_amount:
type: string
trans_merchant_no:
......@@ -43,7 +92,7 @@ paths:
name: body
required: true
schema:
type: object
$ref: '#/definitions/models.PlaceAnOrderParamInput'
- description: 语言类型 zh-CN简体中文 en-US英文 ja 日文 默认中文
in: header
name: language
......
......@@ -2,18 +2,20 @@ package models
// WxNoticeInput 微信回调输入参数
type WxNoticeInput struct {
ChannelId uint8 `json:"channel_id" description:"平台类型 1: saas 2: shop 3: shop mobile 4: 收银台"`
MerchantNo string `json:"merchant_no" description:"平台信息"`
OrderCreateTime string `json:"order_create_time" description:"商品描述"`
OrderEfficientTime string `json:"order_efficient_time" description:"商品详情"`
OrderInfo string `json:"order_info" description:"附加信息"`
OrderStatus float64 `json:"order_status" description:"商品金额,个位为分"`
OutOrderNo string `json:"out_order_no" description:"客户端回调的url"`
PayOrderNo int `json:"pay_order_no" description:"1: 微信,2: 支付宝, 3: 拉卡拉 4: 收钱吧"`
TermNo uint8 `json:"term_no" description:"1: 微信 Native 2:微信小程序 3:微信内支付 4:h5 跳微信 5:支付宝(web)-扫码或登录支付宝账户 6:alipay(mobile) 7:alipay(app) 9: B2C 10:bk支付宝web 11:bk 支付宝手机"`
TotalAmount string `json:"total_amount" description:"此参数 支付类型是 JS API 的时候 必传"`
TransMerchantNo string `json:"trans_merchant_no" description:"WAP网站URL地址, 支付方式为微信MWEB时 必传"`
TransTermNo string `json:"trans_term_no" description:"WAP网站名称, 支付方式为微信MWEB时 必传"`
ChannelId string `json:"channel_id" description:"平台类型 1: saas 2: shop 3: shop mobile 4: 收银台"`
MerchantNo string `json:"merchant_no" description:"平台信息"`
OrderCreateTime string `json:"order_create_time" description:"商品描述"`
OrderEfficientTime string `json:"order_efficient_time" description:"商品详情"`
OrderInfo string `json:"order_info" description:"附加信息"`
OrderStatus string `json:"order_status" description:"商品金额,个位为分"`
OutOrderNo string `json:"out_order_no" description:"客户端回调的url"`
PayOrderNo string `json:"pay_order_no" description:"1: 微信,2: 支付宝, 3: 拉卡拉 4: 收钱吧"`
TermNo string `json:"term_no" description:"1: 微信 Native 2:微信小程序 3:微信内支付 4:h5 跳微信 5:支付宝(web)-扫码或登录支付宝账户 6:alipay(mobile) 7:alipay(app) 9: B2C 10:bk支付宝web 11:bk 支付宝手机"`
TotalAmount float64 `json:"total_amount" description:"此参数 支付类型是 JS API 的时候 必传"`
TransMerchantNo string `json:"trans_merchant_no" description:"WAP网站URL地址, 支付方式为微信MWEB时 必传"`
TransTermNo string `json:"trans_term_no" description:"WAP网站名称, 支付方式为微信MWEB时 必传"`
OrderTradeInfo interface{} `json:"order_trade_info" description:""`
SplitInfo interface{} `json:"split_info" description:""`
}
// CallbackResponse is 回调给业务方的信息
......
......@@ -10,7 +10,7 @@ import (
)
// 拉卡拉微信支付回调 - AliPayNotice
func WxNotice(input *models.WxNoticeInput, input2 interface{}) (*base.ResponseDataWxNotice, error) {
func WxNotice(input *models.WxNoticeInput) (*base.ResponseDataWxNotice, error) {
fmt.Println("拉卡拉微信回调输入参数")
fmt.Println(input)
......@@ -46,18 +46,18 @@ func WxNotice(input *models.WxNoticeInput, input2 interface{}) (*base.ResponseDa
input.OutOrderNo).Scan(&billID, &attach, &url)
if err != nil || billID == 0 || billID == 2 {
response.Code = "FAIL"
response.Message = "db operation fail"
response.Message = "db operation fail1"
return response, err
}
fmt.Println("222")
//2.存入 notice_request_body
err = InsertPayBillDetailNoticeRequestBody(tx, billID, input2)
err = InsertPayBillDetailNoticeRequestBody(tx, billID, input)
if err != nil {
//beego.Error("微信回调, 根据订单id 插入回调Request参数 失败: ", err)
response.Code = "FAIL"
response.Message = "db operation fail"
response.Message = "db operation fail2"
InsertPayBillDetailNoticeResponseBody(tx, billID, response)
return response, err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment