Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
d8a2b56d
Commit
d8a2b56d
authored
Jan 13, 2022
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周周惠
parent
7941f5bf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
20 deletions
+40
-20
order-application-service/pom.xml
+1
-1
order-application-service/src/main/java/cn/freemud/entities/vo/order/PaymentConfigVo.java
+4
-2
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
+2
-2
order-application-service/src/main/java/cn/freemud/service/impl/PayServiceImpl.java
+32
-14
order-application-service/src/main/java/cn/freemud/utils/HMacSHA256.java
+1
-1
No files found.
order-application-service/pom.xml
View file @
d8a2b56d
...
...
@@ -147,7 +147,7 @@
<dependency>
<artifactId>
assortment-data-manager
</artifactId>
<groupId>
com.freemud.sdk.api.assortment
</groupId>
<version>
5.5.
31
-RELEASE
</version>
<version>
5.5.
40
-RELEASE
</version>
</dependency>
<dependency>
<groupId>
cn.freemud.commons
</groupId>
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/order/PaymentConfigVo.java
View file @
d8a2b56d
...
...
@@ -16,11 +16,13 @@ public class PaymentConfigVo {
@NotEmpty
(
message
=
"商户号不能为空"
)
private
String
partnerId
;
@ApiModelProperty
(
"门店号"
)
private
String
storeId
;
/**
* 插件类型 1=爱心餐 2= 周周惠
*/
@ApiModelProperty
(
"插件类型 1=爱心餐
2= 周周惠"
)
@ApiModelProperty
(
"插件类型 1=爱心餐
2= 周周惠"
)
private
Integer
plugInType
;
}
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
View file @
d8a2b56d
...
...
@@ -390,11 +390,11 @@ public class OrderAdapterServiceImpl {
}
//周周惠插件要返回参数
if
(
paymentConfigVo
.
getPlugInType
()
!=
null
&&
paymentConfigVo
.
getPlugInType
()
==
2
){
return
ResponseUtil
.
success
(
payService
.
getP
aymentAuth
(
paymentConfigVo
.
getPartnerId
(),
assortmentCustomerInfoVo
.
getWxApp
Id
()));
return
ResponseUtil
.
success
(
payService
.
getP
lugInParameter
(
paymentConfigVo
.
getPartnerId
(),
assortmentCustomerInfoVo
.
getWxAppId
(),
paymentConfigVo
.
getStore
Id
()));
}
//1元插件要返回参数
return
ResponseUtil
.
success
(
payService
.
getP
aymentAuth
(
paymentConfigVo
.
getPartnerId
(),
assortmentCustomerInfoVo
.
getWxAppId
()));
return
ResponseUtil
.
success
(
payService
.
getP
lugInParameter
(
paymentConfigVo
.
getPartnerId
(),
assortmentCustomerInfoVo
.
getWxAppId
()));
}
...
...
order-application-service/src/main/java/cn/freemud/service/impl/PayServiceImpl.java
View file @
d8a2b56d
...
...
@@ -36,10 +36,7 @@ import cn.freemud.service.thirdparty.ComPayClient;
import
cn.freemud.service.thirdparty.PaymentNewClient
;
import
cn.freemud.service.thirdparty.SvcAppClient
;
import
cn.freemud.service.thirdparty.SvcComPayClient
;
import
cn.freemud.utils.AppLogUtil
;
import
cn.freemud.utils.RedisUtil
;
import
cn.freemud.utils.ResponseUtil
;
import
cn.freemud.utils.ValidationCode
;
import
cn.freemud.utils.*
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.api.assortment.datamanager.entity.db.*
;
...
...
@@ -1278,12 +1275,12 @@ public class PayServiceImpl {
/**
* 1元捐插件需要参数
*/
public
PlugInParameter
getP
aymentAuth
(
String
partnerId
,
String
appId
)
{
public
PlugInParameter
getP
lugInParameter
(
String
partnerId
,
String
appId
)
{
PlugInParameter
plugInParameter
=
new
PlugInParameter
();
List
<
AssortmentOpenPlatformPartnerPaymentConfig
>
openPlatformPartnerPayment
Auth
s
=
openPlatformPartnerPaymentConfigManager
.
queryPartnerPaymentConfigs
(
partnerId
,
appId
);
if
(
CollectionUtils
.
isNotEmpty
(
openPlatformPartnerPayment
Auth
s
))
{
plugInParameter
.
setMchCode
(
openPlatformPartnerPayment
Auth
s
.
get
(
0
).
getUnitMchId
());
plugInParameter
.
setSubMchCode
(
openPlatformPartnerPayment
Auth
s
.
get
(
0
).
getSubMchid
());
List
<
AssortmentOpenPlatformPartnerPaymentConfig
>
openPlatformPartnerPayment
Config
s
=
openPlatformPartnerPaymentConfigManager
.
queryPartnerPaymentConfigs
(
partnerId
,
appId
);
if
(
CollectionUtils
.
isNotEmpty
(
openPlatformPartnerPayment
Config
s
))
{
plugInParameter
.
setMchCode
(
openPlatformPartnerPayment
Config
s
.
get
(
0
).
getUnitMchId
());
plugInParameter
.
setSubMchCode
(
openPlatformPartnerPayment
Config
s
.
get
(
0
).
getSubMchid
());
}
return
plugInParameter
;
}
...
...
@@ -1291,13 +1288,34 @@ public class PayServiceImpl {
/**
* 周周惠插件需要参数
*/
public
PlugInParameter
getP
aymentAuth2
(
String
partnerId
,
String
app
Id
)
{
public
PlugInParameter
getP
lugInParameter
(
String
partnerId
,
String
appId
,
String
store
Id
)
{
PlugInParameter
plugInParameter
=
new
PlugInParameter
();
List
<
AssortmentOpenPlatformPartnerPaymentConfig
>
openPlatformPartnerPaymentAuths
=
openPlatformPartnerPaymentConfigManager
.
queryPartnerPaymentConfigs
(
partnerId
,
appId
);
if
(
CollectionUtils
.
isNotEmpty
(
openPlatformPartnerPaymentAuths
))
{
plugInParameter
.
setMchCode
(
openPlatformPartnerPaymentAuths
.
get
(
0
).
getUnitMchId
());
plugInParameter
.
setSubMchCode
(
openPlatformPartnerPaymentAuths
.
get
(
0
).
getSubMchid
());
List
<
AssortmentOpenPlatformPartnerPaymentConfig
>
openPlatformPartnerPaymentConfigs
=
openPlatformPartnerPaymentConfigManager
.
queryPartnerPaymentConfigs
(
partnerId
,
appId
);
if
(
CollectionUtils
.
isEmpty
(
openPlatformPartnerPaymentConfigs
))
{
return
plugInParameter
;
}
AssortmentOpenPlatformPaymentStore
assortmentOpenPlatformPaymentStore
=
openPlatformPartnerPaymentConfigManager
.
queryPPlatformPaymentStore
(
openPlatformPartnerPaymentConfigs
.
get
(
0
).
getId
().
toString
(),
storeId
);
if
(
assortmentOpenPlatformPaymentStore
==
null
||
assortmentOpenPlatformPaymentStore
.
getStatus
()
!=
1
)
{
return
plugInParameter
;
}
AssortmentOpenPlatformPartnerPaymentAuth
assortmentOpenPlatformPartnerPaymentAuth
=
openPlatformPartnerPaymentConfigManager
.
queryPartnerPaymentAuth
(
openPlatformPartnerPaymentConfigs
.
get
(
0
).
getAuthId
());
if
(
assortmentOpenPlatformPartnerPaymentAuth
==
null
)
{
return
plugInParameter
;
}
String
applyMchid
=
assortmentOpenPlatformPartnerPaymentAuth
.
getSp_mchid
();
String
signMchid
=
openPlatformPartnerPaymentConfigs
.
get
(
0
).
getSubMchid
();
String
thirdStoreId
=
assortmentOpenPlatformPaymentStore
.
getThirdStoreId
();
plugInParameter
.
setApplyMchid
(
applyMchid
);
plugInParameter
.
setSignMchid
(
signMchid
);
plugInParameter
.
setStoreId
(
thirdStoreId
);
String
message
=
"apply_mchid="
+
applyMchid
+
"&sign_mchid="
+
signMchid
+
"&store_id="
+
thirdStoreId
;
String
sign
=
HMacSHA256
.
encrypt
(
message
,
assortmentOpenPlatformPartnerPaymentAuth
.
getPrivate_key
());
plugInParameter
.
setSign
(
sign
);
return
plugInParameter
;
}
...
...
order-application-service/src/main/java/cn/freemud/utils/HMacSHA256.java
View file @
d8a2b56d
...
...
@@ -13,7 +13,7 @@ public class HMacSHA256 {
* @param secret 私钥
* @return 加密后字符串
*/
p
rivate
static
String
encrypt
(
String
message
,
String
secret
)
{
p
ublic
static
String
encrypt
(
String
message
,
String
secret
)
{
String
hash
=
""
;
try
{
Mac
sha256_HMAC
=
Mac
.
getInstance
(
"HmacSHA256"
);
...
...
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