记得上下班打卡 | 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
19cea224
Commit
19cea224
authored
Jul 08, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 退款详情
parent
dba5bca3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
198 additions
and
18 deletions
+198
-18
DragonConstant.java
...com/liquidnet/service/dragon/constant/DragonConstant.java
+17
-0
OrderSwitchAdminController.java
...controller/zhengzai/order/OrderSwitchAdminController.java
+1
-1
pom.xml
...dnet-service-dragon/liquidnet-service-dragon-impl/pom.xml
+7
-0
PayController.java
...om/liquidnet/service/dragon/controller/PayController.java
+0
-7
RefundController.java
...liquidnet/service/dragon/controller/RefundController.java
+11
-2
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+45
-4
PayUtils.java
...ain/java/com/liquidnet/service/dragon/utils/PayUtils.java
+65
-0
TestUtils.java
...in/java/com/liquidnet/service/dragon/utils/TestUtils.java
+0
-4
wepay_apiclient_cert.pem
...src/main/resources/payCert/wepay/wepay_apiclient_cert.pem
+24
-0
wepay_apiclient_key.pem
.../src/main/resources/payCert/wepay/wepay_apiclient_key.pem
+28
-0
No files found.
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/constant/DragonConstant.java
View file @
19cea224
...
...
@@ -112,4 +112,21 @@ public class DragonConstant {
this
.
message
=
message
;
}
}
/**
* CHANNEL_REFUND_URL
*/
public
enum
channelRefundUrlEnum
{
JSAPI_REFUND_URL
(
"https://api.mch.weixin.qq.com/v3/refund/domestic/refunds"
,
"JSAPI-退款-接口"
),
APP_REFUND_URL
(
"https://api.mch.weixin.qq.com/v3/refund/domestic/refunds"
,
"APP-退款-接口"
),
H5_REFUND_URL
(
"https://api.mch.weixin.qq.com/v3/refund/domestic/refunds"
,
"H5-退款-接口"
),
NATIVE_REFUND_URL
(
"https://api.mch.weixin.qq.com/v3/refund/domestic/refunds"
,
"NATIVE-退款-接口"
),
MCH_REFUND_URL
(
"https://api.mch.weixin.qq.com/v3/refund/domestic/refunds"
,
"小程序-退款-接口"
);
private
String
code
;
private
String
message
;
channelRefundUrlEnum
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/order/OrderSwitchAdminController.java
View file @
19cea224
...
...
@@ -27,7 +27,7 @@ public class OrderSwitchAdminController {
IKylinOrderRefundsService
kylinOrderRefundsService
;
@RequiresPermissions
(
"order:switch:search:code"
)
@ApiOperation
(
value
=
"
开放/限制校验证码
"
)
@ApiOperation
(
value
=
"
根据截取订单号获取全量订单号
"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"订单号"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"int"
,
name
=
"type"
,
value
=
"1退款单号 2订单号"
,
example
=
""
),
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/pom.xml
View file @
19cea224
...
...
@@ -24,6 +24,13 @@
<artifactId>
liquidnet-service-dragon-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.github.wechatpay-apiv3
</groupId>
<artifactId>
wechatpay-apache-httpclient
</artifactId>
<version>
0.2.2
</version>
</dependency>
</dependencies>
<build>
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/PayController.java
View file @
19cea224
...
...
@@ -15,11 +15,4 @@ public class PayController {
@Autowired
IDragonOrdersService
dragonOrdersService
;
@PostMapping
(
"pre"
)
@ApiOperation
(
"发送测试redis"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
String
>
checkCanOrder
()
{
dragonOrdersService
.
sendRedisQueue
();
return
ResponseDto
.
success
();
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/RefundController.java
View file @
19cea224
package
com
.
liquidnet
.
service
.
dragon
.
controller
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.service.IDragonOrderRefundsService
;
import
com.liquidnet.service.dragon.utils.PayUtils
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.ByteArrayOutputStream
;
@RestController
@RequestMapping
(
"refund"
)
public
class
RefundController
{
...
...
@@ -16,8 +25,8 @@ public class RefundController {
@Autowired
IDragonOrderRefundsService
orderRefundsService
;
@PostMapping
(
"pre"
)
@ApiOperation
(
"发送测试redis"
)
@PostMapping
(
"pre
Test
"
)
@ApiOperation
(
"发送测试
退款
redis"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
String
>
checkCanOrder
()
{
orderRefundsService
.
sendRedisQueue
();
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
19cea224
package
com
.
liquidnet
.
service
.
dragon
.
service
.
impl
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.service.IDragonOrderRefundsService
;
import
com.liquidnet.service.dragon.utils.PayUtils
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.connection.stream.MapRecord
;
import
org.springframework.data.redis.connection.stream.StreamRecords
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.io.ByteArrayOutputStream
;
import
java.util.HashMap
;
@Service
...
...
@@ -17,11 +26,43 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
@Override
public
void
sendRedisQueue
()
{
// try {
// HashMap<String ,String> map = new HashMap<>();
// map.put("message","测试 redis 订阅信息1");
// MapRecord<String, String, String> record = StreamRecords.mapBacked(map).withStreamKey("dragon-refund");
// stringRedisTemplate.opsForStream().add(record);
// }catch (Exception e){
// e.printStackTrace();
// }
try
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"message"
,
"测试 redis 订阅信息1"
);
MapRecord
<
String
,
String
,
String
>
record
=
StreamRecords
.
mapBacked
(
map
).
withStreamKey
(
"dragon-refund"
);
stringRedisTemplate
.
opsForStream
().
add
(
record
);
PayUtils
payUtils
=
new
PayUtils
();
HttpPost
httpPost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi"
);
httpPost
.
addHeader
(
"Accept"
,
"application/json"
);
httpPost
.
addHeader
(
"Content-type"
,
"application/json; charset=utf-8"
);
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectNode
rootNode
=
objectMapper
.
createObjectNode
();
rootNode
.
put
(
"mchid"
,
"1551961491"
)
.
put
(
"appid"
,
"wx3498304dda39c5a1"
)
.
put
(
"description"
,
"Image形象店-深圳腾大-QQ公仔"
)
.
put
(
"notify_url"
,
"https://www.weixin.qq.com/wxpay/pay.php"
)
.
put
(
"out_trade_no"
,
"1217752501201407033233368018"
);
rootNode
.
putObject
(
"amount"
)
.
put
(
"total"
,
1
);
rootNode
.
putObject
(
"payer"
)
.
put
(
"openid"
,
"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
);
objectMapper
.
writeValue
(
bos
,
rootNode
);
httpPost
.
setEntity
(
new
StringEntity
(
bos
.
toString
(
"UTF-8"
),
"UTF-8"
));
CloseableHttpResponse
response
=
payUtils
.
getHttpClient
().
execute
(
httpPost
);
String
bodyAsString
=
EntityUtils
.
toString
(
response
.
getEntity
());
System
.
out
.
println
(
bodyAsString
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/PayUtils.java
0 → 100644
View file @
19cea224
package
com
.
liquidnet
.
service
.
dragon
.
utils
;
import
com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder
;
import
com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier
;
import
com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner
;
import
com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Credentials
;
import
com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Validator
;
import
com.wechat.pay.contrib.apache.httpclient.util.PemUtil
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.utils.URIBuilder
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.util.EntityUtils
;
import
java.security.PrivateKey
;
import
java.util.Objects
;
public
class
PayUtils
{
private
String
merchantId
=
"1551961491"
;
private
String
merchantSerialNumber
=
"6D25ECC819EAE0BCEA7DB18F143F0752431D9295"
;
// private static PayUtils instance = new PayUtils();
private
CloseableHttpClient
httpClient
;
private
String
openId
=
"wx3498304dda39c5a1"
;
public
PayUtils
()
{
try
{
PrivateKey
merchantPrivateKey
=
PemUtil
.
loadPrivateKey
(
Objects
.
requireNonNull
(
PayUtils
.
class
.
getClassLoader
().
getResourceAsStream
(
"wepay_apiclient_key.pem"
))
);
CloseableHttpClient
httpClientTemp
=
WechatPayHttpClientBuilder
.
create
()
.
withMerchant
(
merchantId
,
merchantSerialNumber
,
merchantPrivateKey
)
.
withValidator
(
response
->
true
)
// NOTE: 设置一个空的应答签名验证器,**不要**用在业务请求
.
build
();
URIBuilder
uriBuilder
=
new
URIBuilder
(
"https://api.mch.weixin.qq.com/v3/certificates"
);
HttpGet
httpGet
=
new
HttpGet
(
uriBuilder
.
build
());
httpGet
.
addHeader
(
"Accept"
,
"application/json"
);
CloseableHttpResponse
response
=
httpClientTemp
.
execute
(
httpGet
);
String
bodyAsString
=
EntityUtils
.
toString
(
response
.
getEntity
());
AutoUpdateCertificatesVerifier
verifier
=
new
AutoUpdateCertificatesVerifier
(
new
WechatPay2Credentials
(
merchantId
,
new
PrivateKeySigner
(
merchantSerialNumber
,
merchantPrivateKey
)),
bodyAsString
.
getBytes
(
"utf-8"
));
WechatPayHttpClientBuilder
builder
=
WechatPayHttpClientBuilder
.
create
()
.
withMerchant
(
merchantId
,
merchantSerialNumber
,
merchantPrivateKey
)
.
withValidator
(
new
WechatPay2Validator
(
verifier
));
httpClient
=
builder
.
build
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
// private static PayUtils getInstance() {
// return instance;
// }
public
CloseableHttpClient
getHttpClient
()
{
return
httpClient
;
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/TestUtils.java
deleted
100644 → 0
View file @
dba5bca3
package
com
.
liquidnet
.
service
.
dragon
.
utils
;
public
class
TestUtils
{
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/resources/payCert/wepay/wepay_apiclient_cert.pem
0 → 100644
View file @
19cea224
-----BEGIN CERTIFICATE-----
MIID+TCCAuGgAwIBAgIUbSXsyBnq4LzqfbGPFD8HUkMdkpUwDQYJKoZIhvcNAQEL
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
Q0EwHhcNMTkwODIxMDczOTE3WhcNMjQwODE5MDczOTE3WjCBijETMBEGA1UEAwwK
MTU1MTk2MTQ5MTEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTYwNAYDVQQL
DC3ljJfkuqzmraPlnKjmmKDnlLvkupLogZTnvZHnp5HmioDmnInpmZDlhazlj7gx
CzAJBgNVBAYMAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEB
BQADggEPADCCAQoCggEBAO+ZZzoLW7wEFuwFSHnBYpBi0QHcs4aCgIO7GaAxdztA
KDFsuUuu45GX5rla4O9QfeW9xut9jT6LlEIAPXczZ8Ne3b/xf/kOErGAuaCjHkO1
m4EOf8H/y4uu7Dwgousmf51HDvPFjpkk8QMJ1sf4CTQFIzeXFHXAuBxvt16OdQnJ
LDUz/XuuZTqWUROuPfJh8FV/PhfA3ZRKT5qa4EuGSamesR/tYH0+TYzBYkSTdCHd
PxTrhTAn4UUluWBCB1juK7cgB6Gv2lq8gTVVB/N1QNHBxJ8GKNPDiHHNBEI97KGr
nFHl4uYhtPxXB19PB9B/Io3ITiHIWmFGgnJHqa1myOcCAwEAAaOBgTB/MAkGA1Ud
EwQCMAAwCwYDVR0PBAQDAgTwMGUGA1UdHwReMFwwWqBYoFaGVGh0dHA6Ly9ldmNh
Lml0cnVzLmNvbS5jbi9wdWJsaWMvaXRydXNjcmw/Q0E9MUJENDIyMEU1MERCQzA0
QjA2QUQzOTc1NDk4NDZDMDFDM0U4RUJEMjANBgkqhkiG9w0BAQsFAAOCAQEAfWQf
0u9iwj/7Om0GxQZgcZ2xdzn3b2M6ftAFJA66XnOsq3OVCIYu36OEt7AVJanfHFp0
dDKijvhrWgkwxVnzuuDZ4+GHfKa3z6r+XkDoaKv/1MPa9X8HMtrFSNCBiYiRzSBQ
nJrYBt05NbVkG68nnpfHqTnE5ffRNQz0dvOGZBf9ddx52wTbkO9OMlYWlcSZWT6E
grhOVeuwmL6MX+0kpNs8BGAOQbSZXJNfdvl/L2NgwGaL3sTR7HzDegwkq6lhdgfN
WQCQP43tRm7fM69viPZjlwi/Dt3hVlq7p8vuur+n5pPRR4EhC01CzbQQ2MMZC1bi
z4iu9HJAOme5K9M2Nw==
-----END CERTIFICATE-----
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/resources/payCert/wepay/wepay_apiclient_key.pem
0 → 100644
View file @
19cea224
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDvmWc6C1u8BBbs
BUh5wWKQYtEB3LOGgoCDuxmgMXc7QCgxbLlLruORl+a5WuDvUH3lvcbrfY0+i5RC
AD13M2fDXt2/8X/5DhKxgLmgox5DtZuBDn/B/8uLruw8IKLrJn+dRw7zxY6ZJPED
CdbH+Ak0BSM3lxR1wLgcb7dejnUJySw1M/17rmU6llETrj3yYfBVfz4XwN2USk+a
muBLhkmpnrEf7WB9Pk2MwWJEk3Qh3T8U64UwJ+FFJblg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H52l/BYQleEAXcntb9kJbuoLyJatstg5ky4uWNm9NQXJ8t
3BwuM91ztqKMwnYTNeDtOiazoGPm4F2d2m7xv7nCSwKBgQCFFGkqgh7Z8vzlTxHM
LBD/xN39zI5pr/28p6r6V+uOhplC7j0eJ1JaiKAXSP3gP/ZnChW3DiPlkep7nHg7
p4f+GHqKmBF0UsacwMJERa2lwE+fPsuN4ILTo0Iuiy/hQJx3GduMYlw+ngAuIDPB
vmE8c9N3rQJ0bm8TM5oqiXka9A==
-----END PRIVATE KEY-----
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