File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,21 @@ public class WxEntrustPapServiceImpl implements WxEntrustPapService {
27
27
28
28
@ Override
29
29
public String mpSign (WxMpEntrustRequest wxMpEntrustRequest ) throws WxPayException {
30
+ wxMpEntrustRequest .checkAndSign (payService .getConfig ());
30
31
StringBuilder signStrTemp = new StringBuilder (payService .getPayBaseUrl () + "/papay/entrustweb" );
31
32
signStrTemp .append ("?appid=" ).append (wxMpEntrustRequest .getAppid ());
32
33
signStrTemp .append ("&contract_code=" ).append (wxMpEntrustRequest .getContractCode ());
33
34
signStrTemp .append ("&contract_display_account=" ).append (URLEncoder .encode (wxMpEntrustRequest .getContractDisplayAccount ()));
34
35
signStrTemp .append ("&mch_id=" ).append (wxMpEntrustRequest .getMchId ()).append ("¬ify_url=" ).append (URLEncoder .encode (wxMpEntrustRequest .getNotifyUrl ()));
35
- signStrTemp .append ("&plan_id=" ).append (wxMpEntrustRequest .getPlanId ()). append ( "&outerid=" ). append ( URLEncoder . encode ( wxMpEntrustRequest . getOuterId ())) ;
36
+ signStrTemp .append ("&plan_id=" ).append (wxMpEntrustRequest .getPlanId ());
36
37
signStrTemp .append ("&request_serial=" ).append (wxMpEntrustRequest .getRequestSerial ()).append ("×tamp=" ).append (wxMpEntrustRequest .getTimestamp ());
37
- signStrTemp .append ("&version=" ).append (wxMpEntrustRequest .getVersion ()).append ("&return_web=" ).append (wxMpEntrustRequest .getReturnWeb ()).append ("&sign=" ).append (wxMpEntrustRequest .getSign ());
38
-
38
+ if (StringUtils .isNotEmpty (wxMpEntrustRequest .getReturnWeb ())) {
39
+ signStrTemp .append ("&return_web=" ).append (wxMpEntrustRequest .getReturnWeb ());
40
+ }
41
+ if (StringUtils .isNotEmpty (wxMpEntrustRequest .getOuterId ())) {
42
+ signStrTemp .append ("&outerid=" ).append (URLEncoder .encode (wxMpEntrustRequest .getOuterId ()));
43
+ }
44
+ signStrTemp .append ("&version=" ).append (wxMpEntrustRequest .getVersion ()).append ("&sign=" ).append (wxMpEntrustRequest .getSign ());
39
45
return signStrTemp .toString ();
40
46
}
41
47
You can’t perform that action at this time.
0 commit comments