记得上下班打卡 | 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
82bf9d4f
Commit
82bf9d4f
authored
Jul 13, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信回调 提交
parent
65549cfe
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
265 additions
and
44 deletions
+265
-44
DragonConstant.java
...com/liquidnet/service/dragon/constant/DragonConstant.java
+3
-0
NotifyUrlDto.java
...n/java/com/liquidnet/service/dragon/dto/NotifyUrlDto.java
+25
-0
IDragonOrderRefundsService.java
...et/service/dragon/service/IDragonOrderRefundsService.java
+4
-3
liquidnet-service-dragon-dev.yml
...-config/liquidnet-config/liquidnet-service-dragon-dev.yml
+1
-2
WePayRefundReturnCallBackDto.java
...agon/channel/wepay/resp/WePayRefundReturnCallBackDto.java
+21
-0
WePayRefundReturnCallBackInfoDto.java
.../channel/wepay/resp/WePayRefundReturnCallBackInfoDto.java
+35
-0
RefundController.java
...liquidnet/service/dragon/controller/RefundController.java
+12
-15
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+131
-22
PayWepayUtils.java
...ava/com/liquidnet/service/dragon/utils/PayWepayUtils.java
+29
-0
sqlmap.properties
...-service-dragon-impl/src/main/resources/sqlmap.properties
+4
-2
No files found.
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/constant/DragonConstant.java
View file @
82bf9d4f
...
...
@@ -15,6 +15,9 @@ public class DragonConstant {
public
static
final
String
REFUND_TYPE_JS_WEPAY
=
"JSWEPAY"
;
//,"微信内网页、微信公众号"),
public
static
final
String
REFUND_TYPE_APPLET_WEPAY
=
"APPLETWEPAY"
;
//,"微信小程序");
public
static
final
String
REFUND_REDIS_KET
=
"dragon:refund:refundCode:"
;
// 订单号对应回调地址
public
enum
PayChannelEnum
{
ALIPAY
(
"alipay"
,
"支付宝"
),
WEPAY
(
"wepay"
,
"微信"
),
...
...
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/NotifyUrlDto.java
0 → 100644
View file @
82bf9d4f
package
com
.
liquidnet
.
service
.
dragon
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
NotifyUrlDto
implements
Serializable
{
private
Integer
status
;
// private String orderCode;
// private String code;
// private String type;
// private String price;
// private String paymentType;
// private String paymentAt;
// private String paymentId;
private
String
orderRefundCode
;
private
String
refundCode
;
private
String
refundPrice
;
// private String refundReason;
// private String refundType;
private
String
refundId
;
private
String
refundAt
;
private
String
refundError
;
}
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/service/IDragonOrderRefundsService.java
View file @
82bf9d4f
...
...
@@ -3,12 +3,12 @@ package com.liquidnet.service.dragon.service;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.dto.DragonRefundAppDto
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.math.BigDecimal
;
public
interface
IDragonOrderRefundsService
{
void
sendRedisQueue
();
/**
*
* @param tradeNo => refundCode
...
...
@@ -20,7 +20,8 @@ public interface IDragonOrderRefundsService {
*/
ResponseDto
<
DragonRefundAppDto
>
dragonRefund
(
String
orderCode
,
String
tradeNo
,
String
outTradeNo
,
String
reason
,
String
returnUrl
,
BigDecimal
price
,
String
paymentType
,
String
paymentId
,
BigDecimal
priceTotal
);
ResponseDto
<
DragonRefundAppDto
>
wePayRefundCallBack
();
String
wePayRefundCallBack
(
HttpServletRequest
request
,
HttpServletResponse
response
);
}
liquidnet-bus-config/liquidnet-config/liquidnet-service-dragon-dev.yml
View file @
82bf9d4f
...
...
@@ -23,12 +23,11 @@ liquidnet:
sslEnabled
:
false
database
:
dev_ln_scene
dragon
:
url
:
https://devdragon.zhengzai.tv/dragon
alipay
:
gataway-url
:
https://openapi.alipay.com/gateway.do
notify-url
:
https://testdragon.zhengzai.tv/dragon/notify/alipay
wepay
:
gataway-url
:
https://openapi.alipay.com/gateway.do
notify-url
:
https://testdragon.zhengzai.tv/dragon/notify/wepay
merchantId
:
1551961491
appId
:
wx3498304dda39c5a1
parentKey
:
itIuO65O9yKmemOu3S8g1S4orqvCGwXK
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/resp/WePayRefundReturnCallBackDto.java
0 → 100644
View file @
82bf9d4f
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
resp
;
import
com.thoughtworks.xstream.annotations.XStreamAlias
;
import
lombok.Data
;
@Data
@XStreamAlias
(
"xml"
)
public
class
WePayRefundReturnCallBackDto
{
@XStreamAlias
(
"return_code"
)
private
String
returnCode
;
@XStreamAlias
(
"return_msg"
)
private
String
returnMsg
;
@XStreamAlias
(
"appid"
)
private
String
appId
;
@XStreamAlias
(
"mch_id"
)
private
String
mchId
;
@XStreamAlias
(
"nonce_str"
)
private
String
nonceStr
;
@XStreamAlias
(
"req_info"
)
private
String
reqInfo
;
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/resp/WePayRefundReturnCallBackInfoDto.java
0 → 100644
View file @
82bf9d4f
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
resp
;
import
com.thoughtworks.xstream.annotations.XStreamAlias
;
import
lombok.Data
;
@Data
@XStreamAlias
(
"xml"
)
public
class
WePayRefundReturnCallBackInfoDto
{
@XStreamAlias
(
"out_refund_no"
)
private
String
outRefundNo
;
@XStreamAlias
(
"out_trade_no"
)
private
String
outTradeNo
;
@XStreamAlias
(
"refund_account"
)
private
String
refundAccount
;
@XStreamAlias
(
"refund_fee"
)
private
String
refundFee
;
@XStreamAlias
(
"refund_id"
)
private
String
refundId
;
@XStreamAlias
(
"refund_recv_accout"
)
private
String
refundRecvAccout
;
@XStreamAlias
(
"refund_request_source"
)
private
String
refundRequestSource
;
@XStreamAlias
(
"refund_status"
)
private
String
refundStatus
;
@XStreamAlias
(
"settlement_refund_fee"
)
private
String
settlementRefundFee
;
@XStreamAlias
(
"settlement_total_fee"
)
private
String
settlementTotalFee
;
@XStreamAlias
(
"success_time"
)
private
String
successTime
;
@XStreamAlias
(
"total_fee"
)
private
String
totalFee
;
@XStreamAlias
(
"transaction_id"
)
private
String
transactionId
;
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/RefundController.java
View file @
82bf9d4f
...
...
@@ -8,6 +8,8 @@ import io.swagger.annotations.ApiResponse;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
...
...
@@ -18,21 +20,6 @@ public class RefundController {
@Autowired
IDragonOrderRefundsService
orderRefundsService
;
@PostMapping
(
"preTest"
)
@ApiOperation
(
"微信退款"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
String
>
checkCanOrder
()
{
orderRefundsService
.
sendRedisQueue
();
return
ResponseDto
.
success
();
}
@PostMapping
(
"refundAliPay"
)
@ApiOperation
(
"支付宝退款"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
String
>
refundAliPay
()
{
return
ResponseDto
.
success
();
}
@PostMapping
(
"refundSingle"
)
@ApiOperation
(
"单条退款"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
...
...
@@ -47,4 +34,14 @@ public class RefundController {
@RequestParam
(
value
=
"paymentId"
)
@NotNull
(
message
=
"支付订单号不能为空"
)
String
paymentId
)
{
return
orderRefundsService
.
dragonRefund
(
orderCode
,
code
,
orderRefundCode
,
reason
,
returnUrl
,
price
,
paymentType
,
paymentId
,
priceTotal
);
}
@PostMapping
(
"callBack/wepay"
)
@ApiOperation
(
"单条退款"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
String
refundSingle
(
@RequestParam
(
value
=
"request"
)
HttpServletRequest
request
,
@RequestParam
(
value
=
"response"
)
HttpServletResponse
response
)
{
return
orderRefundsService
.
wePayRefundCallBack
(
request
,
response
);
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
82bf9d4f
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/PayWepayUtils.java
View file @
82bf9d4f
...
...
@@ -7,12 +7,16 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.ssl.SSLContexts
;
import
org.bouncycastle.jce.provider.BouncyCastleProvider
;
import
org.dom4j.DocumentException
;
import
javax.crypto.Cipher
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.net.ssl.SSLContext
;
import
java.io.ByteArrayInputStream
;
import
java.io.InputStream
;
import
java.security.KeyStore
;
import
java.security.Security
;
import
java.util.*
;
public
class
PayWepayUtils
{
...
...
@@ -118,4 +122,29 @@ public class PayWepayUtils {
sb
.
append
(
"</xml>"
);
return
sb
.
toString
();
}
public
String
unCodeReqInfo
(
String
reqInfo
)
{
try
{
Cipher
cipher
;
String
key
=
MD5Utils
.
md5
(
parentKey
);
SecretKeySpec
secretKeySpec
=
new
SecretKeySpec
(
key
.
getBytes
(),
"AES"
);
Security
.
addProvider
(
new
BouncyCastleProvider
());
cipher
=
Cipher
.
getInstance
(
"AES/ECB/PKCS7Padding"
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
secretKeySpec
);
Base64
.
Decoder
decoder
=
Base64
.
getDecoder
();
byte
[]
base64ByteArr
=
decoder
.
decode
(
reqInfo
);
String
result
=
new
String
(
cipher
.
doFinal
(
base64ByteArr
));
return
result
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
""
;
}
}
// public static void main(String[] args) {
// PayWepayUtils a = new PayWepayUtils();
// System.out.println(a.unCodeReqInfo());
// }
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/resources/sqlmap.properties
View file @
82bf9d4f
# ------------------------创建退款订单----------------------------
dragon_order_refund.insert
=
INSERT INTO `dragon_order_refunds`(`order_refund_id`,`code` ,`order_refund_code` ,`price` ,`reason` ,`notify_url` ,`refund_type`,`created_at`,`updated_at`)VALUES(?,?,?,?,?,?,?,?,?);
# ------------------------修改退款订单----------------------------
dragon_order_refund_error.update
=
UPDATE `dragon_order_refunds` SET updated_at = ? , refund_error=? , status=? WHERE order_refund_id = ?
dragon_order_refund_success.update
=
UPDATE `dragon_order_refunds` SET updated_at = ? , refund_at=? , status=? WHERE order_refund_id = ?
dragon_order_refund_error.update
=
UPDATE `dragon_order_refunds` SET updated_at = ? , refund_error=? , status=? WHERE order_refund_code = ?
dragon_order_refund_success.update
=
UPDATE `dragon_order_refunds` SET updated_at = ? , refund_at=? , status=? WHERE order_refund_code = ?
dragon_order_refund_call_back.update
=
UPDATE `dragon_order_refunds` SET updated_at = ? , finished_at=? , status=? WHERE order_refund_code = ?
# ------------------------创建退款订单日志----------------------------
dragon_order_refund_log.insert
=
INSERT INTO `dragon_order_refunds`(`order_refund_id` ,`refund_type` ,`content`,`created_at`,`updated_at`)VALUES(?,?,?,?,?);
dragon_orders.insert
=
INSERT INTO DRAGON_ORDERS (ID, STATUS, CODE, TYPE, PRICE, NAME, DETAIL, ORDER_CODE, CLIENT_IP, NOTIFY_URL, PAYMENT_TYPE,PAYMENT_ID, PAYMENT_AT, FINISHED_AT, CREATED_AT, UPDATED_AT, DELETED_AT)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
dragon_order_logs.insert
=
INSERT INTO DRAGON_ORDER_LOGS (ID, ORDER_ID, PAYMENT_TYPE, CONTENT, CREATED_AT, UPDATED_AT, DELETED_AT) VALUES(?,?,?,?,?,?,?)
...
...
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