Compare commits

...

125 Commits

Author SHA1 Message Date
86f8654bbe fix getPhoneNumber 2023-11-01 17:40:28 +08:00
0cb2fce609 delete WeixinAppFacade.getWeixinAccount 2023-01-19 09:48:54 +08:00
09d44fdb5c rename getContext to getWeixinAccount 2023-01-18 14:40:24 +08:00
cbd66f7bb0 add weixinapp face get context 2023-01-18 10:22:52 +08:00
niko
572048be6c add PhoneNumberApi doc 2021-12-21 09:28:52 +08:00
niko
b63b533b58 add java doc 2021-12-21 09:19:07 +08:00
niko
7f5ee2f774 add JOSNField in phoneInfo 2021-12-20 18:18:32 +08:00
niko
256c797be8 fix java doc 2021-12-20 16:51:45 +08:00
niko
10a346ca67 new package wxa.model.phone 2021-12-20 16:33:24 +08:00
niko-develop
8d96e3c46f add phoneNumberApi 2021-12-20 13:55:49 +08:00
Sutra Zhou
47da1be839 Merge branch 'release/1.10.0' 2021-08-16 19:18:43 +08:00
Sutra Zhou
baec32d7e8 Update versions for release 2021-08-16 19:10:10 +08:00
Sutra Zhou
234ffc9319 Add coverage report. 2021-08-16 19:09:42 +08:00
Sutra Zhou
aff957f27a Push down maven-jar-plugin settings to sub projects. 2021-08-16 19:00:01 +08:00
Sutra Zhou
17f5374096 Upgrade dependencies. 2021-08-16 18:50:08 +08:00
Sutra Zhou
b08c9df31d Upgrade jedis from 2.8.1 to 3.6.3. 2021-08-16 17:49:24 +08:00
Sutra Zhou
1edd1440b1 Fix scm URL. 2021-08-08 02:04:05 +08:00
Sutra Zhou
5ecd87336e Revise doc. 2021-08-08 01:28:07 +08:00
Sutra Zhou
8d5960980a Add how to use for wxa. 2021-08-08 01:21:43 +08:00
Sutra Zhou
bf8ca3a227 Revise maven test skip settings. 2021-08-07 23:41:29 +08:00
Sutra Zhou
987dffb167 Revise maven test skipping setting. 2021-08-07 22:48:08 +08:00
Sutra Zhou
ce4019b20b Set findbugs-maven-plugin version. 2021-08-07 22:42:34 +08:00
Sutra Zhou
754c4ebb16 Extend the maven plguins from oxerr parent. 2021-08-07 22:32:32 +08:00
Sutra Zhou
72d623995d Set maven plugin default locales from en to zh_CN. 2021-08-07 21:58:47 +08:00
Sutra Zhou
fddaceaa68
Merge pull request #210 from foxinmy/dependabot/maven/weixin4j-wxa/ch.qos.logback-logback-core-1.2.0
Bump logback-core from 1.1.8 to 1.2.0 in /weixin4j-wxa
2021-06-08 06:25:06 +08:00
dependabot[bot]
a2ab1a07c8
Bump logback-core from 1.1.8 to 1.2.0 in /weixin4j-wxa
Bumps logback-core from 1.1.8 to 1.2.0.

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-core
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-07 16:43:33 +00:00
Sutra Zhou
d489ce6ce5 Move httpclient version definition to root pom.xml. 2021-06-04 09:36:29 +08:00
Sutra Zhou
ef358dd552
Merge pull request #209 from foxinmy/dependabot/maven/weixin4j-server/org.apache.httpcomponents-httpclient-4.5.13
Bump httpclient from 4.3.6 to 4.5.13 in /weixin4j-server
2021-06-04 09:31:31 +08:00
Sutra Zhou
89f46d4a76
Merge pull request #208 from foxinmy/dependabot/maven/weixin4j-base/org.apache.httpcomponents-httpclient-4.5.13
Bump httpclient from 4.3.6 to 4.5.13 in /weixin4j-base
2021-06-04 09:30:42 +08:00
dependabot[bot]
f1dfd57985
Bump httpclient from 4.3.6 to 4.5.13 in /weixin4j-server
Bumps httpclient from 4.3.6 to 4.5.13.

---
updated-dependencies:
- dependency-name: org.apache.httpcomponents:httpclient
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-04 01:25:36 +00:00
dependabot[bot]
baa9e350ca
Bump httpclient from 4.3.6 to 4.5.13 in /weixin4j-base
Bumps httpclient from 4.3.6 to 4.5.13.

---
updated-dependencies:
- dependency-name: org.apache.httpcomponents:httpclient
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-04 01:21:19 +00:00
Sutra Zhou
2161f7d6e8 Update for next development version 2021-05-06 15:30:19 +08:00
Sutra Zhou
91f4aa7de8 Merge branch 'release/1.9.1' 2021-05-06 15:30:17 +08:00
Sutra Zhou
0e3ad50414 Merge branch 'release/1.9.1' into develop 2021-05-06 15:30:17 +08:00
Sutra Zhou
dc53565ddc Update versions for release 2021-05-06 15:17:16 +08:00
Sutra Zhou
3939caad46 Fix TradeType of PayPackageBuilder#h5Pay. 2021-05-06 15:15:56 +08:00
Sutra Zhou
6a868e226a
Merge pull request #207 from foxinmy/dependabot/maven/weixin4j-server/io.netty-netty-codec-http-4.1.59.Final
Bump netty-codec-http from 4.1.42.Final to 4.1.59.Final in /weixin4j-server
2021-02-09 12:25:29 +08:00
dependabot[bot]
598b5926e9
Bump netty-codec-http in /weixin4j-server
Bumps [netty-codec-http](https://github.com/netty/netty) from 4.1.42.Final to 4.1.59.Final.
- [Release notes](https://github.com/netty/netty/releases)
- [Commits](https://github.com/netty/netty/compare/netty-4.1.42.Final...netty-4.1.59.Final)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 21:25:34 +00:00
Sutra Zhou
88df988360 Update for next development version 2020-12-18 09:31:28 +08:00
Sutra Zhou
2c2ac96330 Merge branch 'release/1.9.0' 2020-12-18 09:31:25 +08:00
Sutra Zhou
08ee4aba10 Merge branch 'release/1.9.0' into develop 2020-12-18 09:31:25 +08:00
Sutra Zhou
688aac49b0 Update deploy setting. 2020-12-18 00:53:01 +08:00
Sutra Zhou
2e5eb6c24d Add newline at end of file. 2020-12-17 20:56:19 +08:00
Sutra Zhou
aaaefca14a Update versions for release 2020-12-17 20:50:43 +08:00
Sutra Zhou
649be79742 Add gitflow-maven-plugin. 2020-12-17 20:50:09 +08:00
Sutra Zhou
fa3d33bf83 Add maven badge and license badge. 2020-12-17 20:46:36 +08:00
Sutra Zhou
68aae16984 Upgrade maven site. 2020-12-17 19:58:10 +08:00
Sutra Zhou
b9afaf0ff3 Update SubscribeMessageApi javadoc. 2020-12-17 18:57:59 +08:00
Sutra Zhou
7502a47e07 Add more report. 2020-12-17 18:19:54 +08:00
Sutra Zhou
fd0cbab364 Align all artifact versions. 2020-12-17 15:49:39 +08:00
Sutra Zhou
a40d41b0e2 Remove .classpath .settings from version control. 2020-12-17 14:44:13 +08:00
jinyu
04c6ac9e55
Merge pull request #203 from foxinmy/dependabot/maven/junit-junit-4.13.1
Bump junit from 4.8.2 to 4.13.1
2020-10-14 13:35:39 +08:00
dependabot[bot]
35bfd67c7e
Bump junit from 4.8.2 to 4.13.1
Bumps [junit](https://github.com/junit-team/junit4) from 4.8.2 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.8.2...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 08:36:33 +00:00
jinyu
45042e8e3f
Merge pull request #201 from kit-lee/master
去掉已不使用的OPTION_CHECK选项
2020-08-06 18:14:52 +08:00
Kit
e7be330b04 去掉已不使用的OPTION_CHECK选项 2020-08-06 09:44:26 +08:00
jinyu
8409b3635c
Merge pull request #200 from foxinmy/dependabot/maven/weixin4j-server/org.apache.httpcomponents-httpclient-4.3.6
Bump httpclient from 4.2 to 4.3.6 in /weixin4j-server
2020-07-24 13:00:34 +08:00
dependabot[bot]
a481fb6a92
Bump httpclient from 4.2 to 4.3.6 in /weixin4j-server
Bumps httpclient from 4.2 to 4.3.6.

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-24 04:58:15 +00:00
jinyu
c7395e4a74 Merge remote-tracking branch 'origin/master' 2020-07-24 12:57:19 +08:00
jinyu
7fd6db2758 maxConnections and maxConnectionsPerHost 2020-07-24 12:55:37 +08:00
jinyu
ee627cee44
Merge pull request #199 from kit-lee/服务商分帐
添加微信分帐API
2020-06-04 22:03:53 +08:00
Kit
2cdd2a7f4d 补完 2020-06-04 21:30:22 +08:00
Kit
e83c62824b bug fix 2020-06-04 20:35:31 +08:00
Kit
9bb9918421 bug fix 2020-05-27 16:10:35 +08:00
Kit
61b905d543 fix 2020-05-27 11:10:56 +08:00
Kit
78a53b8016 bug fix 2020-05-27 09:49:58 +08:00
Kit
1d0790ad4a 适应JDK 9以上的java环境 2020-05-26 10:55:28 +08:00
Kit
431ef21964 微信支付分帐相关API 2020-05-26 10:54:30 +08:00
jinyu
91d880eb7f
Merge pull request #198 from kit-lee/fix_json_parse_problem
Fix json parse problem
2020-04-02 11:03:16 +08:00
Kit.lee
0107fd3a7c base包的XmlResult也补充setter方法 2020-04-01 18:04:47 +08:00
Kit.lee
73d4642617 补充setter方法 2020-04-01 18:00:02 +08:00
Kit.lee
a2b23c237b Fixed model classes that lost data during fastjson serialization 2020-04-01 15:10:56 +08:00
jinyu
7825a86fd1
Merge pull request #194 from sutra/mediaCheckAsync
Implement mediaCheckAsync.
2020-02-27 23:32:25 +08:00
jinyu
4ababefb85
Merge pull request #195 from loeveol/revert-193-patch-1
Revert "模板消息跳转小程序的参数存在错误,官方文档有误。"
2020-02-23 21:18:08 +08:00
loeveol
d6cb7bf87f
Revert "模板消息跳转小程序的参数存在错误,官方文档有误。" 2020-02-22 14:59:24 +08:00
Sutra Zhou
b6acbaa0fc Implement mediaCheckAsync. 2020-02-20 19:44:28 +08:00
jinyu
c530fb84ad
Merge pull request #193 from loeveol/patch-1
模板消息跳转小程序的参数存在错误,官方文档有误。
2020-02-20 13:12:48 +08:00
jinyu
41db5f7e53
Merge pull request #192 from kit-lee/package_fix
一些包引用的更新
2020-02-20 12:19:31 +08:00
loeveol
b494c0a64f
Update TemplateMessage.java
官方文档在模板消息跳转小程序的参数存在错误,提交的miniprogram参数中的pagepath实际为page,这里只对Json的编码修正即可。
2020-02-15 11:55:08 +08:00
Kit
48eb468eb7 一些包引用的更新 2020-02-10 14:25:18 +08:00
jinyu
fe3e396113
Merge pull request #191 from sutra/master
Fix dependency version conflict of Bouncy Castle.
2020-01-18 14:20:16 +08:00
jinyu
8137ad4f20
Merge pull request #190 from kit-lee/jsapi_1_4_0_fix
部分即将废弃的API打过期标志,增加两个1.4.0后新增的JSAPI
2020-01-18 14:19:23 +08:00
Sutra Zhou
d94b9acbb6 Fix dependency version conflict of Bouncy Castle. 2020-01-17 15:55:52 +08:00
Kit
c2eebc2ad8 部分即将废弃的API打过期标志,增加两个1.4.0后新增的JSAPI 2020-01-16 14:59:37 +08:00
jinyu
15819c7a43
Merge pull request #189 from 1377382065/master
add SubscribeMessageApi
2020-01-08 12:13:08 +08:00
Niko
9dcef8c596 sendSubscribeMessageMessage to sendSubscribeMessage 2020-01-07 10:36:27 +08:00
Niko
d3044f045d SubscribeMessageParameter public to package 2020-01-07 10:13:52 +08:00
Niko
e8ac8f594f add SubscribeMessageApi 2020-01-06 18:08:50 +08:00
jinyu
9725ffe1cb
Merge pull request #188 from kit-lee/hotfix/人脸凭证JSON格式化问题
Hotfix/人脸凭证fastjson格式化问题
2019-11-22 16:23:37 +08:00
Kit
57811ef3d5 fix fastjson serialize problem 2019-11-22 16:14:44 +08:00
Kit
3bb6250385 兼容JDK9+的环境进行maven编译打包 2019-11-22 16:10:56 +08:00
胡金宇
4bd6d6ded7 兼容压缩包 2019-11-04 12:46:59 +08:00
jinyu
f4989813e5
Merge pull request #186 from foxinmy/dependabot/maven/weixin4j-base/org.apache.httpcomponents-httpclient-4.3.6
Bump httpclient from 4.3 to 4.3.6 in /weixin4j-base
2019-11-04 11:23:41 +08:00
jinyu
f6d4900596
Merge pull request #185 from foxinmy/dependabot/maven/weixin4j-server/org.apache.httpcomponents-httpclient-4.3.6
Bump httpclient from 4.2.5 to 4.3.6 in /weixin4j-server
2019-11-04 11:23:30 +08:00
jinyu
bf14039ead
Merge pull request #187 from foxinmy/dependabot/maven/weixin4j-base/io.netty-netty-all-4.1.42.Final
Bump netty-all from 4.0.30.Final to 4.1.42.Final in /weixin4j-base
2019-11-04 11:23:17 +08:00
dependabot[bot]
58f034d408
Bump netty-all from 4.0.30.Final to 4.1.42.Final in /weixin4j-base
Bumps [netty-all](https://github.com/netty/netty) from 4.0.30.Final to 4.1.42.Final.
- [Release notes](https://github.com/netty/netty/releases)
- [Commits](https://github.com/netty/netty/compare/netty-4.0.30.Final...netty-4.1.42.Final)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-04 03:20:53 +00:00
dependabot[bot]
f539ff68d0
Bump httpclient from 4.3 to 4.3.6 in /weixin4j-base
Bumps httpclient from 4.3 to 4.3.6.

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-04 03:20:51 +00:00
dependabot[bot]
de87f2fe16
Bump httpclient from 4.2.5 to 4.3.6 in /weixin4j-server
Bumps httpclient from 4.2.5 to 4.3.6.

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-04 03:20:49 +00:00
jinyu
b9c2e548fb
Merge pull request #184 from foxinmy/dependabot/maven/weixin4j-server/io.netty-netty-all-4.1.42.Final
Bump netty-all from 4.1.8.Final to 4.1.42.Final in /weixin4j-server
2019-11-04 11:19:49 +08:00
dependabot[bot]
b57f7910ba
Bump netty-all from 4.1.8.Final to 4.1.42.Final in /weixin4j-server
Bumps [netty-all](https://github.com/netty/netty) from 4.1.8.Final to 4.1.42.Final.
- [Release notes](https://github.com/netty/netty/releases)
- [Commits](https://github.com/netty/netty/compare/netty-4.1.8.Final...netty-4.1.42.Final)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-29 13:41:34 +00:00
jinyu
68494712ae
Merge pull request #183 from kit-lee/feature/刷脸支付后端获取调用凭证API
fix test case
2019-10-08 13:19:37 +08:00
Kit
db698abb75 fix test case 2019-10-08 12:23:56 +08:00
jinyu
24bead1a8e
Merge pull request #182 from kit-lee/feature/刷脸支付后端获取调用凭证API
微信刷脸支付后端API
2019-09-26 10:26:45 +08:00
Kit
f03c79a4ed update 2019-09-25 16:01:04 +08:00
jinyu
40692a1948
Merge pull request #181 from sutra/wxa-doc
Update WeChat official documentation links for wxa.
2019-09-23 18:19:39 +08:00
Kit
2524f34c33 押金支付接口实现 2019-09-22 11:43:40 +08:00
Sutra Zhou
ab21a862a4 Update WeChat official documentation links for wxa. 2019-09-20 20:08:47 +08:00
Kit
38b56fd552 旧版人脸支付接口;获取凭证接口测试类 2019-09-20 15:00:02 +08:00
Kit
d532097300 默认的JdkLogger配置改善 2019-09-20 14:57:44 +08:00
Kit
0414d54c1e 修正注释 2019-09-20 14:51:01 +08:00
Kit
fdc7f38d8c 刷脸支付凭证获得 2019-09-19 11:31:57 +08:00
Kit
60e8efef65 api完成 2019-09-18 16:29:11 +08:00
Kit
cfd496d26f authinfo api 2019-09-18 10:02:48 +08:00
Kit
77b692e729 添加uri地址 2019-09-18 10:02:48 +08:00
Kit
01c8bc0e03 base模块转移到到pay的相关类添加过期的注解 2019-09-18 10:02:48 +08:00
Kit
ef3b50a19f 转移位置 2019-09-18 10:02:48 +08:00
Kit
1c62b5e665 卡券、企业付款及海关API加入pay子模块 2019-09-18 10:02:48 +08:00
Kit
86fc0712d0 将支付API相关内容迁移到新的子模块weixin4j-pay 2019-09-18 10:02:48 +08:00
jinyu
3af2db29d9
Merge pull request #180 from kit-lee/修复一些错误的注释
修复注释中一些无效或错误的连接
2019-09-17 20:38:49 +08:00
Kit
e35dd62bc8 修复注释中一些无效或错误的连接 2019-09-17 16:19:50 +08:00
jinyu
fadafb6302
Merge pull request #179 from kit-lee/hotfix/bugfix
fix not import StringUtils
2019-09-16 17:36:07 +08:00
Kit
33d02f794f fix not import StringUtils 2019-09-16 16:40:14 +08:00
jinyu
7334cc925f
Merge pull request #178 from kit-lee/feature/giftcard_api
Feature/giftcard api
2019-09-16 11:28:49 +08:00
Kit
b20e09ccf0 礼品卡API实现 2019-09-12 10:31:19 +08:00
Kit
674ae6ffb0 退款的微信请求增加使用pem证书的API 2019-09-12 10:30:50 +08:00
jinyu
9976bf7772
Merge pull request #175 from foxinmy/revert-174-feature/giftcard
Revert "微信卡券礼品卡相关API"
2019-06-28 18:57:22 +08:00
248 changed files with 15661 additions and 508 deletions

View File

@ -1,6 +1,9 @@
weixin4j weixin4j
======== ========
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.foxinmy/weixin4j/badge.svg?subject=Maven%20Central)](https://maven-badges.herokuapp.com/maven-central/com.foxinmy/weixin4j/)
[![License](https://img.shields.io/badge/License-Apache%20License%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
微信开发工具包 微信开发工具包
------------- -------------
> `weixin4j`是一个用Java编写针对微信开发的工具包,包含[weixin4j-mp](./weixin4j-mp)(微信公众平台API)、[weixin4j-qy](./weixin4j-qy)(微信企业号API)以及[weixin4j-server](./weixin4j-server)(微信回调消息服务器)三个工程. > `weixin4j`是一个用Java编写针对微信开发的工具包,包含[weixin4j-mp](./weixin4j-mp)(微信公众平台API)、[weixin4j-qy](./weixin4j-qy)(微信企业号API)以及[weixin4j-server](./weixin4j-server)(微信回调消息服务器)三个工程.

23
maven-version-rules.xml Normal file
View File

@ -0,0 +1,23 @@
<ruleset comparisonMethod="maven"
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0
http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
<ignoreVersions>
<ignoreVersion type="regex">.*(-|\.)(alpha|Alpha|ALPHA|beta|Beta|BETA|rc|RC).*</ignoreVersion>
</ignoreVersions>
<rules>
<rule groupId="javax.servlet" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">.*-alpha[\.\-].*</ignoreVersion>
<ignoreVersion type="regex">.*-b[0-9]+</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="javax.xml" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">.*-b.*</ignoreVersion>
</ignoreVersions>
</rule>
</rules>
</ruleset>

194
pom.xml
View File

@ -2,9 +2,14 @@
<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>
<parent>
<groupId>org.oxerr</groupId>
<artifactId>oxerr-parent</artifactId>
<version>1.1.0</version>
</parent>
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j</artifactId> <artifactId>weixin4j</artifactId>
<version>1.9.0-SNAPSHOT</version> <version>1.10.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>
@ -19,7 +24,7 @@
</license> </license>
</licenses> </licenses>
<scm> <scm>
<url>https://github.com/foxinmy/weixin4j</url> <url>https://github.com/foxinmy/weixin4j/tree/master</url>
<connection>scm:git:git://github.com/foxinmy/weixin4j.git</connection> <connection>scm:git:git://github.com/foxinmy/weixin4j.git</connection>
<developerConnection>scm:git:git@github.com:foxinmy/weixin4j.git</developerConnection> <developerConnection>scm:git:git@github.com:foxinmy/weixin4j.git</developerConnection>
<tag>HEAD</tag> <tag>HEAD</tag>
@ -45,31 +50,21 @@
<module>weixin4j-qy</module> <module>weixin4j-qy</module>
<module>weixin4j-wxa</module> <module>weixin4j-wxa</module>
<module>weixin4j-server</module> <module>weixin4j-server</module>
<module>weixin4j-example</module>
<module>weixin4j-serverX</module> <module>weixin4j-serverX</module>
<module>weixin4j-pay</module>
<module>weixin4j-example</module>
<module>weixin4j-coverage</module>
</modules> </modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target> <maven.compiler.target>1.6</maven.compiler.target>
<fastjson.version>1.2.31</fastjson.version> <locales>zh_CN</locales>
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration> <configuration>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
<!-- 过滤证书文件 --> <!-- 过滤证书文件 -->
@ -82,29 +77,27 @@
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>versions-maven-plugin</artifactId>
<version>2.5</version> <configuration>
<rulesUri>file:///${session.executionRootDirectory}/maven-version-rules.xml</rulesUri>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<id>default-jar</id>
<phase>package</phase>
<goals> <goals>
<goal>jar</goal> <goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals> </goals>
<configuration>
<classesDirectory>target/classes</classesDirectory>
<excludes>
<exclude>*.properties</exclude>
<exclude>*.xml</exclude>
<exclude>*.txt</exclude>
<exclude>**/*.md</exclude>
</excludes>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
</archive>
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
@ -144,19 +137,11 @@
</executions> </executions>
<configuration> <configuration>
<show>public</show> <show>public</show>
<charset>${project.build.sourceEncoding}</charset>
<encoding>${project.build.sourceEncoding}</encoding>
<docencoding>${project.build.sourceEncoding}</docencoding>
<links> <links>
<link>http://docs.oracle.com/javase/7/docs/api</link> <link>http://docs.oracle.com/javase/7/docs/api</link>
</links> </links>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
@ -170,19 +155,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
@ -202,6 +174,16 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<resources> <resources>
@ -234,6 +216,22 @@
<additionalparam>-Xdoclint:none</additionalparam> <additionalparam>-Xdoclint:none</additionalparam>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
</reporting> </reporting>
<profiles> <profiles>
@ -248,23 +246,105 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins> </plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
</plugin>
</plugins>
</pluginManagement>
</build> </build>
</profile> </profile>
</profiles> </profiles>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.9</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.9</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.78</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.67.Final</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.8.2</version> <version>4.13.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.6.3</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<distributionManagement> <distributionManagement>

View File

@ -5,7 +5,7 @@
<skin> <skin>
<groupId>org.apache.maven.skins</groupId> <groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId> <artifactId>maven-fluido-skin</artifactId>
<version>1.7</version> <version>1.9</version>
</skin> </skin>
<body> <body>
<menu ref="parent" inherit="top" /> <menu ref="parent" inherit="top" />

View File

@ -5,13 +5,43 @@
<parent> <parent>
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j</artifactId> <artifactId>weixin4j</artifactId>
<version>1.9.0-SNAPSHOT</version> <version>1.10.0</version>
</parent> </parent>
<artifactId>weixin4j-base</artifactId> <artifactId>weixin4j-base</artifactId>
<name>weixin4j-base</name> <name>weixin4j-base</name>
<description>微信开发基础工程</description> <description>微信开发基础工程</description>
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-base</url> <url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-base</url>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<build> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>target/classes</classesDirectory>
<excludes>
<exclude>*.properties</exclude>
<exclude>*.xml</exclude>
<exclude>*.txt</exclude>
<exclude>**/*.md</exclude>
</excludes>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
@ -23,7 +53,6 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@ -32,25 +61,22 @@
<dependency> <dependency>
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId> <artifactId>commons-httpclient</artifactId>
<version>3.0</version> <version>3.1</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.3</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-all</artifactId> <artifactId>netty-all</artifactId>
<version>4.0.30.Final</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
<version>3.4.1</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
@ -62,7 +88,6 @@
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>2.8.1</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
@ -71,5 +96,15 @@
<version>3.0.2</version> <version>3.0.2</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
</dependency>
<!-- 兼容 JDK 9+ 后的maven环境编译 -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -45,7 +45,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
* @see <a href= * @see <a href=
* "https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_1"> * "https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_1">
* 企业付款</a> * 企业付款</a>
* @deprecated 商户平台API迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class CashApi extends MchApi { public class CashApi extends MchApi {
public CashApi(WeixinPayAccount weixinAccount) { public CashApi(WeixinPayAccount weixinAccount) {
@ -92,7 +94,7 @@ public class CashApi extends MchApi {
/** /**
* 批量发放红包 企业向微信用户个人发现金红包 * 批量发放红包 企业向微信用户个人发现金红包
* *
* @param redpacket * @param redpackets
* 多个红包信息 * 多个红包信息
* @return 发放结果 * @return 发放结果
* @see #sendRedpacks(Redpacket...) * @see #sendRedpacks(Redpacket...)

View File

@ -21,7 +21,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
* @since JDK 1.6 * @since JDK 1.6
* @see <a href= * @see <a href=
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_1">代金券</a> * "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_1">代金券</a>
* @deprecated 商户平台API迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class CouponApi extends MchApi { public class CouponApi extends MchApi {
public CouponApi(WeixinPayAccount weixinAccount) { public CouponApi(WeixinPayAccount weixinAccount) {

View File

@ -22,7 +22,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
* @date 2016年3月67日 * @date 2016年3月67日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 商户平台API迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class CustomsApi extends MchApi { public class CustomsApi extends MchApi {
public CustomsApi(WeixinPayAccount weixinAccount) { public CustomsApi(WeixinPayAccount weixinAccount) {

View File

@ -27,11 +27,15 @@ import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
* @date 2016年3月26日 * @date 2016年3月26日
* @since JDK 1.6 * @since JDK 1.6
* @see <a href="https://pay.weixin.qq.com/wiki/doc/api/index.html">商户支付平台</a> * @see <a href="https://pay.weixin.qq.com/wiki/doc/api/index.html">商户支付平台</a>
* @deprecated 商户平台API迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class MchApi extends BaseApi { public class MchApi extends BaseApi {
private final static ResourceBundle WEIXIN_BUNDLE; private final static ResourceBundle WEIXIN_BUNDLE;
private final static String PEM_CERT_PREFIX = "-----BEGIN CERTIFICATE-----";
static { static {
WEIXIN_BUNDLE = ResourceBundle.getBundle("com/foxinmy/weixin4j/payment/weixin"); WEIXIN_BUNDLE = ResourceBundle.getBundle("com/foxinmy/weixin4j/payment/weixin");
} }
@ -93,6 +97,12 @@ public class MchApi extends BaseApi {
*/ */
protected WeixinRequestExecutor getWeixinSSLExecutor() throws WeixinException { protected WeixinRequestExecutor getWeixinSSLExecutor() throws WeixinException {
if (weixinSSLExecutor == null) { if (weixinSSLExecutor == null) {
if(weixinAccount.getCertificateFile().startsWith(PEM_CERT_PREFIX)){
// 证书是PEM格式直接使用PEM内容生成请求执行类
this.weixinSSLExecutor = weixinExecutor.createSSLRequestExecutor(weixinAccount.getMchId(),
weixinAccount.getCertificateFile(), weixinAccount.getCertificateKey());
}else {
// 证书是p12格式读取证书文件并生成请求执行类
try { try {
InputStream is = null; InputStream is = null;
File certificate = new File( File certificate = new File(
@ -110,6 +120,7 @@ public class MchApi extends BaseApi {
throw new WeixinException("IO Error on createSSLRequestExecutor", e); throw new WeixinException("IO Error on createSSLRequestExecutor", e);
} }
} }
}
return this.weixinSSLExecutor; return this.weixinSSLExecutor;
} }

View File

@ -60,7 +60,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
* @author jinyu(foxinmy@gmail.com) * @author jinyu(foxinmy@gmail.com)
* @date 2014年10月28日 * @date 2014年10月28日
* @since JDK 1.6 * @since JDK 1.6
* @deprecated 商户平台API迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class PayApi extends MchApi { public class PayApi extends MchApi {
public PayApi(WeixinPayAccount weixinAccount) { public PayApi(WeixinPayAccount weixinAccount) {

View File

@ -8,7 +8,7 @@ import com.foxinmy.weixin4j.util.SerializationUtils;
import redis.clients.jedis.Jedis; import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisPoolConfig;
import redis.clients.util.Pool; import redis.clients.jedis.util.Pool;
/** /**
* 用Redis保存缓存对象(推荐使用) * 用Redis保存缓存对象(推荐使用)

View File

@ -17,11 +17,19 @@ public final class HttpParams {
/** /**
* 连接超时时间(单位毫秒) * 连接超时时间(单位毫秒)
*/ */
private int connectTimeout; private final int connectTimeout;
/** /**
* 读取超时时间(单位毫秒) * 读取超时时间(单位毫秒)
*/ */
private int readTimeout; private final int readTimeout;
/**
* 最大连接数
*/
private final int maxConnections;
/**
* 每个host最大连接数
*/
private final int maxConnectionsPerHost;
/** /**
* 代理对象 * 代理对象
*/ */
@ -36,15 +44,17 @@ public final class HttpParams {
private HostnameVerifier hostnameVerifier; private HostnameVerifier hostnameVerifier;
/** /**
* connectTimeout = 15000,readTimeout=20000 * connectTimeout = 15000,readTimeout=20000,maxConnection=100,maxConnectionPerHost=32
*/ */
public HttpParams() { public HttpParams() {
this(5000, 15000); this(5000, 15000,100,32);
} }
public HttpParams(int connectTimeout, int readTimeout) { public HttpParams(int connectTimeout, int readTimeout,int maxConnections,int maxConnectionsPerHost) {
this.connectTimeout = connectTimeout; this.connectTimeout = connectTimeout;
this.readTimeout = readTimeout; this.readTimeout = readTimeout;
this.maxConnections = maxConnections;
this.maxConnectionsPerHost = maxConnectionsPerHost;
} }
public int getConnectTimeout() { public int getConnectTimeout() {
@ -55,6 +65,14 @@ public final class HttpParams {
return readTimeout; return readTimeout;
} }
public int getMaxConnections() {
return maxConnections;
}
public int getMaxConnectionsPerHost() {
return maxConnectionsPerHost;
}
public Proxy getProxy() { public Proxy getProxy() {
return proxy; return proxy;
} }
@ -84,7 +102,7 @@ public final class HttpParams {
public static HttpParams copy(final HttpParams params) { public static HttpParams copy(final HttpParams params) {
return new HttpParams(params.getConnectTimeout(), return new HttpParams(params.getConnectTimeout(),
params.getReadTimeout()).setProxy(params.getProxy()) params.getReadTimeout(),params.getMaxConnections(),params.getMaxConnectionsPerHost()).setProxy(params.getProxy())
.setHostnameVerifier(params.getHostnameVerifier()) .setHostnameVerifier(params.getHostnameVerifier())
.setSSLContext(params.getSSLContext()); .setSSLContext(params.getSSLContext());
} }

View File

@ -5,6 +5,7 @@ import java.net.InetSocketAddress;
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpConnectionManager; import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
import org.apache.commons.httpclient.protocol.Protocol; import org.apache.commons.httpclient.protocol.Protocol;
import com.foxinmy.weixin4j.http.HttpParams; import com.foxinmy.weixin4j.http.HttpParams;
@ -62,8 +63,10 @@ public class HttpComponent3Factory extends HttpClientFactory {
new SSLProtocolSocketFactory(params.getSSLContext()), new SSLProtocolSocketFactory(params.getSSLContext()),
443)); 443));
} }
httpClient.getHttpConnectionManager().getParams() HttpConnectionManagerParams params_ = httpClient.getHttpConnectionManager().getParams();
.setConnectionTimeout(params.getConnectTimeout()); params_.setMaxTotalConnections(params.getMaxConnections());
params_.setDefaultMaxConnectionsPerHost(params.getMaxConnectionsPerHost());
params_.setConnectionTimeout(params.getConnectTimeout());
} }
} }

View File

@ -40,14 +40,9 @@ public class HttpComponent4_1Factory extends HttpClientFactory {
* *
* @see <a * @see <a
* href="https://issues.apache.org/jira/browse/HTTPCLIENT-1193">HTTPCLIENT-1193</a> * href="https://issues.apache.org/jira/browse/HTTPCLIENT-1193">HTTPCLIENT-1193</a>
* @param clientConnectionManager
*/ */
public HttpComponent4_1Factory() { public HttpComponent4_1Factory() {
PoolingClientConnectionManager clientConnectionManager = new PoolingClientConnectionManager(); httpClient = new DefaultHttpClient(new PoolingClientConnectionManager());
clientConnectionManager.setMaxTotal(30);
clientConnectionManager.setDefaultMaxPerRoute(clientConnectionManager
.getMaxTotal());
httpClient = new DefaultHttpClient(clientConnectionManager);
httpClient.getParams().setParameter( httpClient.getParams().setParameter(
CoreProtocolPNames.HTTP_CONTENT_CHARSET, Consts.UTF_8); CoreProtocolPNames.HTTP_CONTENT_CHARSET, Consts.UTF_8);
httpClient.getParams().setParameter( httpClient.getParams().setParameter(
@ -110,6 +105,11 @@ public class HttpComponent4_1Factory extends HttpClientFactory {
httpClient.getConnectionManager().getSchemeRegistry() httpClient.getConnectionManager().getSchemeRegistry()
.register(scheme); .register(scheme);
} }
ClientConnectionManager connectionManager = httpClient.getConnectionManager();
if(connectionManager instanceof PoolingClientConnectionManager){
((PoolingClientConnectionManager) connectionManager).setMaxTotal(params.getMaxConnections());
((PoolingClientConnectionManager) connectionManager).setDefaultMaxPerRoute(params.getMaxConnectionsPerHost());
}
} }
} }

View File

@ -99,6 +99,8 @@ public class HttpComponent4_2Factory extends HttpClientFactory {
clientBuilder.setHostnameVerifier(new CustomHostnameVerifier( clientBuilder.setHostnameVerifier(new CustomHostnameVerifier(
params.getHostnameVerifier())); params.getHostnameVerifier()));
} }
clientBuilder.setMaxConnTotal(params.getMaxConnections());
clientBuilder.setMaxConnPerRoute(params.getMaxConnectionsPerHost());
} }
} }

View File

@ -50,6 +50,8 @@ public class OkHttpClient2Factory extends HttpClientFactory {
if (params.getHostnameVerifier() != null) { if (params.getHostnameVerifier() != null) {
okClient.setHostnameVerifier(params.getHostnameVerifier()); okClient.setHostnameVerifier(params.getHostnameVerifier());
} }
okClient.getDispatcher().setMaxRequests(params.getMaxConnections());
okClient.getDispatcher().setMaxRequestsPerHost(params.getMaxConnectionsPerHost());
} }
} }

View File

@ -60,6 +60,10 @@ public class OkHttpClient3Factory extends HttpClientFactory {
if (params.getHostnameVerifier() != null) { if (params.getHostnameVerifier() != null) {
clientBuilder.hostnameVerifier(params.getHostnameVerifier()); clientBuilder.hostnameVerifier(params.getHostnameVerifier());
} }
Dispatcher dispatcher = new Dispatcher();
dispatcher.setMaxRequests(params.getMaxConnections());
dispatcher.setMaxRequestsPerHost(params.getMaxConnectionsPerHost());
clientBuilder.dispatcher(dispatcher);
} }
} }

View File

@ -1,12 +1,22 @@
package com.foxinmy.weixin4j.http.weixin; package com.foxinmy.weixin4j.http.weixin;
import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.security.KeyStore; import java.security.*;
import java.security.cert.CertificateFactory;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Arrays; import java.util.Arrays;
import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.bind.DatatypeConverter;
import com.foxinmy.weixin4j.exception.WeixinException; import com.foxinmy.weixin4j.exception.WeixinException;
import com.foxinmy.weixin4j.http.HttpClient; import com.foxinmy.weixin4j.http.HttpClient;
@ -29,6 +39,9 @@ import com.foxinmy.weixin4j.logging.InternalLogLevel;
import com.foxinmy.weixin4j.logging.InternalLogger; import com.foxinmy.weixin4j.logging.InternalLogger;
import com.foxinmy.weixin4j.logging.InternalLoggerFactory; import com.foxinmy.weixin4j.logging.InternalLoggerFactory;
import com.foxinmy.weixin4j.util.Consts; import com.foxinmy.weixin4j.util.Consts;
import com.foxinmy.weixin4j.util.StringUtil;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import static java.util.regex.Pattern.CASE_INSENSITIVE;
/** /**
* 负责微信请求的执行 * 负责微信请求的执行
@ -56,6 +69,18 @@ public class WeixinRequestExecutor {
this.httpClient = HttpClientFactory.getInstance(params); this.httpClient = HttpClientFactory.getInstance(params);
} }
private static final Pattern CERT_PATTERN = Pattern.compile(
"-+BEGIN\\s+.*CERTIFICATE[^-]*-+(?:\\s|\\r|\\n)+" + // Header
"([a-z0-9+/=\\r\\n]+)" + // Base64 text
"-+END\\s+.*CERTIFICATE[^-]*-+", // Footer
CASE_INSENSITIVE);
private static final Pattern KEY_PATTERN = Pattern.compile(
"-+BEGIN\\s+.*PRIVATE\\s+KEY[^-]*-+(?:\\s|\\r|\\n)+" + // Header
"([a-z0-9+/=\\r\\n]+)" + // Base64 text
"-+END\\s+.*PRIVATE\\s+KEY[^-]*-+", // Footer
CASE_INSENSITIVE);
/** /**
* Post方法执行微信请求 * Post方法执行微信请求
* *
@ -194,11 +219,14 @@ public class WeixinRequestExecutor {
try { try {
XmlResult xmlResult = XmlMessageConverter.GLOBAL.convert( XmlResult xmlResult = XmlMessageConverter.GLOBAL.convert(
XmlResult.class, response); XmlResult.class, response);
// 微信最新的刷脸支付API中已没有返回resultCode需做非空判断否则抛异常
if(StringUtil.isNotBlank(xmlResult.getResultCode())) {
if (!SUCCESS_CODE.contains(String.format(",%s,", xmlResult if (!SUCCESS_CODE.contains(String.format(",%s,", xmlResult
.getResultCode().toLowerCase()))) { .getResultCode().toLowerCase()))) {
throw new WeixinException(xmlResult.getErrCode(), throw new WeixinException(xmlResult.getErrCode(),
xmlResult.getErrCodeDes()); xmlResult.getErrCodeDes());
} }
}
} catch (IOException e) { } catch (IOException e) {
; ;
} }
@ -250,4 +278,69 @@ public class WeixinRequestExecutor {
params.setSSLContext(sslContext); params.setSSLContext(sslContext);
return new WeixinRequestExecutor(params); return new WeixinRequestExecutor(params);
} }
/**
* 使用PEM格式证书创建SSL微信请求对象
*
* @param pemCertificate
* PEM格式证书内容
* @param pemPrivateKey
* PEM格式证书私钥
* @return
*/
public WeixinRequestExecutor createSSLRequestExecutor(String password, String pemCertificate, String pemPrivateKey) throws WeixinException{
Security.addProvider(new BouncyCastleProvider());
try {
byte[] certBytes = parseDERFromPEM(pemCertificate);
byte[] keyBytes = parseDERFromPEM(pemPrivateKey);
char[] passwordChars = password.toCharArray();
X509Certificate cert = generateCertificateFromDER(certBytes);
RSAPrivateKey key = generatePrivateKeyFromDER(keyBytes);
KeyStore keystore = KeyStore.getInstance("JKS");
keystore.load(null);
keystore.setCertificateEntry("cert-alias", cert);
keystore.setKeyEntry("key-alias", key, passwordChars, new X509Certificate[] {cert});
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
kmf.init(keystore, passwordChars);
SSLContext context = SSLContext.getInstance("TLS");
context.init(kmf.getKeyManagers(), null, new java.security.SecureRandom());
return createSSLRequestExecutor(context);
} catch (Exception e) {
throw new WeixinException("Certificate load error", e);
}
}
private static byte[] parseDERFromPEM(String data) throws KeyStoreException {
Matcher matcher = CERT_PATTERN.matcher(data);
String content = "";
if(!matcher.find()){
matcher = KEY_PATTERN.matcher(data);
if(!matcher.find()){
throw new KeyStoreException("found no private key or certificate from content:"+ data);
}
}
content = matcher.group(1);
return DatatypeConverter.parseBase64Binary(content);
}
private static RSAPrivateKey generatePrivateKeyFromDER(byte[] keyBytes) throws InvalidKeySpecException, NoSuchAlgorithmException {
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
KeyFactory factory = KeyFactory.getInstance("RSA");
return (RSAPrivateKey)factory.generatePrivate(spec);
}
protected static X509Certificate generateCertificateFromDER(byte[] certBytes) throws CertificateException {
CertificateFactory factory = CertificateFactory.getInstance("X.509");
return (X509Certificate)factory.generateCertificate(new ByteArrayInputStream(certBytes));
}
} }

View File

@ -68,6 +68,10 @@ public class XmlResult implements Serializable {
return resultCode; return resultCode;
} }
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
public String getErrCode() { public String getErrCode() {
return errCode; return errCode;
} }
@ -84,6 +88,10 @@ public class XmlResult implements Serializable {
return returnMsg; return returnMsg;
} }
public void setReturnMsg(String returnMsg) {
this.returnMsg = returnMsg;
}
public void setResultCode(String resultCode) { public void setResultCode(String resultCode) {
this.resultCode = resultCode; this.resultCode = resultCode;
} }

View File

@ -15,23 +15,41 @@ package com.foxinmy.weixin4j.jssdk;
* 企业号JSSDK</a> * 企业号JSSDK</a>
*/ */
public enum JSSDKAPI { public enum JSSDKAPI {
/**
* <a href=
* "https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#111">
* 自定义分享给朋友分享到QQ按钮的分享内容1.4.0</a>
*/
updateAppMessageShareData,
/**
* <a href=
* "https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#112">
* 自定义分享给朋友分享到QQ按钮的分享内容1.4.0</a>
*/
updateTimelineShareData,
/*** /***
* <a href= * <a href=
* "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E5.88.B0.E6.9C.8B.E5.8F.8B.E5.9C.88.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3" * "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E5.88.B0.E6.9C.8B.E5.8F.8B.E5.9C.88.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3"
* >分享接口-获取分享到朋友圈按钮点击状态及自定义分享内容接口</a> * >分享接口-获取分享到朋友圈按钮点击状态及自定义分享内容接口即将废弃</a>
* @deprecated
*/ */
@Deprecated
onMenuShareTimeline, onMenuShareTimeline,
/*** /***
* <a href= * <a href=
* "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E7.BB.99.E6.9C.8B.E5.8F.8B.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3" * "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E7.BB.99.E6.9C.8B.E5.8F.8B.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3"
* >分享接口-获取分享给朋友按钮点击状态及自定义分享内容接口</a> * >分享接口-获取分享给朋友按钮点击状态及自定义分享内容接口即将废弃</a>
* @deprecated
*/ */
@Deprecated
onMenuShareAppMessage, onMenuShareAppMessage,
/*** /***
* <a href= * <a href=
* "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E5.88.B0QQ.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3" * "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E5.88.B0QQ.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3"
* >分享接口-获取分享到QQ按钮点击状态及自定义分享内容接口</a> * >分享接口-获取分享到QQ按钮点击状态及自定义分享内容接口即将废弃</a>
* @deprecated
*/ */
@Deprecated
onMenuShareQQ, onMenuShareQQ,
/*** /***
* <a href= * <a href=
@ -270,8 +288,12 @@ public enum JSSDKAPI {
/** /**
* 分享接口集合 * 分享接口集合
*/ */
@Deprecated
public final static JSSDKAPI[] SHARE_APIS = { onMenuShareTimeline, onMenuShareAppMessage, onMenuShareQQ, public final static JSSDKAPI[] SHARE_APIS = { onMenuShareTimeline, onMenuShareAppMessage, onMenuShareQQ,
onMenuShareWeibo, onMenuShareQZone }; onMenuShareWeibo, onMenuShareQZone };
public final static JSSDKAPI[] ALL_SHARE_APIS = { updateAppMessageShareData, updateTimelineShareData,
onMenuShareWeibo, onMenuShareQZone };
/** /**
* 图像接口集合 * 图像接口集合
*/ */

View File

@ -16,6 +16,10 @@
package com.foxinmy.weixin4j.logging; package com.foxinmy.weixin4j.logging;
import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
@ -27,6 +31,15 @@ public class JdkLoggerFactory extends InternalLoggerFactory {
@Override @Override
public InternalLogger newInstance(String name) { public InternalLogger newInstance(String name) {
return new JdkLogger(Logger.getLogger(name)); Logger logger = Logger.getLogger(name);
Level level = Weixin4jConfigUtil.getJdkLoggerLevel();
logger.setLevel(level);
if(logger.getHandlers().length==0) {
ConsoleHandler consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(level);
logger.addHandler(consoleHandler);
}
return new JdkLogger(logger);
} }
} }

View File

@ -12,7 +12,9 @@ import com.foxinmy.weixin4j.util.StringUtil;
* @date 2015年6月26日 * @date 2015年6月26日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 支付相关的类现已迁移到weixin4j-pay子模块
*/ */
@Deprecated
public class WeixinPayAccount extends WeixinAccount { public class WeixinPayAccount extends WeixinAccount {
private static final long serialVersionUID = -2791256176906048632L; private static final long serialVersionUID = -2791256176906048632L;

View File

@ -38,6 +38,30 @@ public final class CardCoupons {
public static MemberCard.Builder customMemberCard(){ public static MemberCard.Builder customMemberCard(){
return new MemberCard.Builder(); return new MemberCard.Builder();
} }
/**
* 礼品卡信息构造器
*
* @return
*/
public static GiftCard.Builder customGiftCard() {
return new GiftCard.Builder();
}
/**
* 礼品卡货架主题信息构造器
*
* @return
*/
public static PageTheme.Builder customCardPageTheme(){ return new PageTheme.Builder(); }
/**
* 礼品卡货架信息构造器
*
* @return
*/
public static GiftCardPage.Builder customCardPage(){ return new GiftCardPage.Builder(); }
/** /**
* 创建代金券 * 创建代金券
* *
@ -122,4 +146,32 @@ public final class CardCoupons {
MemberCard memberCard = new MemberCard(baseBuilder.build(), memberCardBudiler); MemberCard memberCard = new MemberCard(baseBuilder.build(), memberCardBudiler);
return memberCard; return memberCard;
} }
/**
* 创建单品类礼品卡
*
* @param baseBuilder
* 卡券基础信息构造器 必填
* @param giftCardBuilder
* 礼品卡自身参数构造器 必填
* @return
*/
public static VoucherCard createVoucherCard(CouponBaseInfo.Builder baseBuilder, GiftCard.Builder giftCardBuilder){
baseBuilder.build();
VoucherCard voucherCard = new VoucherCard(baseBuilder.build(), giftCardBuilder);
return voucherCard;
}
/**
* 创建储值类礼品卡
*
* @param baseBuilder
* @param giftCardBuilder
* @return
*/
public static GiftCard createGiftCard(CouponBaseInfo.Builder baseBuilder, GiftCard.Builder giftCardBuilder){
baseBuilder.build();
GiftCard giftCard = new GiftCard(baseBuilder.build(), giftCardBuilder);
return giftCard;
}
} }

View File

@ -0,0 +1,183 @@
package com.foxinmy.weixin4j.model.card;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 已领取的礼品卡信息
* 用于查询用户的礼品卡信息时作为参数或返回对象
*
* @author kit (kit@muses.cc)
* @date 2018-11-23
*/
public class CardInfo {
/**
* 礼品卡的code
*/
private String code;
/**
* 礼品卡的card_id
*/
@JSONField(name = "card_id")
private String cardId;
/**
* 生效时间
*/
@JSONField(name = "begin_time")
private long beginTime;
/**
* 结束时间
*/
@JSONField(name = "end_time")
private long endTime;
/**
* 当前的余额额度
*/
private int balance;
/**
* 礼品卡卡面显示的卡号若没设置则与code相同
*/
@JSONField(name = "card_number")
private String cardNumber;
/**
* 用于支持商家激活时针对单个礼品卡分配自定义的礼品卡背景
*/
@JSONField(name = "background_pic_url")
private String backgroundPicUrl;
/**
* 自定义金额消耗记录不超过14个汉字
*/
@JSONField(name = "record_balance")
private String recordBalance;
/**
* 创建时字段custom_field1定义类型的最新数值限制为4个汉字12字节
*/
@JSONField(name = "custom_field_value1")
private String customFieldValue1;
/**
* 创建时字段custom_field2定义类型的最新数值限制为4个汉字12字节
*/
@JSONField(name = "custom_field_value2")
private String customFieldValue2;
/**
* 创建时字段custom_field3定义类型的最新数值限制为4个汉字12字节
*/
@JSONField(name = "custom_field_value3")
private String customFieldValue3;
/**
* 控制本次积分变动后转赠入口是否出现
*/
@JSONField(name = "can_give_friend")
private Boolean canGiveFriend;
/**
* 该卡的价格
*/
private int price;
/**
* 祝福语
*/
@JSONField(name = "default_gifting_msg")
private String defaultGiftingMsg;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCardId() {
return cardId;
}
public void setCardId(String cardId) {
this.cardId = cardId;
}
public long getBeginTime() {
return beginTime;
}
public void setBeginTime(long beginTime) {
this.beginTime = beginTime;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public int getBalance() {
return balance;
}
public void setBalance(int balance) {
this.balance = balance;
}
public String getCardNumber() {
return cardNumber;
}
public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}
public String getBackgroundPicUrl() {
return backgroundPicUrl;
}
public void setBackgroundPicUrl(String backgroundPicUrl) {
this.backgroundPicUrl = backgroundPicUrl;
}
public String getRecordBalance() {
return recordBalance;
}
public void setRecordBalance(String recordBalance) {
this.recordBalance = recordBalance;
}
public String getCustomFieldValue1() {
return customFieldValue1;
}
public void setCustomFieldValue1(String customFieldValue1) {
this.customFieldValue1 = customFieldValue1;
}
public String getCustomFieldValue2() {
return customFieldValue2;
}
public void setCustomFieldValue2(String customFieldValue2) {
this.customFieldValue2 = customFieldValue2;
}
public String getCustomFieldValue3() {
return customFieldValue3;
}
public void setCustomFieldValue3(String customFieldValue3) {
this.customFieldValue3 = customFieldValue3;
}
public Boolean getCanGiveFriend() {
return canGiveFriend;
}
public void setCanGiveFriend(Boolean canGiveFriend) {
this.canGiveFriend = canGiveFriend;
}
public void CardItem(){}
public void CardItem(String code, String cardId){
this.code = code;
this.cardId = cardId;
}
}

View File

@ -0,0 +1,77 @@
package com.foxinmy.weixin4j.model.card;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 礼品卡货架主题内的礼品卡描述项
*
* @author kit(kit.li@qq.com)
* @date 2018年10月30日
*/
public class CardItem {
/**
* 待上架的card_id
*/
@JSONField(name = "card_id")
private String cardId;
/**
* 商品名不填写默认为卡名称
*/
private String title;
/**
* 商品缩略图1000像素*600像素以下
*/
@JSONField(name = "pic_url")
private String picUrl;
/**
* 商品简介
*/
private String desc;
public CardItem(){
}
public CardItem(String cardId) {
this.cardId = cardId;
}
public CardItem(String cardId, String title, String picUrl, String desc) {
this.cardId = cardId;
this.title = title;
this.picUrl = picUrl;
this.desc = desc;
}
public String getCardId() {
return cardId;
}
public String getTitle() {
return title;
}
public String getPicUrl() {
return picUrl;
}
public String getDesc() {
return desc;
}
public void setCardId(String cardId) {
this.cardId = cardId;
}
public void setTitle(String title) {
this.title = title;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

View File

@ -21,7 +21,18 @@ import com.foxinmy.weixin4j.type.card.CardColor;
*/ */
public class CouponBaseInfo implements Serializable { public class CouponBaseInfo implements Serializable {
private static final long serialVersionUID = -5725424121330101716L; private static final long serialVersionUID = -5725424121330101717L;
/**
* 礼品卡信息目前只有一个价格属性礼品卡时必填
*/
@JSONField(name = "giftcard_info")
private JSONObject giftcardInfo;
/**
* 礼品卡最大可赠送次数必填
*/
@JSONField(name = "max_give_friend_times")
private int maxGiveFriendTimes;
/** /**
* 卡券的商户logo建议像素为300*300 * 卡券的商户logo建议像素为300*300
*/ */
@ -71,7 +82,7 @@ public class CouponBaseInfo implements Serializable {
@JSONField(name = "use_custom_code") @JSONField(name = "use_custom_code")
private Boolean useCustomCode; private Boolean useCustomCode;
/** /**
* 指定特殊用户群体 * 指定特殊用户群体礼品卡建议填写false
*/ */
@JSONField(name = "bind_openid") @JSONField(name = "bind_openid")
private Boolean bindOpenId; private Boolean bindOpenId;
@ -140,12 +151,12 @@ public class CouponBaseInfo implements Serializable {
*/ */
private String source; private String source;
/** /**
* 每人可领券的数量限制,不填写默认为50 * 每人可领券的数量限制,不填写默认为50礼品卡时须填0不限制
*/ */
@JSONField(name = "get_limit") @JSONField(name = "get_limit")
private int limitNum; private int limitNum;
/** /**
* 卡券领取页面是否可分享 * 卡券领取页面是否可分享礼品卡建议填写false
*/ */
@JSONField(name = "can_share") @JSONField(name = "can_share")
private boolean canShare; private boolean canShare;
@ -157,9 +168,41 @@ public class CouponBaseInfo implements Serializable {
@JSONField(name = "need_push_on_view") @JSONField(name = "need_push_on_view")
private Boolean needPushOnView; private Boolean needPushOnView;
/**
* 礼品卡用属性自定义cell对应的小程序username格式为公众号原始id@appgh_86a091e50ad4@app 选填
*/
@JSONField(name = "center_app_brand_user_name")
private String centerAppBrandUserName;
/**
* 礼品卡用属性自定义cell对应的小程序路径. pages/index/index 选填
*/
@JSONField(name = "center_app_brand_pass")
private String centerAppBrandPass;
/**
* 礼品卡用属性自定义cell对应的小程序username格式为公众号原始id@app 选填
*/
@JSONField(name = "custom_app_brand_user_name")
private String customAppBrandUserName;
/**
* 礼品卡用属性自定义cell对应的小程序路径选填
*/
@JSONField(name = "custom_app_brand_pass")
private String customAppBrandPass;
/**
* 礼品卡用属性自定义cell对应的小程序username格式为公众号原始id@app 选填
*/
@JSONField(name = "promotion_app_brand_user_name")
private String promotionAppBrandUserName;
/**
* 礼品卡用属性自定义cell对应的小程序路径
*/
@JSONField(name = "promotion_app_brand_pass")
private String promotionAppBrandPass;
private CouponBaseInfo(Builder builder) { private CouponBaseInfo(Builder builder) {
this.giftcardInfo = builder.giftcardInfo;
this.logoUrl = builder.logoUrl; this.logoUrl = builder.logoUrl;
this.maxGiveFriendTimes = builder.maxGiveFriendTimes;
this.brandName = builder.brandName; this.brandName = builder.brandName;
this.title = builder.title; this.title = builder.title;
this.codeType = builder.codeType; this.codeType = builder.codeType;
@ -176,12 +219,18 @@ public class CouponBaseInfo implements Serializable {
this.centerTitle = builder.centerTitle; this.centerTitle = builder.centerTitle;
this.centerUrl = builder.centerUrl; this.centerUrl = builder.centerUrl;
this.centerSubTitle = builder.centerSubTitle; this.centerSubTitle = builder.centerSubTitle;
this.centerAppBrandUserName = builder.centerAppBrandUserName;
this.centerAppBrandPass = builder.centerAppBrandPass;
this.customTitle = builder.customTitle; this.customTitle = builder.customTitle;
this.customUrl = builder.customUrl; this.customUrl = builder.customUrl;
this.customSubTitle = builder.customSubTitle; this.customSubTitle = builder.customSubTitle;
this.customAppBrandUserName = builder.customAppBrandUserName;
this.customAppBrandPass = builder.customAppBrandPass;
this.promotionTitle = builder.promotionTitle; this.promotionTitle = builder.promotionTitle;
this.promotionUrl = builder.promotionUrl; this.promotionUrl = builder.promotionUrl;
this.promotionSubTitle = builder.promotionSubTitle; this.promotionSubTitle = builder.promotionSubTitle;
this.promotionAppBrandUserName = builder.promotionAppBrandUserName;
this.promotionAppBrandPass = builder.promotionAppBrandPass;
this.source = builder.source; this.source = builder.source;
this.limitNum = builder.limitNum; this.limitNum = builder.limitNum;
this.canShare = builder.canShare; this.canShare = builder.canShare;
@ -301,23 +350,86 @@ public class CouponBaseInfo implements Serializable {
return needPushOnView; return needPushOnView;
} }
public JSONObject getGiftcardInfo() {
return giftcardInfo;
}
public int getMaxGiveFriendTimes() {
return maxGiveFriendTimes;
}
public Boolean getUseCustomCode() {
return useCustomCode;
}
public Boolean getBindOpenId() {
return bindOpenId;
}
public String getCenterAppBrandUserName() {
return centerAppBrandUserName;
}
public String getCenterAppBrandPass() {
return centerAppBrandPass;
}
public String getCustomAppBrandUserName() {
return customAppBrandUserName;
}
public String getCustomAppBrandPass() {
return customAppBrandPass;
}
public String getPromotionAppBrandUserName() {
return promotionAppBrandUserName;
}
public String getPromotionAppBrandPass() {
return promotionAppBrandPass;
}
@Override @Override
public String toString() { public String toString() {
return "logoUrl=" + logoUrl + ", brandName=" + brandName + ", title=" return "CouponBaseInfo{" +
+ title + ", codeType=" + codeType + ", cardColor=" + cardColor "giftcardInfo=" + giftcardInfo +
+ ", notice=" + notice + ", description=" + description ", maxGiveFriendTimes=" + maxGiveFriendTimes +
+ ", sku=" + sku + ", date=" + date + ", useCustomCode=" ", logoUrl='" + logoUrl + '\'' +
+ useCustomCode + ", bindOpenId=" + bindOpenId ", brandName='" + brandName + '\'' +
+ ", servicePhone=" + servicePhone + ", locationIds=" ", title='" + title + '\'' +
+ locationIds + ", useAllLocation=" + useAllLocation ", codeType=" + codeType +
+ ", centerTitle=" + centerTitle + ", centerUrl=" + centerUrl ", cardColor=" + cardColor +
+ ", centerSubTitle=" + centerSubTitle + ", customTitle=" ", notice='" + notice + '\'' +
+ customTitle + ", customUrl=" + customUrl ", description='" + description + '\'' +
+ ", customSubTitle=" + customSubTitle + ", promotionTitle=" ", sku=" + sku +
+ promotionTitle + ", promotionUrl=" + promotionUrl ", date=" + date +
+ ", promotionSubTitle=" + promotionSubTitle + ", source=" ", useCustomCode=" + useCustomCode +
+ source + ", limitNum=" + limitNum + ", canShare=" + canShare ", bindOpenId=" + bindOpenId +
+ ", canGiveFriend=" + canGiveFriend; ", servicePhone='" + servicePhone + '\'' +
", locationIds=" + locationIds +
", useAllLocation=" + useAllLocation +
", centerTitle='" + centerTitle + '\'' +
", centerUrl='" + centerUrl + '\'' +
", centerSubTitle='" + centerSubTitle + '\'' +
", customTitle='" + customTitle + '\'' +
", customUrl='" + customUrl + '\'' +
", customSubTitle='" + customSubTitle + '\'' +
", promotionTitle='" + promotionTitle + '\'' +
", promotionUrl='" + promotionUrl + '\'' +
", promotionSubTitle='" + promotionSubTitle + '\'' +
", source='" + source + '\'' +
", limitNum=" + limitNum +
", canShare=" + canShare +
", canGiveFriend=" + canGiveFriend +
", needPushOnView=" + needPushOnView +
", centerAppBrandUserName='" + centerAppBrandUserName + '\'' +
", centerAppBrandPass='" + centerAppBrandPass + '\'' +
", customAppBrandUserName='" + customAppBrandUserName + '\'' +
", customAppBrandPass='" + customAppBrandPass + '\'' +
", promotionAppBrandUserName='" + promotionAppBrandUserName + '\'' +
", promotionAppBrandPass='" + promotionAppBrandPass + '\'' +
'}';
} }
public void cleanCantUpdateField() { public void cleanCantUpdateField() {
@ -337,10 +449,18 @@ public class CouponBaseInfo implements Serializable {
* @since JDK 1.6 * @since JDK 1.6
*/ */
public static final class Builder { public static final class Builder {
/**
* 礼品卡信息目前只有一个礼品卡的价格属性必填
*/
private JSONObject giftcardInfo;
/** /**
* 卡券的商户logo建议像素为300*300 * 卡券的商户logo建议像素为300*300
*/ */
private String logoUrl; private String logoUrl;
/**
* 礼品卡最大可赠送次数必填
*/
private int maxGiveFriendTimes;
/** /**
* 商户名字,字数上限为12个汉字海底捞 * 商户名字,字数上限为12个汉字海底捞
*/ */
@ -452,11 +572,37 @@ public class CouponBaseInfo implements Serializable {
* 用户点击进入卡券时推送事件 * 用户点击进入卡券时推送事件
*/ */
private boolean needPushOnView; private boolean needPushOnView;
/**
* 自定义cell对应的小程序username格式为公众号原始id@appgh_86a091e50ad4@app 选填
*/
private String centerAppBrandUserName;
/**
* 自定义cell对应的小程序路径. pages/index/index 选填
*/
private String centerAppBrandPass;
/**
* 自定义cell对应的小程序username格式为公众号原始id@app 选填
*/
private String customAppBrandUserName;
/**
* 自定义cell对应的小程序路径选填
*/
private String customAppBrandPass;
/**
* 自定义cell对应的小程序username格式为公众号原始id@app
*/
private String promotionAppBrandUserName;
/**
* 自定义cell对应的小程序路径
*/
private String promotionAppBrandPass;
/** /**
* 默认永久有效 * 默认永久有效
*/ */
public Builder() { public Builder() {
this.giftcardInfo = new JSONObject();
this.maxGiveFriendTimes = 1;
this.sku = new JSONObject(); this.sku = new JSONObject();
this.date = new JSONObject(); this.date = new JSONObject();
this.date.put("type",CardActiveType.DATE_TYPE_PERMANENT); this.date.put("type",CardActiveType.DATE_TYPE_PERMANENT);
@ -466,6 +612,46 @@ public class CouponBaseInfo implements Serializable {
this.limitNum = 50; this.limitNum = 50;
} }
public Builder customAppBrandPass(String pass){
this.customAppBrandPass = pass;
return this;
}
public Builder centerAppBrandUserName(String name){
this.centerAppBrandUserName = name;
return this;
}
public Builder centerAppBrandPass(String pass){
this.centerAppBrandPass = pass;
return this;
}
public Builder customAppBrandUserName(String name){
this.customAppBrandUserName = name;
return this;
}
public Builder promotionAppBrandUserName(String userName){
this.promotionAppBrandUserName = userName;
return this;
}
public Builder promotionAppBrandPass(String pass){
this.promotionAppBrandPass = pass;
return this;
}
public Builder maxGiveFriendTimes(int times){
this.maxGiveFriendTimes = times;
return this;
}
public Builder price(int price){
this.giftcardInfo.put("price", price);
return this;
}
/** /**
* 设置商户logo * 设置商户logo
* *

View File

@ -0,0 +1,219 @@
package com.foxinmy.weixin4j.model.card;
import com.alibaba.fastjson.annotation.JSONField;
import com.foxinmy.weixin4j.type.card.CardType;
import com.foxinmy.weixin4j.type.card.SubCardType;
/**
* 储值类礼品卡
*
* @author kit(kit.li@qq.com)
* @date 2018年10月26日
*/
public class GiftCard extends CardCoupon {
/**
* 子卡券类型
*/
@JSONField(name = "sub_card_type")
private final String subCardType;
/**
* 礼品卡背景图片,非必需
*/
@JSONField(name = "background_pic_url")
private String backgroundPicUrl;
/**
* 是否支持积分填写true或者false默认为false
*/
@JSONField(name = "supply_bonus")
private boolean supplyBonus;
/**
* 是否支持余额填写true或者false默认为false
*/
@JSONField(name = "supply_balance")
private boolean supplyBalance;
/**
* 自定义会员信息类目会员卡激活后显示,包含name和url字段
*/
@JSONField(name = "custom_field1")
private MemCardCustomField customField1;
/**
* 自定义会员信息类目会员卡激活后显示,包含name和url字段
*/
@JSONField(name = "custom_field2")
private MemCardCustomField customField2;
/**
* 自定义会员信息类目会员卡激活后显示,包含name和url字段
*/
@JSONField(name = "custom_field3")
private MemCardCustomField customField3;
/**
* 是否自动激活若开发者不需要额外激活流程则填写true
*/
@JSONField(name = "auto_activate")
private boolean autoActivate;
/**
* 初始余额用户购买礼品卡后卡面上显示的初始余额
*/
@JSONField(name = "init_balance")
private Integer initBalance;
public GiftCard(CouponBaseInfo baseInfo, GiftCard.Builder builder){
super(baseInfo);
this.subCardType = SubCardType.VOUCHER.name();
this.autoActivate = builder.isAutoActivate();
this.backgroundPicUrl = builder.getBackgroundPicUrl();
this.customField1 = builder.getCustomField1();
this.customField2 = builder.getCustomField2();
this.customField3 = builder.getCustomField3();
this.supplyBalance = builder.isSupplyBalance();
this.supplyBonus = builder.isSupplyBonus();
this.initBalance = builder.getInitBalance();
}
@JSONField(serialize = false)
@Override
public CardType getCardType() {
return CardType.GENERAL_COUPON;
}
public static final class Builder {
private String backgroundPicUrl;
private boolean supplyBonus;
private boolean supplyBalance;
private boolean autoActivate;
private Integer initBalance;
private MemCardCustomField customField1;
private MemCardCustomField customField2;
private MemCardCustomField customField3;
public Builder(){
this.autoActivate = true;
this.supplyBalance = false;
this.supplyBonus = false;
}
public String getBackgroundPicUrl() {
return backgroundPicUrl;
}
public boolean isSupplyBonus() {
return supplyBonus;
}
public boolean isSupplyBalance() {
return supplyBalance;
}
public boolean isAutoActivate() {
return autoActivate;
}
public Integer getInitBalance() {
return initBalance;
}
public MemCardCustomField getCustomField1() {
return customField1;
}
public MemCardCustomField getCustomField2() {
return customField2;
}
public MemCardCustomField getCustomField3() {
return customField3;
}
/**
* 设置礼品卡背景图片
* @param url
* @return
*/
public Builder backgroundPicUrl(String url){
this.backgroundPicUrl = url;
return this;
}
/**
* 设置是否支持积分目前未清楚单品类礼品卡是否支持积分
* @param supplyBonus
* @return
*/
public Builder supplyBonus(boolean supplyBonus){
this.supplyBonus = supplyBonus;
return this;
}
/**
* 设置是否支持余额需礼品卡类型为GIFT_CARD单品类礼品卡VOUCHER并非用于储值
* 注意事项开发者仅能在supply_balance和custom_field1custom_field2custom_field3中选择最多3个填写否则报错
* @param supplyBalance
* @return
*/
public Builder supplyBalance(boolean supplyBalance){
this.supplyBalance = supplyBalance;
return this;
}
/**
* 设置礼品卡是否自动激活若开发者不需要额外激活流程则填写true
* @param autoActivate
* @return
*/
public Builder autoActivate(boolean autoActivate){
this.autoActivate = autoActivate;
return this;
}
/**
* 设置初始化的余额需礼品卡类型为GIFT_CARD单品类礼品卡VOUCHER并非用于储值
* @param initBalance
* @return
*/
public Builder initBalance(Integer initBalance){
this.initBalance = initBalance;
return this;
}
/**
* 设置自定义会员信息类目
* 注意事项开发者仅能在supply_balance和custom_field1custom_field2custom_field3中选择最多3个填写否则报错
* @param name 自定义信息类目名称
* @param url 自定义信息类目跳转url
* @return
*/
public Builder customField1(String name, String url){
MemCardCustomField field = new MemCardCustomField(name, url, null);
this.customField1 = field;
return this;
}
/**
* 设置自定义会员信息类目
* 注意事项开发者仅能在supply_balance和custom_field1custom_field2custom_field3中选择最多3个填写否则报错
* @param name 自定义信息类目名称
* @param url 自定义信息类目跳转url
* @return
*/
public Builder customField2(String name, String url){
MemCardCustomField field = new MemCardCustomField(name, url, null);
this.customField2 = field;
return this;
}
/**
* 设置自定义会员信息类目
* 注意事项开发者仅能在supply_balance和custom_field1custom_field2custom_field3中选择最多3个填写否则报错
* @param name 自定义信息类目名称
* @param url 自定义信息类目跳转url
* @return
*/
public Builder customField3(String name, String url){
MemCardCustomField field = new MemCardCustomField(name, url, null);
this.customField3 = field;
return this;
}
}
}

View File

@ -0,0 +1,11 @@
package com.foxinmy.weixin4j.model.card;
/**
* 礼品卡销售订单信息
*
* @author kit (kit.li@qq.com)
*/
public class GiftCardOrder {
private String orderId;
private String pageId;
}

View File

@ -0,0 +1,351 @@
package com.foxinmy.weixin4j.model.card;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 礼品卡货架
*
* @author kit(kit.li@qq.com)
* @date 2018年10月30日
*/
public class GiftCardPage {
@JSONField(name = "page_id")
private String pageId;
/**
* 礼品卡货架名称
*/
@JSONField(name = "page_title")
private String title;
/**
* 是否支持一次购买多张及发送至群填true或者false若填true则支持默认为false
*/
@JSONField(name = "support_multi")
private Boolean supportMulti;
/**
* 礼品卡货架是否支持买给自己填true或者false若填true则支持默认为false
*/
@JSONField(name = "support_buy_for_self")
private Boolean supportBuyForSelf;
/**
* 礼品卡货架主题页顶部banner图片须先将图片上传至CDN建议尺寸为750px*630px
*/
@JSONField(name = "banner_pic_url")
private String bannerPicUrl;
/**
* 主题结构体
*/
@JSONField(name = "theme_list")
private JSONArray themeList;
/**
* 主题分类列表
*/
@JSONField(name = "category_list")
private JSONArray categoryList;
/**
* 商家地址
*/
private String address;
/**
* 商家服务电话
*/
@JSONField(name = "service_phone")
private String servicePhone;
/**
* 商家使用说明用于描述退款发票等流程
*/
@JSONField(name = "biz_description")
private String description;
/**
* 该货架的订单是否支持开发票填true或者false若填true则需要使用API设置支付后开票功能默认为false
*/
@JSONField(name = "need_receipt")
private Boolean needReceipt;
/**
* 商家自定义链接用于承载退款发票等流程
*/
@JSONField(name = "cell_1")
private JSONObject cell1;
/**
* 商家自定义链接用于承载退款发票等流程
*/
@JSONField(name = "cell_2")
private JSONObject cell2;
public String getPageId() { return pageId; }
public String getTitle() {
return title;
}
public Boolean getSupportMulti() {
return supportMulti;
}
public Boolean getSupportBuyForSelf() {
return supportBuyForSelf;
}
public String getBannerPicUrl() {
return bannerPicUrl;
}
public JSONArray getThemeList() {
return themeList;
}
public JSONArray getCategoryList() {
return categoryList;
}
public String getAddress() {
return address;
}
public String getServicePhone() {
return servicePhone;
}
public String getDescription() {
return description;
}
public Boolean getNeedReceipt() {
return needReceipt;
}
public JSONObject getCell1() {
return cell1;
}
public JSONObject getCell2() {
return cell2;
}
public GiftCardPage(Builder builder){
this.pageId = builder.pageId;
this.address = builder.address;
this.bannerPicUrl = builder.bannerPicUrl;
this.categoryList = builder.categoryList;
this.cell1 = builder.cell1;
this.cell2 = builder.cell2;
this.description = builder.description;
this.needReceipt = builder.needReceipt;
this.servicePhone = builder.servicePhone;
this.supportBuyForSelf = builder.supportBuyForSelf;
this.supportMulti = builder.supportMulti;
this.themeList = builder.themeList;
this.title = builder.title;
}
public static class Builder{
/**
* 货架ID只在货架更新时用到
*/
private String pageId;
/**
* 礼品卡货架名称
*/
private String title;
/**
* 是否支持一次购买多张及发送至群填true或者false若填true则支持默认为false
*/
private Boolean supportMulti;
/**
* 礼品卡货架是否支持买给自己填true或者false若填true则支持默认为false
*/
private Boolean supportBuyForSelf;
/**
* 礼品卡货架主题页顶部banner图片须先将图片上传至CDN建议尺寸为750px*630px
*/
private String bannerPicUrl;
/**
* 主题结构体
*/
private JSONArray themeList;
/**
* 主题分类列表
*/
private JSONArray categoryList;
/**
* 商家地址
*/
private String address;
/**
* 商家服务电话
*/
private String servicePhone;
/**
* 商家使用说明用于描述退款发票等流程
*/
private String description;
/**
* 该货架的订单是否支持开发票填true或者false若填true则需要使用API设置支付后开票功能默认为false
*/
private Boolean needReceipt;
/**
* 商家自定义链接用于承载退款发票等流程
*/
private JSONObject cell1;
/**
* 商家自定义链接用于承载退款发票等流程
*/
private JSONObject cell2;
public Builder(){
this.themeList = new JSONArray();
this.categoryList = null;
}
public Builder pageId(String pageId){
this.pageId = pageId;
return this;
}
/**
* 设置礼品卡货架名称
*
* @param title
* @return
*/
public Builder title(String title){
this.title = title;
return this;
}
/**
* 设置是否支持一次购买多张及发送至群
*
* @param supportMulti
* @return
*/
public Builder supportMulti(boolean supportMulti){
this.supportMulti = Boolean.valueOf(supportMulti);
return this;
}
/**
* 设置礼品卡货架是否支持买给自己
*
* @param supportBuyForSelf
* @return
*/
public Builder supportBuyForSelf(boolean supportBuyForSelf){
this.supportBuyForSelf = Boolean.valueOf(supportBuyForSelf);
return this;
}
/**
* 设置礼品卡货架主题页顶部banner图片
*
* @param url
* @return
*/
public Builder bannerPicUrl(String url){
this.bannerPicUrl = url;
return this;
}
/**
* 添加一个主题
*
* @param theme
* @return
*/
public Builder themeList(PageTheme theme){
this.themeList.add(theme);
return this;
}
/**
* 添加一个主题分类
*
* @param title
* @return
*/
public Builder categoryList(String title){
if(this.categoryList==null){
this.categoryList = new JSONArray();
}
JSONObject category = new JSONObject();
category.put("title", title);
this.categoryList.add(category);
return this;
}
/**
* 设置商家地址
*
* @param address
* @return
*/
public Builder address(String address){
this.address = address;
return this;
}
/**
* 设置商家服务电话
*
* @param phoneNo
* @return
*/
public Builder servicePhone(String phoneNo){
this.servicePhone = phoneNo;
return this;
}
/**
* 设置商家使用说明
*
* @param description
* @return
*/
public Builder description(String description){
this.description = description;
return this;
}
/**
* 设置该货架的订单是否支持开发票
*
* @param needReceipt
* @return
*/
public Builder needReceipt(boolean needReceipt){
this.needReceipt = Boolean.valueOf(needReceipt);
return this;
}
/**
* 设置商家自定义链接
*
* @param title
* @param url
* @return
*/
public Builder cell1(String title, String url){
JSONObject cell = new JSONObject();
cell.put("title", title);
cell.put("url", url);
this.cell1 = cell;
return this;
}
/**
* 设置商家自定义链接
*
* @param title
* @param url
* @return
*/
public Builder cell2(String title, String url){
JSONObject cell = new JSONObject();
cell.put("title", title);
cell.put("url", url);
this.cell2 = cell;
return this;
}
}
}

View File

@ -0,0 +1,249 @@
package com.foxinmy.weixin4j.model.card;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 礼品卡货架主题
*
* @author kit(kit.li@qq.com)
* @date 2018年10月30日
*/
public class PageTheme {
/**
* 主题的封面图片须先将图片上传至CDN 大小控制在1000px*600px
*/
@JSONField(name = "theme_pic_url")
private String cover;
/**
* 主题名称圣诞感恩家人
*/
private String title;
/**
* 主题title的颜色直接传入色值
*/
@JSONField(name = "title_color")
private String titleColor;
/**
* 礼品卡列表表示主题可选择的礼品卡由cardid及标题文字组成
*/
@JSONField(name = "item_list")
private List<CardItem> itemList;
/**
* 礼品卡可选择的封面图
*/
@JSONField(name = "pic_item_list")
private List<PicItem> picItemList;
/**
* 当前主题所属主题分类的索引对应主题分类列表category_list内的title字段 若填写了category_list则每个主题必填该序号
*/
@JSONField(name = "category_index")
private Integer categoryIndex;
/**
* 该主题购买页是否突出商品名显示
*/
@JSONField(name = "show_sku_title_first")
private Boolean showSkuTitleFirst;
/**
* 是否将当前主题设置为banner主题主推荐
*/
@JSONField(name = "is_banner")
private Boolean bannerTheme;
public PageTheme(Builder builder){
this.cover = builder.cover;
this.title = builder.title;
this.titleColor = builder.titleColor;
this.itemList = builder.itemList;
this.picItemList = builder.picItemList;
this.categoryIndex = builder.categoryIndex;
this.showSkuTitleFirst = builder.showSkuTitleFirst;
this.bannerTheme = builder.bannerTheme;
}
public String getCover() {
return cover;
}
public String getTitle() {
return title;
}
public String getTitleColor() {
return titleColor;
}
public List<CardItem> getItemList() {
return itemList;
}
public List<PicItem> getPicItemList() {
return picItemList;
}
public Integer getCategoryIndex() {
return categoryIndex;
}
public Boolean getShowSkuTitleFirst() {
return showSkuTitleFirst;
}
public Boolean getBannerTheme() {
return bannerTheme;
}
public static class Builder{
/**
* 主题的封面图片须先将图片上传至CDN 大小控制在1000px*600px
*/
private String cover;
/**
* 主题名称圣诞感恩家人
*/
private String title;
/**
* 主题title的颜色直接传入色值
*/
private String titleColor;
/**
* 礼品卡列表表示主题可选择的礼品卡由cardid及标题文字组成
*/
private List<CardItem> itemList;
/**
* 礼品卡可选择的封面图
*/
private List<PicItem> picItemList;
/**
* 主题标号对应category_list内的title字段 若填写了category_list则每个主题必填该序号
*/
private Integer categoryIndex;
/**
* 该主题购买页是否突出商品名显示
*/
private Boolean showSkuTitleFirst;
/**
* 是否将当前主题设置为banner主题主推荐
*/
private Boolean bannerTheme;
public Builder(){
this.itemList = new ArrayList<CardItem>();
this.picItemList = new ArrayList<PicItem>();
}
/**
* 设置主题的封面图片
*
* @param cover
* @return
*/
public Builder cover(String cover){
this.cover = cover;
return this;
}
/**
* 设置主题名称
*
* @param title
* @return
*/
public Builder title(String title){
this.title = title;
return this;
}
/**
* 设置主题title的颜色
*
* @param titleColor
* 直接设置色值#FB966E
* @return
*/
public Builder titleColor(String titleColor){
this.titleColor = titleColor;
return this;
}
/**
* 添加一个或多个礼品卡内容
*
* @param items
* @return
*/
public Builder cardItems(CardItem... items){
this.itemList = Arrays.asList(items);
return this;
}
/**
* 添加一个礼品卡内容
*
* @param item
* @return
*/
public Builder addCardItem(CardItem item){
this.itemList.add(item);
return this;
}
/**
* 添加一个或多个礼品卡封面图
*
* @param items
* @return
*/
public Builder picItems(PicItem... items){
this.picItemList = Arrays.asList(items);
return this;
}
/**
* 添加一个礼品卡封面图
*
* @param item
* @return
*/
public Builder addPicItem(PicItem item){
this.picItemList.add(item);
return this;
}
/**
* 设置所属主题分类的索引号
*
* @param index
* @return
*/
public Builder categoryIndex(Integer index){
this.categoryIndex = index;
return this;
}
/**
* 设置该主题购买页是否突出商品名显示
*
* @param isShow
* @return
*/
public Builder showSkuTitleFirst(Boolean isShow){
this.showSkuTitleFirst = isShow;
return this;
}
/**
* 设置是否将当前主题设置为banner主题主推荐
*
* @param isBanner
* @return
*/
public Builder bannerTheme(Boolean isBanner){
this.bannerTheme = isBanner;
return this;
}
}
}

View File

@ -0,0 +1,66 @@
package com.foxinmy.weixin4j.model.card;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 礼品卡货架主题中的卡面结构体
*
* @author kit(kit.li@qq.com)
* @date 2018年10月30日
*/
public class PicItem {
/**
* 卡面图片须先将图片上传至CDN大小控制在1000 x 600像素以下
*/
@JSONField(name = "background_pic_url")
private String backgroundPicUrl;
/**
* 自定义的卡面的标识, 非必填
*/
@JSONField(name = "outer_img_id")
private String outerImgId;
/**
* 该卡面对应的默认祝福语当用户没有编辑内容时会随卡默认填写为用户祝福内容
*/
@JSONField(name = "default_gifting_msg")
private String defaultGiftingMsg;
public PicItem(){
}
public PicItem(String backgroundPicUrl, String defaultGiftingMsg) {
this.backgroundPicUrl = backgroundPicUrl;
this.defaultGiftingMsg = defaultGiftingMsg;
}
public PicItem(String backgroundPicUrl, String outerImgId, String defaultGiftingMsg) {
this.backgroundPicUrl = backgroundPicUrl;
this.outerImgId = outerImgId;
this.defaultGiftingMsg = defaultGiftingMsg;
}
public String getBackgroundPicUrl() {
return backgroundPicUrl;
}
public String getOuterImgId() {
return outerImgId;
}
public String getDefaultGiftingMsg() {
return defaultGiftingMsg;
}
public void setBackgroundPicUrl(String backgroundPicUrl) {
this.backgroundPicUrl = backgroundPicUrl;
}
public void setOuterImgId(String outerImgId) {
this.outerImgId = outerImgId;
}
public void setDefaultGiftingMsg(String defaultGiftingMsg) {
this.defaultGiftingMsg = defaultGiftingMsg;
}
}

View File

@ -0,0 +1,122 @@
package com.foxinmy.weixin4j.model.card;
import com.alibaba.fastjson.annotation.JSONField;
import com.foxinmy.weixin4j.type.card.CardType;
import com.foxinmy.weixin4j.type.card.SubCardType;
/**
* 单品类型礼品卡
* 指该礼品卡用于兑换指定单品如汉堡礼品卡
*
* @className VoucherCardCoupon
* @author kit(kit.li@qq.com)
* @date 2018年10月23日
*/
public class VoucherCard extends CardCoupon {
/**
* 子卡券类型
*/
@JSONField(name = "sub_card_type")
private final String subCardType;
/**
* 礼品卡背景图片,非必需
*/
@JSONField(name = "background_pic_url")
private String backgroundPicUrl;
/**
* 是否支持积分填写true或者false默认为false
*/
@JSONField(name = "supply_bonus")
private boolean supplyBonus;
/**
* 是否支持余额填写true或者false默认为false
*/
@JSONField(name = "supply_balance")
private boolean supplyBalance;
/**
* 自定义会员信息类目会员卡激活后显示,包含name和url字段
*/
@JSONField(name = "custom_field1")
private MemCardCustomField customField1;
/**
* 自定义会员信息类目会员卡激活后显示,包含name和url字段
*/
@JSONField(name = "custom_field2")
private MemCardCustomField customField2;
/**
* 自定义会员信息类目会员卡激活后显示,包含name和url字段
*/
@JSONField(name = "custom_field3")
private MemCardCustomField customField3;
/**
* 是否自动激活若开发者不需要额外激活流程则填写true
*/
@JSONField(name = "auto_activate")
private boolean autoActivate;
public String getSubCardType() {
return subCardType;
}
public String getBackgroundPicUrl() {
return backgroundPicUrl;
}
public boolean isSupplyBonus() {
return supplyBonus;
}
public boolean isSupplyBalance() {
return supplyBalance;
}
public MemCardCustomField getCustomField1() {
return customField1;
}
public MemCardCustomField getCustomField2() {
return customField2;
}
public MemCardCustomField getCustomField3() {
return customField3;
}
public boolean isAutoActivate() {
return autoActivate;
}
public VoucherCard(CouponBaseInfo baseInfo, GiftCard.Builder builder){
super(baseInfo);
this.subCardType = SubCardType.VOUCHER.name();
this.autoActivate = builder.isAutoActivate();
this.backgroundPicUrl = builder.getBackgroundPicUrl();
this.customField1 = builder.getCustomField1();
this.customField2 = builder.getCustomField2();
this.customField3 = builder.getCustomField3();
this.supplyBalance = false;
this.supplyBonus = builder.isSupplyBonus();;
}
@JSONField(serialize = false)
@Override
public CardType getCardType() {
return CardType.GENERAL_CARD;
}
@Override
public String toString() {
return "VoucherCardCoupon [" +
"subCardType='" + subCardType + '\'' +
", backgroundPicUrl='" + backgroundPicUrl + '\'' +
", supplyBonus=" + supplyBonus +
", supplyBalance=" + supplyBalance +
", customField1=" + customField1 +
", customField2=" + customField2 +
", customField3=" + customField3 +
", autoActivate=" + autoActivate +
", " + super.toString() +
']';
}
}

View File

@ -15,7 +15,9 @@ import com.alibaba.fastjson.annotation.JSONField;
* @date 2014年8月19日 * @date 2014年8月19日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class JsPayNotify extends PayBaseInfo { public class JsPayNotify extends PayBaseInfo {

View File

@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.type.SignType;
* @date 2014年11月5日 * @date 2014年11月5日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PayBaseInfo implements Serializable { public class PayBaseInfo implements Serializable {

View File

@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @author jinyu(foxinmy@gmail.com) * @author jinyu(foxinmy@gmail.com)
* @date 2014年12月18日 * @date 2014年12月18日
* @since JDK 1.6 * @since JDK 1.6
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PayPackage extends MerchantResult { public class PayPackage extends MerchantResult {

View File

@ -10,6 +10,7 @@ import com.alibaba.fastjson.annotation.JSONField;
import com.foxinmy.weixin4j.util.DateUtil; import com.foxinmy.weixin4j.util.DateUtil;
import com.foxinmy.weixin4j.util.RandomUtil; import com.foxinmy.weixin4j.util.RandomUtil;
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PayRequest extends PayBaseInfo { public class PayRequest extends PayBaseInfo {

View File

@ -56,7 +56,9 @@ import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
* @date 2015年1月3日 * @date 2015年1月3日
* @since JDK 1.6 * @since JDK 1.6
* @see <a href="http://pay.weixin.qq.com/wiki/doc/api/index.html">商户平台支付API</a> * @see <a href="http://pay.weixin.qq.com/wiki/doc/api/index.html">商户平台支付API</a>
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class WeixinPayProxy { public class WeixinPayProxy {
/** /**

View File

@ -22,7 +22,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2015年3月27日 * @date 2015年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class CouponDetail extends MerchantResult { public class CouponDetail extends MerchantResult {

View File

@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.payment.mch.MerchantResult;
* @date 2015年3月25日 * @date 2015年3月25日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class CouponResult extends MerchantResult { public class CouponResult extends MerchantResult {

View File

@ -21,7 +21,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2015年3月27日 * @date 2015年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class CouponStock extends MerchantResult { public class CouponStock extends MerchantResult {

View File

@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.type.mch.CouponType;
* @date 2015年3月24日 * @date 2015年3月24日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class OrderCouponInfo implements Serializable { public class OrderCouponInfo implements Serializable {

View File

@ -17,7 +17,9 @@ import com.alibaba.fastjson.annotation.JSONField;
* @date 2015年3月24日 * @date 2015年3月24日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class RefundCouponInfo implements Serializable { public class RefundCouponInfo implements Serializable {

View File

@ -21,7 +21,9 @@ import com.foxinmy.weixin4j.util.MapUtil;
* @see com.foxinmy.weixin4j.payment.PayRequest * @see com.foxinmy.weixin4j.payment.PayRequest
* @see <a href= * @see <a href=
* "https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=8_1">APP支付</a> * "https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=8_1">APP支付</a>
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class APPPayRequest extends AbstractPayRequest { public class APPPayRequest extends AbstractPayRequest {
public APPPayRequest(String prePayId, WeixinPayAccount payAccount) { public APPPayRequest(String prePayId, WeixinPayAccount payAccount) {
super(prePayId, payAccount); super(prePayId, payAccount);

View File

@ -4,6 +4,7 @@ import com.foxinmy.weixin4j.model.WeixinPayAccount;
import com.foxinmy.weixin4j.sign.WeixinPaymentSignature; import com.foxinmy.weixin4j.sign.WeixinPaymentSignature;
import com.foxinmy.weixin4j.sign.WeixinSignature; import com.foxinmy.weixin4j.sign.WeixinSignature;
@Deprecated
public abstract class AbstractPayRequest implements MchPayRequest { public abstract class AbstractPayRequest implements MchPayRequest {
private final String prePayId; private final String prePayId;

View File

@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2015年4月1日 * @date 2015年4月1日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class CorpPayment extends MerchantResult { public class CorpPayment extends MerchantResult {

View File

@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2015年6月23日 * @date 2015年6月23日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class CorpPaymentRecord extends MerchantResult { public class CorpPaymentRecord extends MerchantResult {

View File

@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2015年4月1日 * @date 2015年4月1日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class CorpPaymentResult extends MerchantResult { public class CorpPaymentResult extends MerchantResult {

View File

@ -15,7 +15,9 @@ import com.foxinmy.weixin4j.type.CustomsCity;
* @date 2016年3月27日 * @date 2016年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class CustomsOrder extends MerchantResult { public class CustomsOrder extends MerchantResult {
private static final long serialVersionUID = 799510373861612386L; private static final long serialVersionUID = 799510373861612386L;

View File

@ -15,7 +15,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
* @date 2016年3月27日 * @date 2016年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class CustomsOrderRecord extends MerchantResult { public class CustomsOrderRecord extends MerchantResult {
private static final long serialVersionUID = -1675090110657154049L; private static final long serialVersionUID = -1675090110657154049L;

View File

@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2016年3月27日 * @date 2016年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class CustomsOrderResult extends MerchantResult { public class CustomsOrderResult extends MerchantResult {
private static final long serialVersionUID = 799510373861612386L; private static final long serialVersionUID = 799510373861612386L;

View File

@ -22,7 +22,9 @@ import com.foxinmy.weixin4j.type.TradeType;
* @see com.foxinmy.weixin4j.payment.PayRequest * @see com.foxinmy.weixin4j.payment.PayRequest
* @see <a * @see <a
* href="https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_1">网页端调起支付API</a> * href="https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_1">网页端调起支付API</a>
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class JSAPIPayRequest extends AbstractPayRequest { public class JSAPIPayRequest extends AbstractPayRequest {
public JSAPIPayRequest(String prePayId, WeixinPayAccount payAccount) { public JSAPIPayRequest(String prePayId, WeixinPayAccount payAccount) {

View File

@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.type.TradeType;
* @see com.foxinmy.weixin4j.payment.PayRequest * @see com.foxinmy.weixin4j.payment.PayRequest
* @see <a * @see <a
* href="https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=5_1">刷卡支付</a> * href="https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=5_1">刷卡支付</a>
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class MICROPayRequest extends Order implements MchPayRequest { public class MICROPayRequest extends Order implements MchPayRequest {
private static final long serialVersionUID = 6147576305404111278L; private static final long serialVersionUID = 6147576305404111278L;

View File

@ -20,7 +20,9 @@ import com.foxinmy.weixin4j.type.TradeType;
* @date 2014年10月21日 * @date 2014年10月21日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class MchPayPackage extends PayPackage { public class MchPayPackage extends PayPackage {

View File

@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.type.TradeType;
* @see MICROPayRequest 刷卡支付 * @see MICROPayRequest 刷卡支付
* @see APPPayRequest APP支付 * @see APPPayRequest APP支付
* @see WAPPayRequest WAP支付 * @see WAPPayRequest WAP支付
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public interface MchPayRequest { public interface MchPayRequest {
/** /**
* 预支付交易ID * 预支付交易ID

View File

@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.type.SignType;
* @date 2014年10月21日 * @date 2014年10月21日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class MerchantResult extends XmlResult { public class MerchantResult extends XmlResult {

View File

@ -13,7 +13,9 @@ import com.foxinmy.weixin4j.type.CurrencyType;
* @date 2016年7月21日 * @date 2016年7月21日
* @since JDK 1.7 * @since JDK 1.7
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class MerchantTradeResult extends MerchantResult { public class MerchantTradeResult extends MerchantResult {
private static final long serialVersionUID = 4205906286092873877L; private static final long serialVersionUID = 4205906286092873877L;

View File

@ -15,7 +15,9 @@ import com.foxinmy.weixin4j.type.TradeType;
* @see com.foxinmy.weixin4j.payment.PayRequest * @see com.foxinmy.weixin4j.payment.PayRequest
* @see <a * @see <a
* href="https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1">NATIVE扫码支付(模式二)</a> * href="https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1">NATIVE扫码支付(模式二)</a>
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class NATIVEPayRequest extends AbstractPayRequest { public class NATIVEPayRequest extends AbstractPayRequest {
private final String codeUrl; private final String codeUrl;

View File

@ -15,7 +15,9 @@ import com.alibaba.fastjson.annotation.JSONField;
* @date 2014年10月30日 * @date 2014年10月30日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class NativePayNotify extends OpenIdResult { public class NativePayNotify extends OpenIdResult {

View File

@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.util.RandomUtil;
* @date 2014年10月28日 * @date 2014年10月28日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class NativePayResponse extends MerchantResult { public class NativePayResponse extends MerchantResult {

View File

@ -15,7 +15,9 @@ import com.alibaba.fastjson.annotation.JSONField;
* @date 2015年7月23日 * @date 2015年7月23日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class OpenIdResult extends MerchantResult { public class OpenIdResult extends MerchantResult {

View File

@ -25,7 +25,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
* @date 2014年11月2日 * @date 2014年11月2日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class Order extends MerchantTradeResult { public class Order extends MerchantTradeResult {

View File

@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.type.TradeType;
* @date 2014年10月21日 * @date 2014年10月21日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PrePay extends MerchantResult { public class PrePay extends MerchantResult {

View File

@ -20,7 +20,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* href="https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_1">普通红包</a> * href="https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_1">普通红包</a>
* @see <a * @see <a
* href="https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=16_1">裂变红包</a> * href="https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=16_1">裂变红包</a>
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class Redpacket extends MerchantResult { public class Redpacket extends MerchantResult {

View File

@ -25,7 +25,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2015年6月4日 * @date 2015年6月4日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class RedpacketRecord extends XmlResult { public class RedpacketRecord extends XmlResult {

View File

@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.util.MapUtil;
* @date 2017年1月4日 * @date 2017年1月4日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class RedpacketRisk { public class RedpacketRisk {
private Map<String, String> risk; private Map<String, String> risk;

View File

@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @date 2015年4月1日 * @date 2015年4月1日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class RedpacketSendResult extends MerchantResult { public class RedpacketSendResult extends MerchantResult {

View File

@ -24,7 +24,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
* @author jinyu(foxinmy@gmail.com) * @author jinyu(foxinmy@gmail.com)
* @date 2016年7月21日 * @date 2016年7月21日
* @since JDK 1.6 * @since JDK 1.6
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class RefundDetail implements Serializable { public class RefundDetail implements Serializable {

View File

@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
* @author jinyu(foxinmy@gmail.com) * @author jinyu(foxinmy@gmail.com)
* @date 2014年11月1日 * @date 2014年11月1日
* @since JDK 1.6 * @since JDK 1.6
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class RefundRecord extends MerchantTradeResult { public class RefundRecord extends MerchantTradeResult {

View File

@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
* @date 2014年11月6日 * @date 2014年11月6日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class RefundResult extends MerchantTradeResult { public class RefundResult extends MerchantTradeResult {

View File

@ -4,6 +4,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class SceneInfoApp { public class SceneInfoApp {

View File

@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
@Deprecated
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class SceneInfoStore { public class SceneInfoStore {

View File

@ -17,6 +17,7 @@ import com.foxinmy.weixin4j.util.DateUtil;
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
*/ */
@Deprecated
public class SettlementRecord extends MerchantResult { public class SettlementRecord extends MerchantResult {
private static final long serialVersionUID = 7952659545609519979L; private static final long serialVersionUID = 7952659545609519979L;

View File

@ -16,6 +16,7 @@ import com.foxinmy.weixin4j.type.TradeType;
* @see <a * @see <a
* href="https://pay.weixin.qq.com/wiki/doc/api/wap.php?chapter=15_1">WAP支付</a> * href="https://pay.weixin.qq.com/wiki/doc/api/wap.php?chapter=15_1">WAP支付</a>
*/ */
@Deprecated
public class WAPPayRequest extends AbstractPayRequest { public class WAPPayRequest extends AbstractPayRequest {
/** /**
* 微信支付URL * 微信支付URL

View File

@ -10,7 +10,9 @@ import com.foxinmy.weixin4j.util.MapUtil;
* @date 2016年3月26日 * @date 2016年3月26日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public abstract class AbstractWeixinSignature implements WeixinSignature { public abstract class AbstractWeixinSignature implements WeixinSignature {
/** /**
* 是否编码 * 是否编码

View File

@ -12,7 +12,9 @@ import com.foxinmy.weixin4j.util.DigestUtil;
* @since JDK 1.6 * @since JDK 1.6
* @see <a * @see <a
* href="https://pay.weixin.qq.com/wiki/doc/api/external/jsapi.php?chapter=4_3">支付签名说明</a> * href="https://pay.weixin.qq.com/wiki/doc/api/external/jsapi.php?chapter=4_3">支付签名说明</a>
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class WeixinPaymentSignature extends AbstractWeixinSignature { public class WeixinPaymentSignature extends AbstractWeixinSignature {
/** /**
* 支付密钥 * 支付密钥

View File

@ -10,7 +10,9 @@ import com.foxinmy.weixin4j.type.SignType;
* @date 2016年3月26日 * @date 2016年3月26日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public interface WeixinSignature { public interface WeixinSignature {
/** /**
* 是否编码 * 是否编码

View File

@ -9,7 +9,9 @@ package com.foxinmy.weixin4j.type;
* @date 2015年8月19日 * @date 2015年8月19日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum BankType { public enum BankType {
/** /**
* 工商银行借记卡 * 工商银行借记卡

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2016年3月27日 * @date 2016年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CredentialType { public enum CredentialType {
IDCARD("身份证"); IDCARD("身份证");
CredentialType(String name) { CredentialType(String name) {

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2014年11月2日 * @date 2014年11月2日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CurrencyType { public enum CurrencyType {
CNY("人民币"), HKD("港元"), TWD("台币"), EUR("欧元"), USD("美元"), GBP("英镑"), JPY("日元"), CAD( CNY("人民币"), HKD("港元"), TWD("台币"), EUR("欧元"), USD("美元"), GBP("英镑"), JPY("日元"), CAD(
"加拿大元"), AUD("澳大利亚元"), NZD("新西兰元"), KRW("韩元"), THB("泰铢"); "加拿大元"), AUD("澳大利亚元"), NZD("新西兰元"), KRW("韩元"), THB("泰铢");

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2016年3月27日 * @date 2016年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CustomsCity { public enum CustomsCity {
NO("无需上报海关"), GUANGZHOU("广州"), HANGZHOU("杭州"), NINGBO("宁波"), ZHENGZHOU_BS( NO("无需上报海关"), GUANGZHOU("广州"), HANGZHOU("杭州"), NINGBO("宁波"), ZHENGZHOU_BS(
"郑州(保税物流中心)"), CHONGQING("重庆"), XIAN("西安"), SHANGHAI("上海"), ZHENGZHOU_ZH( "郑州(保税物流中心)"), CHONGQING("重庆"), XIAN("西安"), SHANGHAI("上海"), ZHENGZHOU_ZH(

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2016年3月27日 * @date 2016年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CustomsSatus { public enum CustomsSatus {
UNDECLARED("未申报"), SUBMITTED("申报已提交"), PROCESSING("申报中"), SUCCESS("申报成功"), FAIL( UNDECLARED("未申报"), SUBMITTED("申报已提交"), PROCESSING("申报中"), SUCCESS("申报成功"), FAIL(
"申报失败"), EXCEPT("海关接口异常"); "申报失败"), EXCEPT("海关接口异常");

View File

@ -10,7 +10,9 @@ import java.io.Serializable;
* @date 2014年11月1日 * @date 2014年11月1日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public class IdQuery implements Serializable { public class IdQuery implements Serializable {
private static final long serialVersionUID = -5273675987521807370L; private static final long serialVersionUID = -5273675987521807370L;

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2014年11月1日 * @date 2014年11月1日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum IdType { public enum IdType {
/** /**
* 微信退款单号 * 微信退款单号

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2014年11月5日 * @date 2014年11月5日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum SignType { public enum SignType {
SHA1, MD5, HMAC$SHA256 SHA1, MD5, HMAC$SHA256
} }

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2016年12月21日 * @date 2016年12月21日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum TarType { public enum TarType {
GZIP GZIP
} }

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2014年11月2日 * @date 2014年11月2日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum TradeState { public enum TradeState {
/** /**
* 支付成功 * 支付成功

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
* @date 2014年10月21日 * @date 2014年10月21日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到weixin4j-pay子模块
*/ */
@Deprecated
public enum TradeType { public enum TradeType {
/** /**
* JS支付 * JS支付

View File

@ -34,5 +34,10 @@ public enum CardType {
/** /**
* 会员卡 * 会员卡
*/ */
MEMBER_CARD; MEMBER_CARD,
/**
* 通用礼品
*/
GENERAL_CARD
} }

View File

@ -0,0 +1,19 @@
package com.foxinmy.weixin4j.type.card;
/**
* 礼品卡类型
*
* @className SubCardType
* @author kit(kit.li@qq.com)
* @date 2018年10月23日
*/
public enum SubCardType {
/**
* 礼品卡
*/
GIFT_CARD,
/**
* 兑换卡
*/
VOUCHER
}

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2014年10月31日 * @date 2014年10月31日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum BillType { public enum BillType {
/** /**
* 全部 * 全部

View File

@ -9,6 +9,7 @@ package com.foxinmy.weixin4j.type.mch;
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
*/ */
@Deprecated
public enum CorpPaymentCheckNameType { public enum CorpPaymentCheckNameType {
/** /**
* 不校验真实姓名 * 不校验真实姓名

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2015年3月27日 * @date 2015年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CouponStatus { public enum CouponStatus {
/** /**
* 已激活 * 已激活

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2015年3月27日 * @date 2015年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CouponStockStatus { public enum CouponStockStatus {
/** /**
* 未激活 * 未激活

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2015年3月27日 * @date 2015年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CouponStockType { public enum CouponStockType {
/** /**
* 批量型 * 批量型

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2015年3月27日 * @date 2015年3月27日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum CouponType { public enum CouponType {
/** /**
* 使用无门槛 * 使用无门槛

View File

@ -7,7 +7,9 @@ package com.foxinmy.weixin4j.type.mch;
* @author jinyu(foxinmy@gmail.com) * @author jinyu(foxinmy@gmail.com)
* @date 2017年1月4日 * @date 2017年1月4日
* @since JDK 1.6 * @since JDK 1.6
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum RedpacketSceneType { public enum RedpacketSceneType {
/** /**
* 商品促销 * 商品促销

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2015年6月4日 * @date 2015年6月4日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum RedpacketSendType { public enum RedpacketSendType {
/** /**
* 通过API接口发放 * 通过API接口发放

View File

@ -7,7 +7,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2015年6月4日 * @date 2015年6月4日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum RedpacketStatus { public enum RedpacketStatus {
/** /**
* 发放中 * 发放中

View File

@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
* @date 2015年6月4日 * @date 2015年6月4日
* @since JDK 1.6 * @since JDK 1.6
* @see * @see
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum RedpacketType { public enum RedpacketType {
/** /**
* 裂变红包 * 裂变红包

View File

@ -5,7 +5,9 @@ package com.foxinmy.weixin4j.type.mch;
* @className RefundAccountType * @className RefundAccountType
* @author jinyu(foxinmy@gmail.com) * @author jinyu(foxinmy@gmail.com)
* @date 2016年12月12日 * @date 2016年12月12日
* @deprecated 迁移到子模块weixin4j-pay
*/ */
@Deprecated
public enum RefundAccountType { public enum RefundAccountType {
/** /**
* ---未结算资金退款默认使用未结算资金退款 * ---未结算资金退款默认使用未结算资金退款

Some files were not shown because too many files have changed in this diff Show More