Skip to content
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

错误代码:-99, 错误信息:平台签名验证错误 #2714 #2761

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public BindAccountResponse getBindAccount() throws WxErrorException {
*/
@Override
public AddOrderResponse addOrder(final AddOrderRequest request) throws WxErrorException {
request.getDeliverySign();
return this.parse(this.wxMaService.post(WxMaApiUrlConstants.InstantDelivery.PlaceAnOrder.ADD_ORDER, request),
AddOrderResponse.class);
}
Expand All @@ -115,6 +116,7 @@ public AddOrderResponse addOrder(final AddOrderRequest request) throws WxErrorEx
*/
@Override
public GetOrderResponse getOrder(final GetOrderRequest request) throws WxErrorException {
request.getDeliverySign();
return this.parse(this.wxMaService.post(WxMaApiUrlConstants.InstantDelivery.GET_ORDER, request),
GetOrderResponse.class);
}
Expand All @@ -131,6 +133,7 @@ public GetOrderResponse getOrder(final GetOrderRequest request) throws WxErrorEx
*/
@Override
public CancelOrderResponse cancelOrder(final CancelOrderRequest request) throws WxErrorException {
request.getDeliverySign();
return this.parse(this.wxMaService.post(WxMaApiUrlConstants.InstantDelivery.Cancel.CANCEL_ORDER, request),
CancelOrderResponse.class);
}
Expand All @@ -147,6 +150,7 @@ public CancelOrderResponse cancelOrder(final CancelOrderRequest request) throws
*/
@Override
public AbnormalConfirmResponse abnormalConfirm(final AbnormalConfirmRequest request) throws WxErrorException {
request.getDeliverySign();
return this.parse(this.wxMaService.post(WxMaApiUrlConstants.InstantDelivery.Cancel.ABNORMAL_CONFIRM, request),
AbnormalConfirmResponse.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public String getDeliverySign() {
str = str.concat(getShopOrderId());
}
str = str.concat(getAppSecret());
return DigestUtils.sha1Hex(str);
this.deliverySign = DigestUtils.sha1Hex(str);
return this.deliverySign;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cn.binarywang.wx.miniapp.test;

import cn.binarywang.wx.miniapp.bean.delivery.AddOrderRequest;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import org.testng.annotations.Test;

public class AddOrderJsonTest {

/**
* 验证转化Json时是否有deliverySign
*/
@Test
public void test(){
AddOrderRequest request = new AddOrderRequest();
request.setShopId("1");
request.setAppSecret("2");
request.getDeliverySign();
System.out.printf(WxGsonBuilder.create().toJson(request));
}
}