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
568659a9
Commit
568659a9
authored
Sep 06, 2023
by
wangp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lakala
parent
15c8ac33
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
8 deletions
+23
-8
notice.go
models/notice.go
+1
-0
pay.go
models/pay.go
+1
-0
notice.go
repository/pay/notice.go
+9
-2
pay.go
repository/pay/pay.go
+12
-6
No files found.
models/notice.go
View file @
568659a9
...
...
@@ -25,4 +25,5 @@ type CallbackResponse struct {
AttachInfo
string
`json:"attach_info"`
// 附加信息
TransactionID
string
`json:"transaction_id"`
// 微信支付订单号
TradeNo
string
`json:"trade_no"`
// 支付宝交易流水号
AuthCode
string
`json:"auth_code"`
// 拉卡拉签约协议号列表
}
models/pay.go
View file @
568659a9
...
...
@@ -26,6 +26,7 @@ type PlaceAnOrderParamInput struct {
SubMchid
string
`json:"sub_mchid" description:"通过进件接口申请的支付商户号、这是由微信生成并下发的"`
Nonce
string
`json:"-"`
ServeNoticeUrl
string
`json:"-" description:"传递给支付渠道的、而不是业务方的"`
AuthCodes
string
`json:"auth_codes" description:"LAKALA签约协议号列表"`
}
//退款
...
...
repository/pay/notice.go
View file @
568659a9
...
...
@@ -119,6 +119,12 @@ func WxNotice(input *models.WxNoticeInput) (*base.ResponseDataWxNotice, error) {
callbackResponse
.
OutTradeNo
=
input
.
OutOrderNo
//交易凭据单号 todo ?
callbackResponse
.
TransactionID
=
input
.
OutOrderNo
//交易凭据单号 todo ? strconv.Itoa(
OrderTradeInfo
,
_
:=
input
.
OrderTradeInfo
.
(
map
[
string
]
interface
{})
if
OrderTradeInfo
[
"auth_code"
]
!=
""
{
//LAKALA签约协议号列表
callbackResponse
.
AuthCode
=
OrderTradeInfo
[
"auth_code"
]
.
(
string
)
}
attachMap
:=
make
(
map
[
string
]
interface
{},
0
)
_
=
json
.
Unmarshal
([]
byte
(
attach
),
&
attachMap
)
if
attachMap
[
"store_sn"
]
.
(
string
)
==
""
{
...
...
@@ -126,9 +132,10 @@ func WxNotice(input *models.WxNoticeInput) (*base.ResponseDataWxNotice, error) {
}
else
{
callbackResponse
.
AttachInfo
=
attach
//商户订单号(谛宝多多)
}
//fmt.Println("444444444444444444444444444")
//fmt.Println(callbackResponse)
go
callBackBusinessService
(
input
.
OutOrderNo
,
url
,
callbackResponse
)
fmt
.
Println
(
"444"
)
}
response
.
Code
=
"SUCCESS"
...
...
repository/pay/pay.go
View file @
568659a9
...
...
@@ -139,6 +139,13 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
if
input
.
SourceCode
==
15
{
//快捷支付
data2
[
"counter_param"
]
=
"{
\"
pay_mode
\"
:
\"
QUICK_PAY
\"
}"
if
input
.
AuthCodes
!=
""
{
//LAKALA签约协议号列表
auth_codes
:=
strings
.
Split
(
input
.
AuthCodes
,
","
)
//var data3 [1]string
//data3[0] = "202309061105000101E0000000050047"
data2
[
"sgn_info"
]
=
auth_codes
//签约协议号列表(字符串)
}
}
else
if
input
.
SourceCode
<
5
||
input
.
SourceCode
==
16
||
input
.
SourceCode
==
17
{
//微信
data2
[
"counter_param"
]
=
"{
\"
pay_mode
\"
:
\"
WECHAT
\"
}"
...
...
@@ -255,7 +262,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
}
//调拉卡拉接口
err
,
response
,
lakala_rtn
:=
lakala_post
(
input
,
url
,
data_json
)
err
,
response
,
lakala_rtn
:=
lakala_post
(
input
,
url
,
orderID
,
data_json
)
if
err
!=
nil
{
InsertPayBillDetailResponseBody
(
tx
,
billID
,
lakala_rtn
)
//todo
return
nil
,
err
...
...
@@ -278,18 +285,15 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
return
response
,
nil
}
func
lakala_post
(
input
*
models
.
PlaceAnOrderParamInput
,
url
string
,
data_json
[]
byte
)
(
error
,
interface
{},
interface
{})
{
func
lakala_post
(
input
*
models
.
PlaceAnOrderParamInput
,
url
,
order_id
string
,
data_json
[]
byte
)
(
error
,
interface
{},
interface
{})
{
var
source_code
,
platform_type
uint8
var
order_id
string
if
input
==
nil
{
source_code
=
0
//支付方式
platform_type
=
0
//平台类型
order_id
=
""
//订单号
}
else
{
source_code
=
input
.
SourceCode
//支付方式
platform_type
=
input
.
PlatformType
//平台类型
order_id
=
input
.
OrderId
//订单号
}
authorization
,
err
:=
getAuthorization
(
platform_type
,
string
(
data_json
))
...
...
@@ -335,6 +339,8 @@ func lakala_post(input *models.PlaceAnOrderParamInput, url string, data_json []b
if
temp2
[
"counter_url"
]
==
""
{
return
errors
.
New
(
"拉卡拉返回值「counter_url」为空错误"
),
""
,
temp
}
if
source_code
==
4
||
source_code
==
6
||
source_code
==
15
||
source_code
==
17
{
//微信H5、支付宝H5、快捷支付(银行卡)(包括微信小程序)
//聚合收银台(微信JSAPI-必康自营)
...
...
@@ -723,7 +729,7 @@ func UnifiedRefund(input *models.RefundParamInput, ip string) (interface{}, erro
}
//调拉卡拉接口
err
,
_
,
lakala_rtn
:=
lakala_post
(
nil
,
url
,
data_json
)
err
,
_
,
lakala_rtn
:=
lakala_post
(
nil
,
url
,
""
,
data_json
)
if
err
!=
nil
{
InsertPayBillDetailResponseBody
(
tx
,
billID
,
lakala_rtn
)
return
nil
,
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