File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 10
10
import lombok .RequiredArgsConstructor ;
11
11
import lombok .extern .slf4j .Slf4j ;
12
12
import me .chanjar .weixin .common .util .json .WxGsonBuilder ;
13
+ import org .apache .commons .lang3 .StringUtils ;
13
14
14
15
import java .net .URLEncoder ;
15
16
@@ -65,8 +66,13 @@ public WxH5EntrustResult h5Sign(WxH5EntrustRequest wxH5EntrustRequest) throws Wx
65
66
strBuilder .append ("&contract_code=" ).append (wxH5EntrustRequest .getContractCode ());
66
67
strBuilder .append ("&contract_display_account=" ).append (URLEncoder .encode (wxH5EntrustRequest .getContractDisplayAccount ()));
67
68
strBuilder .append ("&mch_id=" ).append (wxH5EntrustRequest .getMchId ()).append ("¬ify_url=" ).append (URLEncoder .encode (wxH5EntrustRequest .getNotifyUrl ()));
68
- strBuilder .append ("&plan_id=" ).append (wxH5EntrustRequest .getPlanId ()).append ("&outerid=" ).append (URLEncoder .encode (wxH5EntrustRequest .getOuterId ()));
69
- strBuilder .append ("&return_appid=" ).append (wxH5EntrustRequest .getReturnAppid ());
69
+ strBuilder .append ("&plan_id=" ).append (wxH5EntrustRequest .getPlanId ());
70
+ if (StringUtils .isNotEmpty (wxH5EntrustRequest .getOuterId ())) {
71
+ strBuilder .append ("&outerid=" ).append (URLEncoder .encode (wxH5EntrustRequest .getOuterId ()));
72
+ }
73
+ if (StringUtils .isNotEmpty (wxH5EntrustRequest .getReturnAppid ())) {
74
+ strBuilder .append ("&return_appid=" ).append (wxH5EntrustRequest .getReturnAppid ());
75
+ }
70
76
strBuilder .append ("&clientip=" ).append (wxH5EntrustRequest .getClientIp ());
71
77
strBuilder .append ("&request_serial=" ).append (wxH5EntrustRequest .getRequestSerial ()).append ("×tamp=" ).append (wxH5EntrustRequest .getTimestamp ());
72
78
strBuilder .append ("&version=" ).append (wxH5EntrustRequest .getVersion ()).append ("&sign=" ).append (sign );
You can’t perform that action at this time.
0 commit comments