-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
优化服务商模式下下单代码,去掉部分重复代码 #3070
优化服务商模式下下单代码,去掉部分重复代码 #3070
Changes from all commits
e73b1ba
af13bb7
84591b1
18bbbdd
c4f0a4a
ebcc0a2
6964eac
845dcd2
e603fe9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,7 +10,6 @@ | |||||||||
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult; | ||||||||||
import com.github.binarywang.wxpay.bean.request.*; | ||||||||||
import com.github.binarywang.wxpay.bean.result.*; | ||||||||||
import com.github.binarywang.wxpay.bean.result.enums.PartnerTradeTypeEnum; | ||||||||||
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum; | ||||||||||
import com.github.binarywang.wxpay.config.WxPayConfig; | ||||||||||
import com.github.binarywang.wxpay.config.WxPayConfigHolder; | ||||||||||
|
@@ -712,15 +711,15 @@ public <T> T createOrderV3(TradeTypeEnum tradeType, WxPayUnifiedOrderV3Request r | |||||||||
} | ||||||||||
|
||||||||||
@Override | ||||||||||
public <T> T createPartnerOrderV3(PartnerTradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException { | ||||||||||
public <T> T createPartnerOrderV3(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException { | ||||||||||
WxPayUnifiedOrderV3Result result = this.unifiedPartnerOrderV3(tradeType, request); | ||||||||||
//获取应用ID | ||||||||||
String appId = StringUtils.isBlank(request.getSubAppid()) ? request.getSpAppid() : request.getSubAppid(); | ||||||||||
return result.getPayInfo(tradeType.getDirectConnTrade(), appId, request.getSubMchId(), this.getConfig().getPrivateKey()); | ||||||||||
return result.getPayInfo(tradeType, appId, request.getSubMchId(), this.getConfig().getPrivateKey()); | ||||||||||
} | ||||||||||
|
||||||||||
@Override | ||||||||||
public WxPayUnifiedOrderV3Result unifiedPartnerOrderV3(PartnerTradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException { | ||||||||||
public WxPayUnifiedOrderV3Result unifiedPartnerOrderV3(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException { | ||||||||||
if (StringUtils.isBlank(request.getSpAppid())) { | ||||||||||
request.setSpAppid(this.getConfig().getAppId()); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method ℹ️ Expand to see all @sonatype-lift commandsYou can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Note: When talking to LiftBot, you need to refresh the page to see its response. |
||||||||||
} | ||||||||||
|
@@ -741,7 +740,7 @@ public WxPayUnifiedOrderV3Result unifiedPartnerOrderV3(PartnerTradeTypeEnum trad | |||||||||
request.setSubMchId(this.getConfig().getSubMchId()); | ||||||||||
} | ||||||||||
|
||||||||||
String url = this.getPayBaseUrl() + tradeType.getPartnerUrl(); | ||||||||||
String url = this.getPayBaseUrl() + tradeType.getBasePartnerUrl(); | ||||||||||
String response = this.postV3(url, GSON.toJson(request)); | ||||||||||
return GSON.fromJson(response, WxPayUnifiedOrderV3Result.class); | ||||||||||
} | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method
BaseWxPayServiceImpl.createPartnerOrderV3(...)
indirectly reads without synchronization fromthis.configMap
. Potentially races with write in methodBaseWxPayServiceImpl.addConfig(...)
.Reporting because another access to the same memory occurs on a background thread, although this access may not.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
@sonatype-lift ignore
@sonatype-lift ignoreall
@sonatype-lift exclude <file|issue|path|tool>
file|issue|path|tool
from Lift findings by updating your config.toml fileNote: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.