微信支付客户端
介绍
微信支付客户端是基于微信官方提供的刷卡支付SDK基础上二次开发出来的一个用于集成调用微信支付API的客户端工具。 目的是为了提高我们对微信支付的开发效率。集成了包括服务端对微信支付下单、回调、查询、退款等所有API接口的调用,支持包括刷卡、公众号、扫码及APP四种支付方式。支付增加代理设置及修复有些情况UTF-8编码报验证失败的bug。
变更记录
Ver 1.0 (2015-6-2)
- 增加代理设置;
- 修复必须要提交微信支付证书验证的bug;
- 增加公众号、扫码、及APP支付方式的API调用;
- 修复有些情况UTF-8编码报验证失败的bug;
客户端结构
快速入门
第一步:引入微信支付客户端及其依赖包
在maven配置文件中加入以下代码
<dependency>
<groupId>com.tencent</groupId>
<artifactId>wxpay</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.3.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-cache</artifactId>
<version>4.3.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.3.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xmlpull</groupId>
<artifactId>xmlpull</artifactId>
<version>1.1.3.1</version>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.4c</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.7</version>
</dependency>
第二步:调用
统一下单示例
Attachments
-
微信支付V3版开发经验分享.ppt
(1.2 MB) -
added by zhongweimin 11 years ago.
-
code.png
(34.5 KB) -
added by zhongweimin 11 years ago.
-
代码示例.pdf
(884.1 KB) -
added by zhongweimin 11 years ago.
-
wxpay_structure.png
(78.7 KB) -
added by zhongweimin 11 years ago.
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)

