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
cad1509d
Commit
cad1509d
authored
Jul 05, 2023
by
wangp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lakala refund
parent
af1afef6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
pay.go
repository/pay/pay.go
+24
-12
No files found.
repository/pay/pay.go
View file @
cad1509d
...
@@ -86,10 +86,13 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
...
@@ -86,10 +86,13 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
//p.ServeNoticeUrl = noticeURLx
//p.ServeNoticeUrl = noticeURLx
data2
:=
make
(
map
[
string
]
interface
{})
data2
:=
make
(
map
[
string
]
interface
{})
//data2["merchant_no"] = "8222900701107M5"
//data2["merchant_no"] = "8221210701101SB"
//data2["merchant_no"] = "8221210701101SB"
//data2["merchant_no"] = "8222900581201QB"
//data2["merchant_no"] = "8222900581201QB"
data2
[
"merchant_no"
]
=
"8221210594300JY"
if
input
.
SourceCode
==
4
||
input
.
SourceCode
==
6
{
data2
[
"merchant_no"
]
=
"8222900701107M5"
//微信H5、支付宝H5
}
else
{
data2
[
"merchant_no"
]
=
"8221210594300JY"
//微信扫码、支付宝扫码
}
//data2["term_no"] = "29034705" //不需要传?
//data2["term_no"] = "29034705" //不需要传?
//data2["total_amount"] = "1"
//data2["total_amount"] = "1"
...
@@ -114,6 +117,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
...
@@ -114,6 +117,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
data2
[
"callback_url"
]
=
input
.
ReturnURL
//客户端下单完成支付后返回的商户网页跳转地址
data2
[
"callback_url"
]
=
input
.
ReturnURL
//客户端下单完成支付后返回的商户网页跳转地址
data2
[
"order_info"
]
=
"必康测试订单标题2"
//订单标题,在使用收银台扫码支付时必输入,交易时送往账户端
data2
[
"order_info"
]
=
"必康测试订单标题2"
//订单标题,在使用收银台扫码支付时必输入,交易时送往账户端
//data2["goods_mark"] = input.AttachInfo //商品信息标识 (1:含商品信息,不填默认不含商品信息)
//data2["goods_mark"] = input.AttachInfo //商品信息标识 (1:含商品信息,不填默认不含商品信息)
data2
[
"support_refund"
]
=
1
//是否支持退款 默认0 不支持
data
[
"req_data"
]
=
make
(
map
[
string
]
interface
{})
data
[
"req_data"
]
=
make
(
map
[
string
]
interface
{})
data
[
"req_data"
]
=
data2
data
[
"req_data"
]
=
data2
...
@@ -653,10 +657,10 @@ func UnifiedRefund(input *models.RefundParamInput, ip string) (interface{}, erro
...
@@ -653,10 +657,10 @@ func UnifiedRefund(input *models.RefundParamInput, ip string) (interface{}, erro
defer
mysql
.
CloseTx
(
tx
,
err
)
defer
mysql
.
CloseTx
(
tx
,
err
)
//订单存在check
//订单存在check
err
=
SelectPayBill
(
tx
,
input
)
//
err = SelectPayBill(tx, input)
if
err
!=
nil
{
//
if err != nil {
return
nil
,
err
//
return nil, err
}
//
}
billID
,
err
:=
InsertRefundBill
(
tx
,
input
,
refundID
)
billID
,
err
:=
InsertRefundBill
(
tx
,
input
,
refundID
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -679,11 +683,19 @@ func UnifiedRefund(input *models.RefundParamInput, ip string) (interface{}, erro
...
@@ -679,11 +683,19 @@ func UnifiedRefund(input *models.RefundParamInput, ip string) (interface{}, erro
data2
:=
make
(
map
[
string
]
interface
{})
data2
:=
make
(
map
[
string
]
interface
{})
//聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码)
//聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码)
//data2["merchant_no"] = "8221210594300JY"
data2
[
"merchant_no"
]
=
"8222900701107M5"
//微信H5、支付宝H5
data2
[
"term_no"
]
=
"A1062976"
//收银台不传「term_no」,所以需要取得返回值的「trans_term_no」
//if input.SourceCode==4 || input.SourceCode==6 {
// data2["merchant_no"] = "8222900701107M5" //微信H5、支付宝H5
//} else {
// data2["merchant_no"] = "8221210594300JY" //微信扫码、支付宝扫码
//}
//聚合主扫(微信JSAPI、微信小程序)
//聚合主扫(微信JSAPI、微信小程序)
data2
[
"merchant_no"
]
=
"8222900581201QB"
//data2["merchant_no"] = "8222900581201QB"
data2
[
"term_no"
]
=
"D0027598"
//data2["term_no"] = "D0027598"
//扫码枪
//扫码枪
//data2["merchant_no"] = "822290070111135"
//data2["merchant_no"] = "822290070111135"
...
@@ -697,10 +709,10 @@ func UnifiedRefund(input *models.RefundParamInput, ip string) (interface{}, erro
...
@@ -697,10 +709,10 @@ func UnifiedRefund(input *models.RefundParamInput, ip string) (interface{}, erro
data2
[
"refund_amount"
]
=
input
.
GoodsPrice
*
100
//退款金额
data2
[
"refund_amount"
]
=
input
.
GoodsPrice
*
100
//退款金额
data2
[
"refund_reason"
]
=
""
//退款原因
data2
[
"refund_reason"
]
=
""
//退款原因
//input.OrderId = "2
3070311012001101011001021042
"
//input.OrderId = "2
023070566210308960791
"
data2
[
"origin_out_trade_no"
]
=
input
.
OrderId
//原商户交易流水号
//
data2["origin_out_trade_no"] = input.OrderId //原商户交易流水号
//data2["origin_trade_no"] = input.OrderId //原拉卡拉交易流水号
//data2["origin_trade_no"] = input.OrderId //原拉卡拉交易流水号
//
data2["origin_log_no"] = input.OrderId //原对账单流水号
data2
[
"origin_log_no"
]
=
input
.
OrderId
//原对账单流水号
...
...
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