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
c5969647
Commit
c5969647
authored
Oct 07, 2023
by
wangp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拉卡拉支付查询 post => get
parent
5efaccf2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
71 deletions
+32
-71
pay.go
controller/api/v1/pay/pay.go
+4
-10
docs.go
docs/docs.go
+7
-18
swagger.json
docs/swagger.json
+7
-18
swagger.yaml
docs/swagger.yaml
+6
-13
pay.go
models/pay.go
+3
-3
pay.go
repository/pay/pay.go
+3
-7
pay_router.go
router/v1/pay_router.go
+1
-1
setting.go
setting/setting.go
+1
-1
No files found.
controller/api/v1/pay/pay.go
View file @
c5969647
...
...
@@ -90,22 +90,16 @@ func (l *PayController) UnifiedRefund(c *gin.Context) {
// @Tags 拉卡拉支付查询
// @Accept application/json
// @Produce application/json
// @Param
body body models.OrderStateInput true "参数
"
// @Param
order_id path string true "订单号
"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文"
// @Success 200
// @router /api/v1/pay/order_state
[pos
t]
// @router /api/v1/pay/order_state
/{order_id} [ge
t]
func
(
l
*
PayController
)
OrderState
(
c
*
gin
.
Context
)
{
ph
:=
new
(
models
.
OrderStateInput
)
err
:=
c
.
ShouldBindJSON
(
ph
)
if
err
!=
nil
{
zap
.
L
()
.
Error
(
err
.
Error
())
//logs错误日志
base
.
ResponseErrorWithMsg
(
c
,
base
.
ServerError
)
return
}
orderID
:=
c
.
Param
(
"order_id"
)
// 拉卡拉支付查询
rtn
,
err
:=
pay
.
OrderState
(
ph
)
rtn
,
err
:=
pay
.
OrderState
(
orderID
)
if
err
!=
nil
{
zap
.
L
()
.
Error
(
err
.
Error
())
base
.
ResponseErrorMsg
(
c
,
err
.
Error
())
...
...
docs/docs.go
View file @
c5969647
...
...
@@ -60,8 +60,8 @@ var doc = `{
}
}
},
"/api/v1/pay/order_state": {
"
pos
t": {
"/api/v1/pay/order_state
/{order_id}
": {
"
ge
t": {
"description": "拉卡拉支付查询",
"consumes": [
"application/json"
...
...
@@ -75,13 +75,11 @@ var doc = `{
"summary": "拉卡拉支付查询",
"parameters": [
{
"description": "参数",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.OrderStateInput"
}
"type": "string",
"description": "订单号",
"name": "order_id",
"in": "path",
"required": true
},
{
"type": "string",
...
...
@@ -269,15 +267,6 @@ var doc = `{
}
}
},
"models.OrderStateInput": {
"type": "object",
"properties": {
"order_id": {
"description": "订单号",
"type": "string"
}
}
},
"models.PlaceAnOrderParamInput": {
"type": "object",
"properties": {
...
...
docs/swagger.json
View file @
c5969647
...
...
@@ -44,8 +44,8 @@
}
}
},
"/api/v1/pay/order_state"
:
{
"
pos
t"
:
{
"/api/v1/pay/order_state
/{order_id}
"
:
{
"
ge
t"
:
{
"description"
:
"拉卡拉支付查询"
,
"consumes"
:
[
"application/json"
...
...
@@ -59,13 +59,11 @@
"summary"
:
"拉卡拉支付查询"
,
"parameters"
:
[
{
"description"
:
"参数"
,
"name"
:
"body"
,
"in"
:
"body"
,
"required"
:
true
,
"schema"
:
{
"$ref"
:
"#/definitions/models.OrderStateInput"
}
"type"
:
"string"
,
"description"
:
"订单号"
,
"name"
:
"order_id"
,
"in"
:
"path"
,
"required"
:
true
},
{
"type"
:
"string"
,
...
...
@@ -253,15 +251,6 @@
}
}
},
"models.OrderStateInput"
:
{
"type"
:
"object"
,
"properties"
:
{
"order_id"
:
{
"description"
:
"订单号"
,
"type"
:
"string"
}
}
},
"models.PlaceAnOrderParamInput"
:
{
"type"
:
"object"
,
"properties"
:
{
...
...
docs/swagger.yaml
View file @
c5969647
...
...
@@ -42,12 +42,6 @@ definitions:
description
:
交易终端号
type
:
string
type
:
object
models.OrderStateInput
:
properties
:
order_id
:
description
:
订单号
type
:
string
type
:
object
models.PlaceAnOrderParamInput
:
properties
:
app_id
:
...
...
@@ -233,18 +227,17 @@ paths:
summary
:
拉卡拉统一支付回调(收银台)
tags
:
-
拉卡拉统一支付回调
/api/v1/pay/order_state
:
pos
t
:
/api/v1/pay/order_state
/{order_id}
:
ge
t
:
consumes
:
-
application/json
description
:
拉卡拉支付查询
parameters
:
-
description
:
参数
in
:
body
name
:
body
-
description
:
订单号
in
:
path
name
:
order_id
required
:
true
schema
:
$ref
:
'
#/definitions/models.OrderStateInput'
type
:
string
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
in
:
header
name
:
language
...
...
models/pay.go
View file @
c5969647
...
...
@@ -37,9 +37,9 @@ type RefundParamInput struct {
}
//支付查询
type
OrderStateInput
struct
{
OrderId
string
`json:"order_id"`
//订单号
}
//
type OrderStateInput struct {
//
OrderId string `json:"order_id"` //订单号
//
}
type
LakalaParamInput
struct
{
Version
string
`json:"version"`
//版本
...
...
repository/pay/pay.go
View file @
c5969647
...
...
@@ -915,15 +915,12 @@ func InsertRefundBill(tx *sql.Tx, p *models.RefundParamInput, refundID string) (
}
// 拉卡拉支付查询
func
OrderState
(
input
*
models
.
OrderStateInput
)
(
interface
{},
error
)
{
func
OrderState
(
order_id
string
)
(
interface
{},
error
)
{
fmt
.
Println
(
"谛宝多多输入参数(支付查询)"
)
fmt
.
Println
(
input
)
//refundID := GetUID()
fmt
.
Println
(
order_id
)
order_id
:=
input
.
OrderId
if
order_id
==
""
{
return
nil
,
errors
.
New
(
"
账单不存在
"
)
return
nil
,
errors
.
New
(
"
输入参数为空错误
"
)
}
// 插入数据库
...
...
@@ -953,7 +950,6 @@ func OrderState(input *models.OrderStateInput) (interface{}, error) {
querySQL
:=
`select id, source_code, result_code, payment_order_code, attach, _type, platform_type from system_pay_bill where payment_order_code = ?`
result
:=
new
(
models
.
OrderState
)
//var result_code uint8
var
sourceCode
,
platformType
uint
var
paymentOrderCode
string
var
attach
string
...
...
router/v1/pay_router.go
View file @
c5969647
...
...
@@ -20,7 +20,7 @@ func PayRouter (r *gin.Engine) {
r
.
POST
(
pack
.
PayUrlPacking
(
"scan_notice"
),
PayController
.
ScanNotice
)
// 拉卡拉支付查询
r
.
POST
(
pack
.
PayUrlPacking
(
"order_state
"
),
PayController
.
OrderState
)
r
.
GET
(
pack
.
PayUrlPacking
(
"order_state/:order_id
"
),
PayController
.
OrderState
)
// 拉卡拉退款
r
.
POST
(
pack
.
PayUrlPacking
(
"unified_refund"
),
PayController
.
UnifiedRefund
)
...
...
setting/setting.go
View file @
c5969647
...
...
@@ -125,7 +125,7 @@ type Lakala 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