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
84c14c43
Commit
84c14c43
authored
Sep 19, 2023
by
wangp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lakala 聚合扫码-交易查询
parent
6fd3ca09
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1260 additions
and
212 deletions
+1260
-212
config.yaml
conf/dev/config.yaml
+1
-0
config.yaml
conf/prod/config.yaml
+1
-0
pay.go
controller/api/v1/pay/pay.go
+37
-0
docs.go
docs/docs.go
+255
-32
swagger.json
docs/swagger.json
+255
-32
swagger.yaml
docs/swagger.yaml
+201
-32
notice.go
models/notice.go
+37
-37
pay.go
models/pay.go
+42
-37
pay.go
repository/pay/pay.go
+426
-41
pay_router.go
router/v1/pay_router.go
+4
-1
setting.go
setting/setting.go
+1
-0
No files found.
conf/dev/config.yaml
View file @
84c14c43
...
@@ -115,3 +115,4 @@ lakala:
...
@@ -115,3 +115,4 @@ lakala:
url_micropay
:
'
https://test.wsmsd.cn/sit/api/v3/labs/trans/micropay'
#聚合被扫(扫码枪)
url_micropay
:
'
https://test.wsmsd.cn/sit/api/v3/labs/trans/micropay'
#聚合被扫(扫码枪)
url_refund
:
'
https://test.wsmsd.cn/sit/api/v3/labs/relation/refund'
#聚合扫码-退款交易
url_refund
:
'
https://test.wsmsd.cn/sit/api/v3/labs/relation/refund'
#聚合扫码-退款交易
url_trade_refund
:
'
https://test.wsmsd.cn/sit/api/v3/lams/trade/trade_refund'
#统一退货接口
url_trade_refund
:
'
https://test.wsmsd.cn/sit/api/v3/lams/trade/trade_refund'
#统一退货接口
url_order_state
:
'
https://test.wsmsd.cn/sit/api/v3/labs/query/tradequery'
#聚合扫码-交易查询
conf/prod/config.yaml
View file @
84c14c43
...
@@ -115,3 +115,4 @@ lakala:
...
@@ -115,3 +115,4 @@ lakala:
url_micropay
:
'
https://s2.lakala.com/api/v3/labs/trans/micropay'
#聚合被扫(扫码枪)
url_micropay
:
'
https://s2.lakala.com/api/v3/labs/trans/micropay'
#聚合被扫(扫码枪)
url_refund
:
'
https://s2.lakala.com/api/v3/labs/relation/refund'
#聚合扫码-退款交易
url_refund
:
'
https://s2.lakala.com/api/v3/labs/relation/refund'
#聚合扫码-退款交易
url_trade_refund
:
'
https://s2.lakala.com/api/v3/lams/trade/trade_refund'
#统一退货接口
url_trade_refund
:
'
https://s2.lakala.com/api/v3/lams/trade/trade_refund'
#统一退货接口
url_order_state
:
'
https://s2.lakala.com/api/v3/labs/query/tradequery'
#聚合扫码-交易查询
controller/api/v1/pay/pay.go
View file @
84c14c43
...
@@ -81,5 +81,42 @@ func (l *PayController) UnifiedRefund(c *gin.Context) {
...
@@ -81,5 +81,42 @@ func (l *PayController) UnifiedRefund(c *gin.Context) {
return
return
}
}
base
.
ResponseSuccess
(
c
,
rtn
)
}
// OrderState 拉卡拉支付查询
// @Summary 拉卡拉支付查询
// @Description 拉卡拉支付查询
// @Tags 拉卡拉支付查询
// @Accept application/json
// @Produce application/json
// @Param body body models.OrderStateInput true "参数"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文"
// @Success 200
// @router /api/v1/pay/order_state [post]
func
(
l
*
PayController
)
OrderState
(
c
*
gin
.
Context
)
{
ph
:=
new
(
models
.
OrderStateInput
)
//fmt.Println("ContentType="+c.ContentType())
err
:=
c
.
ShouldBindJSON
(
ph
)
if
err
!=
nil
{
zap
.
L
()
.
Error
(
err
.
Error
())
//logs错误日志
base
.
ResponseErrorWithMsg
(
c
,
base
.
ServerError
)
return
}
//// clientIp ip
//ip := c.ClientIP()
////fmt.Println("ip="+ip)
// 拉卡拉支付查询
rtn
,
err
:=
pay
.
OrderState
(
ph
)
if
err
!=
nil
{
zap
.
L
()
.
Error
(
err
.
Error
())
//base.ResponseErrorWithMsg(c, base.ServerError)
base
.
ResponseErrorMsg
(
c
,
err
.
Error
())
return
}
base
.
ResponseSuccess
(
c
,
rtn
)
base
.
ResponseSuccess
(
c
,
rtn
)
}
}
\ No newline at end of file
docs/docs.go
View file @
84c14c43
This diff is collapsed.
Click to expand it.
docs/swagger.json
View file @
84c14c43
This diff is collapsed.
Click to expand it.
docs/swagger.yaml
View file @
84c14c43
This diff is collapsed.
Click to expand it.
models/notice.go
View file @
84c14c43
...
@@ -2,46 +2,46 @@ package models
...
@@ -2,46 +2,46 @@ package models
//聚合收银台-交易通知(回调输入参数)
//聚合收银台-交易通知(回调输入参数)
type
CashierNoticeInput
struct
{
type
CashierNoticeInput
struct
{
ChannelId
string
`json:"channel_id"
description:"渠道号"`
ChannelId
string
`json:"channel_id"
`
//渠道号
MerchantNo
string
`json:"merchant_no"
description:"结算商户号"`
MerchantNo
string
`json:"merchant_no"
`
//结算商户号
OrderCreateTime
string
`json:"order_create_time"
description:"订单创建时间"`
OrderCreateTime
string
`json:"order_create_time"
`
//订单创建时间
OrderEfficientTime
string
`json:"order_efficient_time"
description:"订单有效时间"`
OrderEfficientTime
string
`json:"order_efficient_time"
`
//订单有效时间
OrderInfo
string
`json:"order_info"
description:"订单描述"`
OrderInfo
string
`json:"order_info"
`
//订单描述
OrderStatus
string
`json:"order_status"
description:"订单状态"`
OrderStatus
string
`json:"order_status"
`
//订单状态
OutOrderNo
string
`json:"out_order_no"
description:"商户订单号"`
OutOrderNo
string
`json:"out_order_no"
`
//商户订单号
PayOrderNo
string
`json:"pay_order_no"
description:"支付订单号"`
PayOrderNo
string
`json:"pay_order_no"
`
//支付订单号
TermNo
string
`json:"term_no"
description:"结算终端号"`
TermNo
string
`json:"term_no"
`
//结算终端号
TotalAmount
int64
`json:"total_amount"
description:"订单金额,单位:分"`
TotalAmount
int64
`json:"total_amount"
`
//订单金额,单位:分
TransMerchantNo
string
`json:"trans_merchant_no"
description:"交易商户号"`
TransMerchantNo
string
`json:"trans_merchant_no"
`
//交易商户号
TransTermNo
string
`json:"trans_term_no"
description:"交易终端号"`
TransTermNo
string
`json:"trans_term_no"
`
//交易终端号
OrderTradeInfo
interface
{}
`json:"order_trade_info"
description:""
`
OrderTradeInfo
interface
{}
`json:"order_trade_info"`
SplitInfo
interface
{}
`json:"split_info"
description:""
`
SplitInfo
interface
{}
`json:"split_info"`
}
}
//聚合扫码-交易通知(回调输入参数)
//聚合扫码-交易通知(回调输入参数)
type
ScanNoticeInput
struct
{
type
ScanNoticeInput
struct
{
MerchantNo
string
`json:"merchant_no"
description:"商户号"`
MerchantNo
string
`json:"merchant_no"
`
//商户号
OutTradeNo
string
`json:"out_trade_no"
description:"商户交易流水号"`
OutTradeNo
string
`json:"out_trade_no"
`
//商户交易流水号
TradeNo
string
`json:"trade_no"
description:"拉卡拉交易流水号"`
TradeNo
string
`json:"trade_no"
`
//拉卡拉交易流水号
LogNo
string
`json:"log_no"
description:"拉卡拉对账单流水号"`
LogNo
string
`json:"log_no"
`
//拉卡拉对账单流水号
AccTradeNo
string
`json:"acc_trade_no"
description:"账户端交易订单号"`
AccTradeNo
string
`json:"acc_trade_no"
`
//账户端交易订单号
AccountType
string
`json:"account_type"
description:"钱包类型"`
AccountType
string
`json:"account_type"
`
//钱包类型
SettleMerchantNo
string
`json:"settle_merchant_no"
description:"结算商户号"`
SettleMerchantNo
string
`json:"settle_merchant_no"
`
//结算商户号
SettleTermNo
string
`json:"settle_term_no"
description:"结算终端号"`
SettleTermNo
string
`json:"settle_term_no"
`
//结算终端号
TradeStatus
string
`json:"trade_status"
description:"交易状态"`
TradeStatus
string
`json:"trade_status"
`
//交易状态
TotalAmount
string
`json:"total_amount"
description:"订单金额"`
TotalAmount
string
`json:"total_amount"
`
//订单金额
PayerAmount
string
`json:"payer_amount"
description:"付款人实付金额"`
PayerAmount
string
`json:"payer_amount"
`
//付款人实付金额
AccSettleAmount
string
`json:"acc_settle_amount"
description:"账户端结算金额"`
AccSettleAmount
string
`json:"acc_settle_amount"
`
//账户端结算金额
AccMdiscountAmount
string
`json:"acc_mdiscount_amount"
description:"商户侧优惠金额(账户端)"`
AccMdiscountAmount
string
`json:"acc_mdiscount_amount"
`
//商户侧优惠金额(账户端)
AccDiscountAmount
string
`json:"acc_discount_amount"
description:"账户端优惠金额"`
AccDiscountAmount
string
`json:"acc_discount_amount"
`
//账户端优惠金额
AccOtherDiscountAmount
string
`json:"acc_other_discount_amount"
description:"账户端其它优惠金额(待上线)"`
AccOtherDiscountAmount
string
`json:"acc_other_discount_amount"
`
//账户端其它优惠金额(待上线)
TradeTime
string
`json:"trade_time"
description:"交易完成时间"`
TradeTime
string
`json:"trade_time"
`
//交易完成时间
UserId1
string
`json:"user_id1"
description:"用户标识1"`
UserId1
string
`json:"user_id1"
`
//用户标识1
UserId2
string
`json:"user_id2"
description:"用户标识2"`
UserId2
string
`json:"user_id2"
`
//用户标识2
AccActivityId
string
`json:"acc_activity_id"
description:"活动ID"`
AccActivityId
string
`json:"acc_activity_id"
`
//活动ID
BankType
string
`json:"bank_type"
description:"付款银行"`
BankType
string
`json:"bank_type"
`
//付款银行
CardType
string
`json:"card_type"
description:"银行卡类型"`
CardType
string
`json:"card_type"
`
//银行卡类型
Remark
string
`json:"remark"
description:"备注"`
Remark
string
`json:"remark"
`
//备注
HbFqPayInfo
interface
{}
`json:"hb_fq_pay_info"
description:"花呗分期支付信息(未上线)"`
HbFqPayInfo
interface
{}
`json:"hb_fq_pay_info"
`
//花呗分期支付信息(未上线)
}
}
// CallbackResponse is 回调给业务方的信息
// CallbackResponse is 回调给业务方的信息
...
...
models/pay.go
View file @
84c14c43
...
@@ -2,55 +2,60 @@ package models
...
@@ -2,55 +2,60 @@ package models
//支付
//支付
type
PlaceAnOrderParamInput
struct
{
type
PlaceAnOrderParamInput
struct
{
PlatformType
uint8
`json:"platform_type"
description:"平台类型 1:saas 2:shop 3:shop mobile 4:收银台 6:bk_shop 7:bk_shop_mobile"`
PlatformType
uint8
`json:"platform_type"
`
//平台类型 1:saas 2:shop 3:shop mobile 4:收银台 6:bk_shop 7:bk_shop_mobile
PlatformInfo
string
`json:"platform_info"
description:"平台信息"`
PlatformInfo
string
`json:"platform_info"
`
//平台信息
GoodsDes
string
`json:"goods_des"
description:"商品描述"`
GoodsDes
string
`json:"goods_des"
`
//商品描述
GoodsDetail
string
`json:"goods_detail"
description:"商品详情"`
GoodsDetail
string
`json:"goods_detail"
`
//商品详情
AttachInfo
string
`json:"attach_info"
description:"附加信息"`
AttachInfo
string
`json:"attach_info"
`
//附加信息
GoodsPrice
float64
`json:"goods_price"
description:"商品金额,个位为分"`
GoodsPrice
float64
`json:"goods_price"
`
//商品金额,个位为分
NoticeURL
string
`json:"notice_url"
description:"客户端回调的url"`
NoticeURL
string
`json:"notice_url"
`
//客户端回调的url
PayType
int
`json:"pay_type"
description:"支付渠道 1:微信 2:支付宝 3:拉卡拉 4:收钱吧"`
PayType
int
`json:"pay_type"
`
//支付渠道 1:微信 2:支付宝 3:拉卡拉 4:收钱吧
SourceCode
uint8
`json:"source_code"
description:"支付方式 1:微信Native 2:微信小程序 3:微信内支付 4:h5 跳微信 5:支付宝(web)-扫码或登录支付宝账户 6:alipay(mobile) 7:alipay(app) 9:B2C 10:bk支付宝web 11:bk 支付宝手机 15:快捷支付(银行卡) 16:微信小程序-必康自营 17:微信JASPI-必康自营"`
SourceCode
uint8
`json:"source_code"
`
//支付方式 1:微信Native 2:微信小程序 3:微信内支付 4:h5 跳微信 5:支付宝(web)-扫码或登录支付宝账户 6:alipay(mobile) 7:alipay(app) 9:B2C 10:bk支付宝web 11:bk 支付宝手机 15:快捷支付(银行卡) 16:微信小程序-必康自营 17:微信JASPI-必康自营
OpenID
string
`json:"open_id"
description:"此参数 支付类型是 JS API 的时候 必传"`
OpenID
string
`json:"open_id"
`
//此参数 支付类型是 JS API 的时候 必传
WapURL
string
`json:"wap_url"
description:"WAP网站URL地址, 支付方式为微信MWEB时 必传"`
WapURL
string
`json:"wap_url"
`
//WAP网站URL地址, 支付方式为微信MWEB时 必传
WapName
string
`json:"wap_name"
description:"WAP网站名称, 支付方式为微信MWEB时 必传"`
WapName
string
`json:"wap_name"
`
//WAP网站名称, 支付方式为微信MWEB时 必传
QuitURL
string
`json:"quit_url"
description:"返回按钮 可用于用户付款中途退出并返回到该参数指定的商户网站地址, 支付方式为 支付宝手机网站时 必传(尽量传)"`
QuitURL
string
`json:"quit_url"
`
//返回按钮 可用于用户付款中途退出并返回到该参数指定的商户网站地址, 支付方式为 支付宝手机网站时 必传(尽量传)
ReturnURL
string
`json:"return_url"
description:"用户在完成支付后,会根据商户在请求支付API中传入的前台回跳地址return_url自动跳转return_url地址页面(必传)"`
ReturnURL
string
`json:"return_url"
`
//用户在完成支付后,会根据商户在请求支付API中传入的前台回跳地址return_url自动跳转return_url地址页面(必传)
AppID
string
`json:"app_id,omitempty"
description:"wxAppId source code 2 小程序支付时必传、同时小程序支付必须关联了商户号支付"`
AppID
string
`json:"app_id,omitempty"
`
//wxAppId source code 2 小程序支付时必传、同时小程序支付必须关联了商户号支付
Operator
string
`json:"operator"
description:"操作员"`
Operator
string
`json:"operator"
`
//操作员
Customer
string
`json:"customer"
description:"顾客信息"`
Customer
string
`json:"customer"
`
//顾客信息
DynamicID
string
`json:"dynamic_id"
description:"顾客手机条码的内容"`
DynamicID
string
`json:"dynamic_id"
`
//顾客手机条码的内容
StoreSn
string
`json:"store_sn"
description:"商户门店编号"`
StoreSn
string
`json:"store_sn"
`
//商户门店编号
IsServe
uint
`json:"is_serve"
description:"0直连模式 1服务商模式"`
IsServe
uint
`json:"is_serve"
`
//0直连模式 1服务商模式
OrderId
string
`json:"-"
description:"订单号"`
OrderId
string
`json:"-"
`
//订单号
SubMchid
string
`json:"sub_mchid"
description:"通过进件接口申请的支付商户号、这是由微信生成并下发的"`
SubMchid
string
`json:"sub_mchid"
`
//通过进件接口申请的支付商户号、这是由微信生成并下发的
Nonce
string
`json:"-"`
Nonce
string
`json:"-"`
ServeNoticeUrl
string
`json:"-"
description:"传递给支付渠道的、而不是业务方的"`
ServeNoticeUrl
string
`json:"-"
`
//传递给支付渠道的、而不是业务方的
AuthCodes
string
`json:"auth_codes"
description:"LAKALA签约协议号列表"`
AuthCodes
string
`json:"auth_codes"
`
//LAKALA签约协议号列表
}
}
//退款
//退款
type
RefundParamInput
struct
{
type
RefundParamInput
struct
{
RefundNo
string
`json:"refund_no" description:"退款号:原对账单流水号"`
RefundNo
string
`json:"refund_no"`
//退款号:原对账单流水号
RefundAmount
float64
`json:"refund_amount" description:"退款金额,个位为分"`
RefundAmount
float64
`json:"refund_amount"`
//退款金额,个位为分
RefundReason
string
`json:"refund_reason" description:"退款原因"`
RefundReason
string
`json:"refund_reason"`
//退款原因
}
//支付查询
type
OrderStateInput
struct
{
OrderId
string
`json:"order_id"`
//订单号
}
}
type
LakalaParamInput
struct
{
type
LakalaParamInput
struct
{
Version
string
`json:"version"
description:"版本"`
Version
string
`json:"version"
`
//版本
ReqTime
string
`json:"req_time"
description:"请求时间"`
ReqTime
string
`json:"req_time"
`
//请求时间
ReqData
LakalaParamData
`json:"req_data"`
ReqData
LakalaParamData
`json:"req_data"`
}
}
type
LakalaParamData
struct
{
type
LakalaParamData
struct
{
OutOrderNo
string
`json:"out_order_no"
description:"商户订单号"`
OutOrderNo
string
`json:"out_order_no"
`
//商户订单号
MerchantNo
string
`json:"merchant_no"
description:"银联商户号"`
MerchantNo
string
`json:"merchant_no"
`
//银联商户号
TotalAmount
float64
`json:"total_amount"
description:"订单金额,单位:分"`
TotalAmount
float64
`json:"total_amount"
`
//订单金额,单位:分
OrderEfficientTime
string
`json:"order_efficient_time"
description:"订单有效期 格式yyyyMMddHHmmss,最大支持下单时间+2天"`
OrderEfficientTime
string
`json:"order_efficient_time"
`
//订单有效期 格式yyyyMMddHHmmss,最大支持下单时间+2天
NotifyUrl
string
`json:"notify_url"
description:"订单支付成功后商户接收订单通知的地址 http://xxx.xxx.com"`
NotifyUrl
string
`json:"notify_url"
`
//订单支付成功后商户接收订单通知的地址 http://xxx.xxx.com
CallbackUrl
string
`json:"callback_url"
description:"客户端下单完成支付后返回的商户网页跳转地址"`
CallbackUrl
string
`json:"callback_url"
`
//客户端下单完成支付后返回的商户网页跳转地址
OrderInfo
string
`json:"order_info"
description:"订单标题,在使用收银台扫码支付时必输入,交易时送往账户端"`
OrderInfo
string
`json:"order_info"
`
//订单标题,在使用收银台扫码支付时必输入,交易时送往账户端
GoodsMark
string
`json:"goods_mark"
description:"商品信息标识 (1:含商品信息,不填默认不含商品信息)"`
GoodsMark
string
`json:"goods_mark"
`
//商品信息标识 (1:含商品信息,不填默认不含商品信息)
}
}
\ No newline at end of file
repository/pay/pay.go
View file @
84c14c43
This diff is collapsed.
Click to expand it.
router/v1/pay_router.go
View file @
84c14c43
...
@@ -19,7 +19,10 @@ func PayRouter (r *gin.Engine) {
...
@@ -19,7 +19,10 @@ func PayRouter (r *gin.Engine) {
// 卡拉卡统一支付回调(聚合扫码)
// 卡拉卡统一支付回调(聚合扫码)
r
.
POST
(
pack
.
PayUrlPacking
(
"scan_notice"
),
PayController
.
ScanNotice
)
r
.
POST
(
pack
.
PayUrlPacking
(
"scan_notice"
),
PayController
.
ScanNotice
)
// 卡拉卡统一支付
// 拉卡拉支付查询
r
.
POST
(
pack
.
PayUrlPacking
(
"order_state"
),
PayController
.
OrderState
)
// 拉卡拉退款
r
.
POST
(
pack
.
PayUrlPacking
(
"unified_refund"
),
PayController
.
UnifiedRefund
)
r
.
POST
(
pack
.
PayUrlPacking
(
"unified_refund"
),
PayController
.
UnifiedRefund
)
}
}
setting/setting.go
View file @
84c14c43
...
@@ -120,6 +120,7 @@ type Lakala struct {
...
@@ -120,6 +120,7 @@ type Lakala struct {
UrlMicropay
string
`mapstructure:"url_micropay"`
//聚合被扫(扫码枪)
UrlMicropay
string
`mapstructure:"url_micropay"`
//聚合被扫(扫码枪)
UrlRefund
string
`mapstructure:"url_refund"`
//聚合扫码-退款交易
UrlRefund
string
`mapstructure:"url_refund"`
//聚合扫码-退款交易
UrlTradeRefund
string
`mapstructure:"url_trade_refund"`
//统一退货接口
UrlTradeRefund
string
`mapstructure:"url_trade_refund"`
//统一退货接口
UrlOrderState
string
`mapstructure:"url_order_state"`
//聚合扫码-交易查询
}
}
// Init 支持热修改的viper设置
// Init 支持热修改的viper设置
...
...
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