Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
system_pay
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王沛
system_pay
Commits
350066fd
Commit
350066fd
authored
Jun 27, 2023
by
wangp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lakala
parent
207dbde0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
195 deletions
+39
-195
notice.go
controller/api/v1/pay/notice.go
+19
-2
pay.go
controller/api/v1/pay/pay.go
+4
-2
docs.go
docs/docs.go
+1
-69
swagger.json
docs/swagger.json
+1
-69
swagger.yaml
docs/swagger.yaml
+1
-46
notice.go
repository/pay/notice.go
+2
-2
pay.go
repository/pay/pay.go
+10
-4
setting.go
setting/setting.go
+1
-1
No files found.
controller/api/v1/pay/notice.go
View file @
350066fd
package
pay
import
(
"fmt"
"github.com/gin-gonic/gin"
"system_pay/controller/base"
"system_pay/models"
...
...
@@ -23,8 +24,22 @@ type NoticeController struct {
// @router /api/v1/pay/wx_notice [post]
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
)
ph
:=
new
(
models
.
WxNoticeInput
)
err
:
=
c
.
ShouldBind
(
ph
)
err
=
c
.
ShouldBind
(
ph
)
if
err
!=
nil
{
response
:=
new
(
base
.
ResponseDataWxNotice
)
response
.
Code
=
"FAIL"
...
...
@@ -32,8 +47,10 @@ func (l *PayController) WxNotice(c *gin.Context) {
base
.
ResponseWxNotice
(
c
,
response
)
return
}
fmt
.
Println
(
ph
)
// 拉卡拉统一支付微信回调
response
,
err
:=
pay
.
WxNotice
(
ph
)
response
,
err
:=
pay
.
WxNotice
(
ph
,
ph2
)
base
.
ResponseWxNotice
(
c
,
response
)
fmt
.
Println
(
"拉卡拉微信回调end"
)
}
controller/api/v1/pay/pay.go
View file @
350066fd
package
pay
import
(
"fmt"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"system_pay/controller/base"
...
...
@@ -18,14 +19,15 @@ type PayController struct {
// @Tags 拉卡拉统一支付
// @Accept application/json
// @Produce application/json
// @Param body body
models.PlaceAnOrderParamInput
true "参数"
// @Param body body
interface{}
true "参数"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja 日文 默认中文"
// @Success 200
// @router /api/v1/pay/unified_order [post]
func
(
l
*
PayController
)
UnifiedOrder
(
c
*
gin
.
Context
)
{
ph
:=
new
(
models
.
PlaceAnOrderParamInput
)
err
:=
c
.
ShouldBind
(
ph
)
fmt
.
Println
(
"ContentType="
+
c
.
ContentType
())
err
:=
c
.
ShouldBindJSON
(
ph
)
if
err
!=
nil
{
zap
.
L
()
.
Error
(
err
.
Error
())
base
.
ResponseErrorWithMsg
(
c
,
base
.
ServerError
)
...
...
docs/docs.go
View file @
350066fd
...
...
@@ -43,7 +43,7 @@ var doc = `{
"in": "body",
"required": true,
"schema": {
"
$ref": "#/definitions/models.PlaceAnOrderParamInpu
t"
"
type": "objec
t"
}
},
{
...
...
@@ -99,74 +99,6 @@ 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": {
...
...
docs/swagger.json
View file @
350066fd
...
...
@@ -27,7 +27,7 @@
"in"
:
"body"
,
"required"
:
true
,
"schema"
:
{
"
$ref"
:
"#/definitions/models.PlaceAnOrderParamInpu
t"
"
type"
:
"objec
t"
}
},
{
...
...
@@ -83,74 +83,6 @@
}
},
"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"
:
{
...
...
docs/swagger.yaml
View file @
350066fd
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
:
...
...
@@ -88,7 +43,7 @@ paths:
name
:
body
required
:
true
schema
:
$ref
:
'
#/definitions/models.PlaceAnOrderParamInput'
type
:
object
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja 日文 默认中文
in
:
header
name
:
language
...
...
repository/pay/notice.go
View file @
350066fd
...
...
@@ -10,7 +10,7 @@ import (
)
// 拉卡拉微信支付回调 - AliPayNotice
func
WxNotice
(
input
*
models
.
WxNoticeInput
)
(
*
base
.
ResponseDataWxNotice
,
error
)
{
func
WxNotice
(
input
*
models
.
WxNoticeInput
,
input2
interface
{}
)
(
*
base
.
ResponseDataWxNotice
,
error
)
{
fmt
.
Println
(
"拉卡拉微信回调输入参数"
)
fmt
.
Println
(
input
)
...
...
@@ -53,7 +53,7 @@ func WxNotice(input *models.WxNoticeInput) (*base.ResponseDataWxNotice, error) {
fmt
.
Println
(
"222"
)
//2.存入 notice_request_body
err
=
InsertPayBillDetailNoticeRequestBody
(
tx
,
billID
,
input
)
err
=
InsertPayBillDetailNoticeRequestBody
(
tx
,
billID
,
input
2
)
if
err
!=
nil
{
//beego.Error("微信回调, 根据订单id 插入回调Request参数 失败: ", err)
response
.
Code
=
"FAIL"
...
...
repository/pay/pay.go
View file @
350066fd
...
...
@@ -76,22 +76,28 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput) (interface{}, error) {
//p.ServeNoticeUrl = noticeURLx
data2
:=
make
(
map
[
string
]
interface
{})
data2
[
"merchant_no"
]
=
"8222900701107M5"
//data2["merchant_no"] = "8222900701107M5"
data2
[
"merchant_no"
]
=
"8221210701101SB"
data2
[
"term_no"
]
=
"29034705"
//data2["auth_code"] = "135178236713755038" delete ?
//data2["auth_code"] = "135178236713755038"
//
delete ?
//data2["total_amount"] = "1"
data2
[
"total_amount"
]
=
input
.
GoodsPrice
data2
[
"out_trade_no"
]
=
orderID
//随机生成的订单号
//data2["out_trade_no"] = orderID //随机生成的订单号
//data2["out_trade_no"] = RandomString(32)
data2
[
"out_order_no"
]
=
orderID
//随机生成的订单号
//data2["out_order_no"] = RandomString(32)
//data2["out_trade_no"] = input.AttachInfo
//data2["out_order_no"] = input.AttachInfo
//data2["counter_param"] = "{\"pay_mode\":\"ALIPAY\"}"
data2
[
"counter_param"
]
=
"{
\"
pay_mode
\"
:
\"
WECHAT
\"
}"
data2
[
"order_efficient_time"
]
=
"20230630235959"
//订单有效期 格式yyyyMMddHHmmss,最大支持下单时间+2天
data2
[
"notify_url"
]
=
input
.
NoticeURL
//订单支付成功后商户接收订单通知的地址 http://xxx.xxx.com
data2
[
"callback_url"
]
=
input
.
ReturnURL
//客户端下单完成支付后返回的商户网页跳转地址
data2
[
"order_info"
]
=
"必康测试订单标题"
//订单标题,在使用收银台扫码支付时必输入,交易时送往账户端
data2
[
"order_info"
]
=
"必康测试订单标题
2
"
//订单标题,在使用收银台扫码支付时必输入,交易时送往账户端
//data2["goods_mark"] = input.AttachInfo //商品信息标识 (1:含商品信息,不填默认不含商品信息)
data
[
"req_data"
]
=
make
(
map
[
string
]
interface
{})
...
...
setting/setting.go
View file @
350066fd
...
...
@@ -146,7 +146,7 @@ type Esign struct {
// Init 支持热修改的viper设置
func
Init
()
error
{
viper
.
SetConfigFile
(
"conf/config.yaml"
)
// 指定配置文件路径
viper
.
SetConfigFile
(
"conf/
dev/
config.yaml"
)
// 指定配置文件路径
err
:=
viper
.
ReadInConfig
()
// 读取配置信息
if
err
!=
nil
{
// 读取配置信息失败
fmt
.
Printf
(
"viper.ReadInConfig failed, new_error:%v
\n
"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment