记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
4a2d60da
Commit
4a2d60da
authored
Feb 17, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持微信支付。扫码
parent
01e5e047
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
4 deletions
+81
-4
DragonConstant.java
...com/liquidnet/service/dragon/constant/DragonConstant.java
+1
-1
DragonPayBaseReqDto.java
...com/liquidnet/service/dragon/dto/DragonPayBaseReqDto.java
+1
-0
WepayStrategyMicropayImpl.java
...hannel/wepay/strategy/impl/WepayStrategyMicropayImpl.java
+73
-0
PayController.java
...om/liquidnet/service/dragon/controller/PayController.java
+5
-2
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+1
-1
No files found.
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/constant/DragonConstant.java
View file @
4a2d60da
...
@@ -44,7 +44,7 @@ public class DragonConstant {
...
@@ -44,7 +44,7 @@ public class DragonConstant {
public
enum
DeviceFromEnum
{
public
enum
DeviceFromEnum
{
WEB
(
"web"
,
""
),
WAP
(
"wap"
,
""
),
WAPPAGE
(
"wappage"
,
""
)
WEB
(
"web"
,
""
),
WAP
(
"wap"
,
""
),
WAPPAGE
(
"wappage"
,
""
)
,
APP
(
"app"
,
""
),
JS
(
"js"
,
""
),
APPLET
(
"applet"
,
""
);
,
APP
(
"app"
,
""
),
JS
(
"js"
,
""
),
APPLET
(
"applet"
,
""
)
,
MICROPAY
(
"micropay"
,
""
)
;
private
String
code
;
private
String
code
;
private
String
message
;
private
String
message
;
DeviceFromEnum
(
String
code
,
String
message
)
{
DeviceFromEnum
(
String
code
,
String
message
)
{
...
...
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/DragonPayBaseReqDto.java
View file @
4a2d60da
...
@@ -35,6 +35,7 @@ public class DragonPayBaseReqDto implements Serializable, Cloneable{
...
@@ -35,6 +35,7 @@ public class DragonPayBaseReqDto implements Serializable, Cloneable{
private
String
quitUrl
;
private
String
quitUrl
;
private
String
showUrl
;
private
String
showUrl
;
private
String
returnUrl
;
private
String
returnUrl
;
private
String
authCode
;
@Override
@Override
public
String
toString
(){
public
String
toString
(){
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/WepayStrategyMicropayImpl.java
0 → 100644
View file @
4a2d60da
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WepayPayRespDto
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.utils.PayWepayUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.util.SortedMap
;
import
java.util.TreeMap
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: AlipayStrategyWapImpl
* @Package com.liquidnet.service.dragon.channel.alipay.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/10 14:34
*/
@Slf4j
@Component
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
MICROPAY
)
public
class
WepayStrategyMicropayImpl
extends
AbstractWepayStrategy
{
@Value
(
"${liquidnet.dragon.url}"
)
private
String
notifyUrl
;
@Override
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
,
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
requestMap
.
put
(
"trade_type"
,
"MICROPAY"
);
requestMap
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPP_ID
());
requestMap
.
remove
(
"notify_url"
);
requestMap
.
put
(
"auth_code"
,
dragonPayBaseReqDto
.
getAuthCode
());
return
requestMap
;
}
@Override
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
WepayPayRespDto
respDto
)
{
payBaseRespDto
.
getPayData
().
setPackages
(
"Sign=WXPay"
);
//设置签名
SortedMap
<
String
,
Object
>
paramMap
=
new
TreeMap
<
String
,
Object
>();
paramMap
.
put
(
"appid"
,
payBaseRespDto
.
getPayData
().
getAppId
());
paramMap
.
put
(
"partnerid"
,
payBaseRespDto
.
getPayData
().
getPartnerId
());
paramMap
.
put
(
"prepayid"
,
payBaseRespDto
.
getPayData
().
getPrepayId
());
paramMap
.
put
(
"package"
,
payBaseRespDto
.
getPayData
().
getPackages
());
paramMap
.
put
(
"noncestr"
,
payBaseRespDto
.
getPayData
().
getNonceStr
());
paramMap
.
put
(
"timestamp"
,
payBaseRespDto
.
getPayData
().
getTimeStamp
());
log
.
info
(
"wepay sercond sign param :{} "
,
JsonUtils
.
toJson
(
paramMap
));
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
paramMap
);
payBaseRespDto
.
getPayData
().
setPaySign
(
sign
);
return
payBaseRespDto
;
}
@Override
protected
String
getRequestUrl
()
{
return
"https://api.mch.weixin.qq.com/pay/micropay"
;
}
@Override
protected
String
getNotifyUrl
()
{
return
notifyUrl
+
"/notify/wepay/app"
;
}
@Override
protected
String
getAppid
()
{
return
PayWepayUtils
.
getInstance
().
getAPP_ID
();
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/PayController.java
View file @
4a2d60da
...
@@ -46,7 +46,7 @@ public class PayController {
...
@@ -46,7 +46,7 @@ public class PayController {
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"payType"
,
value
=
"支付类型:alipay,wepay,unionpay,applepay"
,
example
=
"unionpay"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"payType"
,
value
=
"支付类型:alipay,wepay,unionpay,applepay"
,
example
=
"unionpay"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"deviceFrom"
,
value
=
"设备来源:web,wap,app,js,apple"
,
example
=
"wap"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"deviceFrom"
,
value
=
"设备来源:web,wap,app,js,apple
,micropay
"
,
example
=
"wap"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"业务类型:TICKET,PRODUCT,COST,MBEANS,LIVE,VIDEO,VIP,CLUB,STRAWBERRY"
,
example
=
"TICKET"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"业务类型:TICKET,PRODUCT,COST,MBEANS,LIVE,VIDEO,VIP,CLUB,STRAWBERRY"
,
example
=
"TICKET"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"price"
,
value
=
"支付金额"
,
example
=
"0.1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"price"
,
value
=
"支付金额"
,
example
=
"0.1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"name"
,
value
=
"订单名称"
,
example
=
"测试订单001"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"name"
,
value
=
"订单名称"
,
example
=
"测试订单001"
),
...
@@ -57,6 +57,7 @@ public class PayController {
...
@@ -57,6 +57,7 @@ public class PayController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"notifyUrl"
,
value
=
"通知url"
,
example
=
"devdragon.zhengzai.tv"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"notifyUrl"
,
value
=
"通知url"
,
example
=
"devdragon.zhengzai.tv"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"createDate"
,
value
=
"订单创建时间"
,
example
=
"2021-11-10 13:00:00"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"createDate"
,
value
=
"订单创建时间"
,
example
=
"2021-11-10 13:00:00"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"expireTime"
,
value
=
"订单过期时间"
,
example
=
"1000"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"expireTime"
,
value
=
"订单过期时间"
,
example
=
"1000"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"authCode"
,
value
=
"付款码"
,
example
=
"1000"
),
})
})
@ResponseBody
@ResponseBody
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
...
@@ -76,7 +77,8 @@ public class PayController {
...
@@ -76,7 +77,8 @@ public class PayController {
@RequestParam
(
value
=
"showUrl"
,
required
=
false
)
String
showUrl
,
@RequestParam
(
value
=
"showUrl"
,
required
=
false
)
String
showUrl
,
// @RequestParam(value = "code",required = false) String code,
// @RequestParam(value = "code",required = false) String code,
@RequestParam
(
value
=
"createDate"
,
required
=
true
)
String
createDate
,
@RequestParam
(
value
=
"createDate"
,
required
=
true
)
String
createDate
,
@RequestParam
(
value
=
"expireTime"
,
required
=
true
)
String
expireTime
)
{
@RequestParam
(
value
=
"expireTime"
,
required
=
true
)
String
expireTime
,
@RequestParam
(
value
=
"authCode"
,
required
=
true
)
String
authCode
)
{
long
startTime
=
System
.
currentTimeMillis
();
long
startTime
=
System
.
currentTimeMillis
();
//为什么在js和applet中才需要判断open_id?
//为什么在js和applet中才需要判断open_id?
if
(
payType
.
equalsIgnoreCase
(
DragonConstant
.
PayChannelEnum
.
WEPAY
.
getCode
()))
{
if
(
payType
.
equalsIgnoreCase
(
DragonConstant
.
PayChannelEnum
.
WEPAY
.
getCode
()))
{
...
@@ -92,6 +94,7 @@ public class PayController {
...
@@ -92,6 +94,7 @@ public class PayController {
dragonPayBaseReqDto
.
setOpenId
(
openId
);
dragonPayBaseReqDto
.
setOpenId
(
openId
);
dragonPayBaseReqDto
.
setType
(
type
);
dragonPayBaseReqDto
.
setType
(
type
);
dragonPayBaseReqDto
.
setPrice
(
price
);
dragonPayBaseReqDto
.
setPrice
(
price
);
dragonPayBaseReqDto
.
setAuthCode
(
authCode
);
// if(StringUtil.isNotNull(name)&&name.length()>=32){
// if(StringUtil.isNotNull(name)&&name.length()>=32){
// name = name.substring(0,32);
// name = name.substring(0,32);
// }
// }
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
4a2d60da
...
@@ -84,7 +84,7 @@ public class GoblinFrontController {
...
@@ -84,7 +84,7 @@ public class GoblinFrontController {
return
ResponseDto
.
success
(
goblinFrontService
.
getCube
());
return
ResponseDto
.
success
(
goblinFrontService
.
getCube
());
}
}
@GetMapping
(
"getRecommend"
)
@GetMapping
(
"getRecommend"
)
@ApiOperation
(
"获取
魔方
"
)
@ApiOperation
(
"获取
新品推荐
"
)
public
ResponseDto
<
GoblinFrontCubeVo
>
getRecommend
()
throws
ParseException
{
public
ResponseDto
<
GoblinFrontCubeVo
>
getRecommend
()
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getRecommend
());
return
ResponseDto
.
success
(
goblinFrontService
.
getRecommend
());
}
}
...
...
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