更新maven说明
This commit is contained in:
parent
0017d2a06d
commit
ceb79b6f5a
24
README.md
24
README.md
@ -26,11 +26,31 @@ weixin4j
|
|||||||
|
|
||||||
2.API的成功调用依赖于正确的appid等数据,其填写格式在每个项目下的README.md文件中都有说明.
|
2.API的成功调用依赖于正确的appid等数据,其填写格式在每个项目下的README.md文件中都有说明.
|
||||||
|
|
||||||
3.在`weixin-4j`根目录执行`mvn package`命令得到jar包后,将`weixin4j-*-api-full`包或者`weixin4j-base`跟`weixin4j-*-api`引入到自己的工程.
|
3.在`weixin-4j`根目录执行`mvn package`命令得到jar包后,将`weixin4j-*-full`包或者`weixin4j-base`和`weixin4j-*-api`引入到自己的工程.
|
||||||
|
|
||||||
4.如需使用netty服务,则可以在相应的action中实现自己的业务处理,打包后放到`正确的目录`下解压`weixin-*-server-bin.zip`执行`sh startup.sh start`便可启动服务.
|
4.如需使用netty服务,则可以在相应的action中实现自己的业务处理,打包后放到`正确的目录`下解压`weixin-*-server-bin.zip`执行`sh startup.sh start`便可启动服务.
|
||||||
|
|
||||||
|
Maven
|
||||||
|
-----
|
||||||
|
微信公众平台API
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.foxinmy</groupId>
|
||||||
|
<artifactId>weixin4j-qy-api</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
微信企业号API
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.foxinmy</groupId>
|
||||||
|
<artifactId>weixin4j-qy-api</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
直接下载
|
||||||
|
|
||||||
|
https://github.com/foxinmy/weixin4j/releases/tag/1.0
|
||||||
|
|
||||||
更新LOG
|
更新LOG
|
||||||
-------
|
-------
|
||||||
* 2014-10-27
|
* 2014-10-27
|
||||||
|
|||||||
111
pom.xml
111
pom.xml
@ -2,9 +2,9 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j</artifactId>
|
<artifactId>weixin4j</artifactId>
|
||||||
<version>${weixin4j.version}</version>
|
<version>1.0</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>weixin4j</name>
|
<name>weixin4j</name>
|
||||||
<url>https://github.com/foxinmy/weixin4j</url>
|
<url>https://github.com/foxinmy/weixin4j</url>
|
||||||
@ -16,6 +16,11 @@
|
|||||||
<url>https://github.com/foxinmy/weixin4j/blob/master/LICENSE</url>
|
<url>https://github.com/foxinmy/weixin4j/blob/master/LICENSE</url>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
|
<scm>
|
||||||
|
<url>https://github.com/foxinmy/weixin4j</url>
|
||||||
|
<connection>scm:git:git://github.com/foxinmy/weixin4j.git</connection>
|
||||||
|
<developerConnection>scm:git:git@github.com:foxinmy/weixin4j.git</developerConnection>
|
||||||
|
</scm>
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
<email>hujinyuhao@163.com</email>
|
<email>hujinyuhao@163.com</email>
|
||||||
@ -34,10 +39,10 @@
|
|||||||
<module>weixin4j-qy</module>
|
<module>weixin4j-qy</module>
|
||||||
</modules>
|
</modules>
|
||||||
<properties>
|
<properties>
|
||||||
<weixin4j.version>1.0</weixin4j.version>
|
|
||||||
<weixin4j.base.version>1.0</weixin4j.base.version>
|
<weixin4j.base.version>1.0</weixin4j.base.version>
|
||||||
<weixin4j.mp.version>1.0</weixin4j.mp.version>
|
<weixin4j.mp.version>1.0</weixin4j.mp.version>
|
||||||
<weixin4j.qy.version>1.0</weixin4j.qy.version>
|
<weixin4j.qy.version>1.0</weixin4j.qy.version>
|
||||||
|
<jdk.version>1.7</jdk.version>
|
||||||
<junit.version>4.8.2</junit.version>
|
<junit.version>4.8.2</junit.version>
|
||||||
<dom4j.version>1.6.1</dom4j.version>
|
<dom4j.version>1.6.1</dom4j.version>
|
||||||
<logback.version>1.0.9</logback.version>
|
<logback.version>1.0.9</logback.version>
|
||||||
@ -61,42 +66,17 @@
|
|||||||
<maven.jar.plugin.version>2.5</maven.jar.plugin.version>
|
<maven.jar.plugin.version>2.5</maven.jar.plugin.version>
|
||||||
<maven.assembly.plugin.version>2.5.1</maven.assembly.plugin.version>
|
<maven.assembly.plugin.version>2.5.1</maven.assembly.plugin.version>
|
||||||
<maven.javadoc.plugin.version>2.10.1</maven.javadoc.plugin.version>
|
<maven.javadoc.plugin.version>2.10.1</maven.javadoc.plugin.version>
|
||||||
|
<maven.gpg.plugin.version>1.5</maven.gpg.plugin.version>
|
||||||
</properties>
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>${maven.source.plugin.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>${maven.javadoc.plugin.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>${maven.compiler.plugin.version}</version>
|
<version>${maven.compiler.plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>${jdk.version}</source>
|
||||||
<target>1.7</target>
|
<target>${jdk.version}</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -154,6 +134,32 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>${maven.source.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>${maven.javadoc.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-javadocs</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
<resources>
|
<resources>
|
||||||
@ -185,7 +191,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>default</id>
|
<id>dev</id>
|
||||||
<activation>
|
<activation>
|
||||||
<activeByDefault>true</activeByDefault>
|
<activeByDefault>true</activeByDefault>
|
||||||
</activation>
|
</activation>
|
||||||
@ -193,5 +199,46 @@
|
|||||||
<maven.test.skip>true</maven.test.skip>
|
<maven.test.skip>true</maven.test.skip>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>release</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
|
<version>${maven.gpg.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>sign</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<properties>
|
||||||
|
<maven.test.skip>true</maven.test.skip>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
<distributionManagement>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>oss</id>
|
||||||
|
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
<repository>
|
||||||
|
<id>oss</id>
|
||||||
|
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
</project>
|
</project>
|
||||||
@ -4,9 +4,9 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j</artifactId>
|
<artifactId>weixin4j</artifactId>
|
||||||
<version>${weixin4j.version}</version>
|
<version>1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>weixin4j-base</artifactId>
|
<artifactId>weixin4j-base</artifactId>
|
||||||
<version>${weixin4j.base.version}</version>
|
<version>${weixin4j.base.version}</version>
|
||||||
|
|||||||
@ -66,7 +66,7 @@ weixin4j-mp
|
|||||||
bill_path=/tmp/weixin/bill
|
bill_path=/tmp/weixin/bill
|
||||||
ca_file=/tmp/weixin/xxxxx.p12 | xxxx.pfx
|
ca_file=/tmp/weixin/xxxxx.p12 | xxxx.pfx
|
||||||
|
|
||||||
3.在项目根目录下执行`mvn package`命令后得到jar包,将`weixin4j-qy-api-full`包或者`weixin4j-base`跟`weixin4j-mp-api`两个包引入到自己的工程内.
|
3.在项目根目录下执行`mvn package`命令后得到jar包,将`weixin4j-mp-full`包或者`weixin4j-base`和`weixin4j-mp-api`两个包引入到自己的工程.
|
||||||
|
|
||||||
WeixinProxy weixinProxy = new WeixinProxy();
|
WeixinProxy weixinProxy = new WeixinProxy();
|
||||||
// weixinProxy = new WeixinProxy(appid,appsecret);
|
// weixinProxy = new WeixinProxy(appid,appsecret);
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j</artifactId>
|
<artifactId>weixin4j</artifactId>
|
||||||
<version>${weixin4j.version}</version>
|
<version>1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>weixin4j-mp</artifactId>
|
<artifactId>weixin4j-mp</artifactId>
|
||||||
<version>${weixin4j.mp.version}</version>
|
<version>${weixin4j.mp.version}</version>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</modules>
|
</modules>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-base</artifactId>
|
<artifactId>weixin4j-base</artifactId>
|
||||||
<version>${weixin4j.base.version}</version>
|
<version>${weixin4j.base.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-mp</artifactId>
|
<artifactId>weixin4j-mp</artifactId>
|
||||||
<version>${weixin4j.mp.version}</version>
|
<version>${weixin4j.mp.version}</version>
|
||||||
</parent>
|
</parent>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.name}</finalName>
|
<finalName>weixin4j-mp</finalName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import org.apache.commons.codec.digest.DigestUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
import com.foxinmy.weixin4j.exception.PayException;
|
import com.foxinmy.weixin4j.exception.PayException;
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
@ -104,10 +103,10 @@ public class PayUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* V2.x版本的PayRequest签名
|
* sha签名(一般用于V2.x支付接口)
|
||||||
*
|
*
|
||||||
* @param jsPayRequestV2
|
* @param obj
|
||||||
* 支付请求
|
* 签名对象
|
||||||
* @param paySignKey
|
* @param paySignKey
|
||||||
* 支付API的密钥
|
* 支付API的密钥
|
||||||
* @return
|
* @return
|
||||||
@ -123,10 +122,10 @@ public class PayUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* V3.x版本的PayRequest签名
|
* md5签名(一般用于V3.x支付接口)
|
||||||
*
|
*
|
||||||
* @param jsPayRequestV3
|
* @param obj
|
||||||
* 支付请求
|
* 签名对象
|
||||||
* @param paySignKey
|
* @param paySignKey
|
||||||
* 支付API的密钥
|
* 支付API的密钥
|
||||||
* @return
|
* @return
|
||||||
@ -192,12 +191,22 @@ public class PayUtil {
|
|||||||
return JSON.toJSONString(jsPayRequest);
|
return JSON.toJSONString(jsPayRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建预支付对象
|
||||||
|
*
|
||||||
|
* @param payPackage
|
||||||
|
* 包含订单信息的对象
|
||||||
|
* @see com.foxinmy.weixin4j.mp.payment.v3.PayPackageV3
|
||||||
|
* @see com.foxinmy.weixin4j.mp.payment.v3.PrePay
|
||||||
|
* @return 预支付对象
|
||||||
|
*/
|
||||||
public static PrePay createPrePay(PayPackageV3 payPackage) {
|
public static PrePay createPrePay(PayPackageV3 payPackage) {
|
||||||
PrePay prePay = null;
|
PrePay prePay = null;
|
||||||
String payJsRequestXml = XStream.to(payPackage).replaceAll("__", "_");
|
String payJsRequestXml = XStream.to(payPackage).replaceAll("__", "_");
|
||||||
HttpRequest request = new HttpRequest();
|
HttpRequest request = new HttpRequest();
|
||||||
try {
|
try {
|
||||||
Response response = request.post(Consts.UNIFIEDORDER, payJsRequestXml);
|
Response response = request.post(Consts.UNIFIEDORDER,
|
||||||
|
payJsRequestXml);
|
||||||
prePay = response.getAsObject(new TypeReference<PrePay>() {
|
prePay = response.getAsObject(new TypeReference<PrePay>() {
|
||||||
});
|
});
|
||||||
} catch (WeixinException e) {
|
} catch (WeixinException e) {
|
||||||
@ -211,16 +220,11 @@ public class PayUtil {
|
|||||||
* 生成编辑地址请求
|
* 生成编辑地址请求
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* err_msg edit_address:ok获取编辑收货地址成功</br>
|
* err_msg edit_address:ok获取编辑收货地址成功</br> edit_address:fail获取编辑收货地址失败</br>
|
||||||
* edit_address:fail获取编辑收货地址失败</br>
|
* userName 收货人姓名</br> telNumber 收货人电话</br> addressPostalCode 邮编</br>
|
||||||
* userName 收货人姓名</br>
|
* proviceFirstStageName 国标收货地址第一级地址</br> addressCitySecondStageName
|
||||||
* telNumber 收货人电话</br>
|
* 国标收货地址第二级地址</br> addressCountiesThirdStageName 国标收货地址第三级地址</br>
|
||||||
* addressPostalCode 邮编</br>
|
* addressDetailInfo 详细收货地址信息</br> nationalCode 收货地址国家码</br>
|
||||||
* proviceFirstStageName 国标收货地址第一级地址</br>
|
|
||||||
* addressCitySecondStageName 国标收货地址第二级地址</br>
|
|
||||||
* addressCountiesThirdStageName 国标收货地址第三级地址</br>
|
|
||||||
* addressDetailInfo 详细收货地址信息</br>
|
|
||||||
* nationalCode 收货地址国家码</br>
|
|
||||||
*
|
*
|
||||||
* @param appId
|
* @param appId
|
||||||
* 公众号的ID
|
* 公众号的ID
|
||||||
@ -232,22 +236,20 @@ public class PayUtil {
|
|||||||
*/
|
*/
|
||||||
public static String createAddressRequestJson(String appId, String url,
|
public static String createAddressRequestJson(String appId, String url,
|
||||||
String accessToken) {
|
String accessToken) {
|
||||||
Map<String, String> param = new HashMap<String, String>();
|
Map<String, String> obj = new HashMap<String, String>();
|
||||||
param.put("appId", appId);
|
|
||||||
param.put("url", url);
|
|
||||||
param.put("timeStamp", DateUtil.timestamp2string());
|
|
||||||
param.put("nonceStr", RandomUtil.generateString(16));
|
|
||||||
param.put("accessToken", accessToken);
|
|
||||||
String sign = paysignSha(param, null);
|
|
||||||
JSONObject obj = new JSONObject();
|
|
||||||
obj.put("appId", appId);
|
obj.put("appId", appId);
|
||||||
|
obj.put("timeStamp", DateUtil.timestamp2string());
|
||||||
|
obj.put("nonceStr", RandomUtil.generateString(16));
|
||||||
|
obj.put("url", url);
|
||||||
|
obj.put("accessToken", accessToken);
|
||||||
|
String sign = paysignSha(obj, null);
|
||||||
|
obj.remove("url");
|
||||||
|
obj.remove("accessToken");
|
||||||
obj.put("scope", "jsapi_address");
|
obj.put("scope", "jsapi_address");
|
||||||
obj.put("signType", SignType.SHA1.name().toLowerCase());
|
obj.put("signType", SignType.SHA1.name().toLowerCase());
|
||||||
obj.put("addrSign", sign);
|
obj.put("addrSign", sign);
|
||||||
obj.put("timeStamp", param.get("timeStamp"));
|
|
||||||
obj.put("nonceStr", param.get("nonceStr"));
|
|
||||||
|
|
||||||
return obj.toJSONString();
|
return JSON.toJSONString(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -297,8 +299,8 @@ public class PayUtil {
|
|||||||
weixinAccount.getMchId(), productId, timestamp, noncestr);
|
weixinAccount.getMchId(), productId, timestamp, noncestr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String createNativePayRequestV2(WeixinMpAccount weixinAccount,
|
public static String createNativePayRequestV2(
|
||||||
PayPackageV2 payPackage) {
|
WeixinMpAccount weixinAccount, PayPackageV2 payPackage) {
|
||||||
NativePayResponseV2 payRequest = new NativePayResponseV2(weixinAccount,
|
NativePayResponseV2 payRequest = new NativePayResponseV2(weixinAccount,
|
||||||
payPackage);
|
payPackage);
|
||||||
Map<String, String> map = new HashMap<String, String>();
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-mp</artifactId>
|
<artifactId>weixin4j-mp</artifactId>
|
||||||
<version>${weixin4j.mp.version}</version>
|
<version>${weixin4j.mp.version}</version>
|
||||||
</parent>
|
</parent>
|
||||||
@ -21,6 +21,13 @@
|
|||||||
<finalName>weixin-mp-server</finalName>
|
<finalName>weixin-mp-server</finalName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -30,7 +37,7 @@
|
|||||||
<version>${netty.version}</version>
|
<version>${netty.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-mp-api</artifactId>
|
<artifactId>weixin4j-mp-api</artifactId>
|
||||||
<version>${weixin4j.mp.version}</version>
|
<version>${weixin4j.mp.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@ -47,7 +47,7 @@ weixin4j-qy
|
|||||||
token_path=/tmp/weixin/token
|
token_path=/tmp/weixin/token
|
||||||
media_path=/tmp/weixin/media
|
media_path=/tmp/weixin/media
|
||||||
|
|
||||||
3.在项目根目录执行`mvn package`命令后得到jar包,将`weixin4j-qy-api-full`包或者`weixin4j-base`跟`weixin4j-qy-api`两个包引入到自己的工程内.
|
3.在项目根目录执行`mvn package`命令后得到jar包,将`weixin4j-qy-full`包或者`weixin4j-base`跟`weixin4j-qy-api`两个包引入到自己的工程内.
|
||||||
|
|
||||||
WeixinProxy weixinProxy = new WeixinProxy();
|
WeixinProxy weixinProxy = new WeixinProxy();
|
||||||
// weixinProxy = new WeixinProxy(corpid,corpsecret);
|
// weixinProxy = new WeixinProxy(corpid,corpsecret);
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j</artifactId>
|
<artifactId>weixin4j</artifactId>
|
||||||
<version>${weixin4j.version}</version>
|
<version>1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>weixin4j-qy</artifactId>
|
<artifactId>weixin4j-qy</artifactId>
|
||||||
<version>${weixin4j.qy.version}</version>
|
<version>${weixin4j.qy.version}</version>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</modules>
|
</modules>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-base</artifactId>
|
<artifactId>weixin4j-base</artifactId>
|
||||||
<version>${weixin4j.base.version}</version>
|
<version>${weixin4j.base.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-qy</artifactId>
|
<artifactId>weixin4j-qy</artifactId>
|
||||||
<version>${weixin4j.qy.version}</version>
|
<version>${weixin4j.qy.version}</version>
|
||||||
</parent>
|
</parent>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.name}</finalName>
|
<finalName>weixin4j-qy</finalName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-qy</artifactId>
|
<artifactId>weixin4j-qy</artifactId>
|
||||||
<version>${weixin4j.qy.version}</version>
|
<version>${weixin4j.qy.version}</version>
|
||||||
</parent>
|
</parent>
|
||||||
@ -21,6 +21,13 @@
|
|||||||
<finalName>weixin-qy-server</finalName>
|
<finalName>weixin-qy-server</finalName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -30,7 +37,7 @@
|
|||||||
<version>${netty.version}</version>
|
<version>${netty.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.foxinmy.weixin4j</groupId>
|
<groupId>com.foxinmy</groupId>
|
||||||
<artifactId>weixin4j-qy-api</artifactId>
|
<artifactId>weixin4j-qy-api</artifactId>
|
||||||
<version>${weixin4j.qy.version}</version>
|
<version>${weixin4j.qy.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user