|
@@ -17,31 +17,31 @@ public class TopApi {
|
|
/**
|
|
/**
|
|
* 版本
|
|
* 版本
|
|
*/
|
|
*/
|
|
- private static final String VERSION = "v1.0";
|
|
|
|
|
|
+ public static final String VERSION = "v1.0";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 扫码支付
|
|
* 扫码支付
|
|
*/
|
|
*/
|
|
- private static final String SCAN_TO_PAY_URL = "https://interfacetest.allinpaygx.com/api/access/payInterface/usePaymentCode";
|
|
|
|
|
|
+ public static final String SCAN_TO_PAY_URL = "https://interfacetest.allinpaygx.com/api/access/payInterface/usePaymentCode";
|
|
/**
|
|
/**
|
|
* 交易查询
|
|
* 交易查询
|
|
*/
|
|
*/
|
|
- private static final String DEAL_SELECT = "https://interfacetest.allinpaygx.com/api/access/payInterface/findOrderInfo";
|
|
|
|
|
|
+ public static final String DEAL_SELECT = "https://interfacetest.allinpaygx.com/api/access/payInterface/findOrderInfo";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 商户编号
|
|
* 商户编号
|
|
*/
|
|
*/
|
|
- private static final String MERCHANT_NO = "121050000103";
|
|
|
|
|
|
+ public static final String MERCHANT_NO = "121050000103";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 密钥
|
|
* 密钥
|
|
*/
|
|
*/
|
|
- private static final String SECRET = "0341dff192f644b5892338f0d964a6b2";
|
|
|
|
|
|
+ public static final String SECRET = "0341dff192f644b5892338f0d964a6b2";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 回调url
|
|
* 回调url
|
|
*/
|
|
*/
|
|
- private static final String SCAN_NOTIFY_URL = "https://wx.ewoogi.com/dxapi/test";
|
|
|
|
|
|
+ public static final String SCAN_NOTIFY_URL = "https://wx.ewoogi.com/dxapi/test";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -117,6 +117,12 @@ public class TopApi {
|
|
}
|
|
}
|
|
|
|
|
|
public static String generateApiCommon(TreeMap<String, String> params,String url){
|
|
public static String generateApiCommon(TreeMap<String, String> params,String url){
|
|
|
|
+ return String.format("%s?%s&sign=%s",url,
|
|
|
|
+ joinParam(params),
|
|
|
|
+ signData(params));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static String joinParam(TreeMap<String, String> params){
|
|
StringBuilder buf = new StringBuilder();
|
|
StringBuilder buf = new StringBuilder();
|
|
for (Map.Entry<String, String> entry : params.entrySet()) {
|
|
for (Map.Entry<String, String> entry : params.entrySet()) {
|
|
if (!StringUtils.isBlank(entry.getValue()) && !"sign".equals(entry.getKey())) {
|
|
if (!StringUtils.isBlank(entry.getValue()) && !"sign".equals(entry.getKey())) {
|
|
@@ -124,10 +130,7 @@ public class TopApi {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
String changeBuf = buf.toString();
|
|
String changeBuf = buf.toString();
|
|
- String substring = changeBuf.substring(0, changeBuf.length() - 1);
|
|
|
|
- return String.format("%s?%s&sign=%s",url,
|
|
|
|
- substring,
|
|
|
|
- signData(params));
|
|
|
|
|
|
+ return changeBuf.substring(0, changeBuf.length() - 1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|