|
1 | 1 | package me.chanjar.weixin.mp.api; |
2 | 2 |
|
3 | | -import com.google.gson.JsonArray; |
4 | | -import com.google.gson.JsonElement; |
5 | | -import com.google.gson.JsonObject; |
6 | | -import com.google.gson.internal.Streams; |
7 | | -import com.google.gson.reflect.TypeToken; |
8 | | -import com.google.gson.stream.JsonReader; |
9 | | -import com.thoughtworks.xstream.XStream; |
| 3 | +import java.io.File; |
| 4 | +import java.io.IOException; |
| 5 | +import java.io.InputStream; |
| 6 | +import java.io.StringReader; |
| 7 | +import java.security.NoSuchAlgorithmException; |
| 8 | +import java.util.ArrayList; |
| 9 | +import java.util.Collections; |
| 10 | +import java.util.Date; |
| 11 | +import java.util.HashMap; |
| 12 | +import java.util.List; |
| 13 | +import java.util.Map; |
| 14 | +import java.util.SortedMap; |
| 15 | +import java.util.TreeMap; |
| 16 | +import java.util.UUID; |
| 17 | + |
10 | 18 | import me.chanjar.weixin.common.api.WxConsts; |
11 | 19 | import me.chanjar.weixin.common.bean.WxAccessToken; |
12 | 20 | import me.chanjar.weixin.common.bean.WxJsapiSignature; |
|
21 | 29 | import me.chanjar.weixin.common.util.crypto.SHA1; |
22 | 30 | import me.chanjar.weixin.common.util.crypto.WxCryptUtil; |
23 | 31 | import me.chanjar.weixin.common.util.fs.FileUtils; |
24 | | -import me.chanjar.weixin.common.util.http.*; |
| 32 | +import me.chanjar.weixin.common.util.http.MediaDownloadRequestExecutor; |
| 33 | +import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor; |
| 34 | +import me.chanjar.weixin.common.util.http.RequestExecutor; |
| 35 | +import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor; |
| 36 | +import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor; |
| 37 | +import me.chanjar.weixin.common.util.http.URIUtil; |
| 38 | +import me.chanjar.weixin.common.util.http.Utf8ResponseHandler; |
25 | 39 | import me.chanjar.weixin.common.util.json.GsonHelper; |
26 | 40 | import me.chanjar.weixin.common.util.json.WxGsonBuilder; |
27 | 41 | import me.chanjar.weixin.common.util.xml.XStreamInitializer; |
28 | | -import me.chanjar.weixin.mp.bean.*; |
29 | | -import me.chanjar.weixin.mp.bean.result.*; |
30 | | -import me.chanjar.weixin.mp.util.http.*; |
| 42 | +import me.chanjar.weixin.mp.bean.WxMpCustomMessage; |
| 43 | +import me.chanjar.weixin.mp.bean.WxMpGroup; |
| 44 | +import me.chanjar.weixin.mp.bean.WxMpMassGroupMessage; |
| 45 | +import me.chanjar.weixin.mp.bean.WxMpMassNews; |
| 46 | +import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage; |
| 47 | +import me.chanjar.weixin.mp.bean.WxMpMassVideo; |
| 48 | +import me.chanjar.weixin.mp.bean.WxMpMaterial; |
| 49 | +import me.chanjar.weixin.mp.bean.WxMpMaterialArticleUpdate; |
| 50 | +import me.chanjar.weixin.mp.bean.WxMpMaterialNews; |
| 51 | +import me.chanjar.weixin.mp.bean.WxMpSemanticQuery; |
| 52 | +import me.chanjar.weixin.mp.bean.WxMpTemplateMessage; |
| 53 | +import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult; |
| 54 | +import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult; |
| 55 | +import me.chanjar.weixin.mp.bean.result.WxMpMaterialCountResult; |
| 56 | +import me.chanjar.weixin.mp.bean.result.WxMpMaterialFileBatchGetResult; |
| 57 | +import me.chanjar.weixin.mp.bean.result.WxMpMaterialNewsBatchGetResult; |
| 58 | +import me.chanjar.weixin.mp.bean.result.WxMpMaterialUploadResult; |
| 59 | +import me.chanjar.weixin.mp.bean.result.WxMpMaterialVideoInfoResult; |
| 60 | +import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; |
| 61 | +import me.chanjar.weixin.mp.bean.result.WxMpPayCallback; |
| 62 | +import me.chanjar.weixin.mp.bean.result.WxMpPayResult; |
| 63 | +import me.chanjar.weixin.mp.bean.result.WxMpPrepayIdResult; |
| 64 | +import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket; |
| 65 | +import me.chanjar.weixin.mp.bean.result.WxMpSemanticQueryResult; |
| 66 | +import me.chanjar.weixin.mp.bean.result.WxMpUser; |
| 67 | +import me.chanjar.weixin.mp.bean.result.WxMpUserCumulate; |
| 68 | +import me.chanjar.weixin.mp.bean.result.WxMpUserList; |
| 69 | +import me.chanjar.weixin.mp.bean.result.WxMpUserSummary; |
| 70 | +import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor; |
| 71 | +import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor; |
| 72 | +import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor; |
| 73 | +import me.chanjar.weixin.mp.util.http.MaterialVideoInfoRequestExecutor; |
| 74 | +import me.chanjar.weixin.mp.util.http.MaterialVoiceAndImageDownloadRequestExecutor; |
| 75 | +import me.chanjar.weixin.mp.util.http.QrCodeRequestExecutor; |
31 | 76 | import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; |
| 77 | + |
| 78 | +import org.apache.commons.codec.digest.DigestUtils; |
32 | 79 | import org.apache.http.Consts; |
33 | 80 | import org.apache.http.HttpHost; |
34 | 81 | import org.apache.http.auth.AuthScope; |
|
47 | 94 | import org.slf4j.Logger; |
48 | 95 | import org.slf4j.LoggerFactory; |
49 | 96 |
|
50 | | -import java.io.File; |
51 | | -import java.io.IOException; |
52 | | -import java.io.InputStream; |
53 | | -import java.io.StringReader; |
54 | | -import java.security.NoSuchAlgorithmException; |
55 | | -import java.util.*; |
| 97 | +import com.google.gson.JsonArray; |
| 98 | +import com.google.gson.JsonElement; |
| 99 | +import com.google.gson.JsonObject; |
| 100 | +import com.google.gson.internal.Streams; |
| 101 | +import com.google.gson.reflect.TypeToken; |
| 102 | +import com.google.gson.stream.JsonReader; |
| 103 | +import com.thoughtworks.xstream.XStream; |
56 | 104 |
|
57 | 105 | public class WxMpServiceImpl implements WxMpService { |
58 | 106 |
|
@@ -796,7 +844,7 @@ public Map<String, String> getJSSDKPayInfo(String openId, String outTradeNo, dou |
796 | 844 | payInfo.put("signType", "MD5"); |
797 | 845 |
|
798 | 846 | String finalSign = WxCryptUtil.createSign(payInfo, wxMpConfigStorage.getPartnerKey()); |
799 | | - payInfo.put("sign", finalSign); |
| 847 | + payInfo.put("paySign", finalSign); |
800 | 848 | return payInfo; |
801 | 849 | } |
802 | 850 |
|
@@ -846,7 +894,7 @@ public WxMpPayResult getJSSDKPayResult(String transactionId, String outTradeNo) |
846 | 894 | public WxMpPayCallback getJSSDKCallbackData(String xmlData) { |
847 | 895 | try { |
848 | 896 | XStream xstream = XStreamInitializer.getInstance(); |
849 | | - xstream.alias("xml", WxMpPayResult.class); |
| 897 | + xstream.alias("xml", WxMpPayCallback.class); |
850 | 898 | WxMpPayCallback wxMpCallback = (WxMpPayCallback) xstream.fromXML(xmlData); |
851 | 899 | return wxMpCallback; |
852 | 900 | } catch (Exception e){ |
|
0 commit comments