Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 74 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# ChangeLog

## 2.5.6

- 更新: `RequestOptions` 新增`Ping++`验签公钥设置参数

## 2.5.5

-更新: 退款 refund 新增返回 `app` 参数.

## 2.5.4

- 修正: 修复版本 2.5.3 中存在的 POM 依赖问题。建议用户直接升级到此版本。
Expand Down Expand Up @@ -30,12 +38,13 @@

> 本次更新有较多与旧版本不兼容的地方。

- 修改: 支持 JDK 8 及以上;
- 修改: 支持 JDK 8 及以上;
- 修改: 异常抛出修改,统一声明为 `PingppException`,实际使用可以再做具体判断;
- 废弃: 原接口,支持传 `apiKey` 参数的方法,全部删除,可以用 `RequestOptions` 代替;
- 新增: 每个接口最后一个参数支持 `RequestOptions`;
- 新增: `PingppException` 增加 `type`、`code`、`statusCode`;
- 新增: 对象增加 `getLastResponse()` 方法,可以用于获取当前这次请求的 `response` 对象,包含 `HTTP Status Code`、`Headers`、`Response Body` 等;
- 新增: 对象增加 `getLastResponse()` 方法,可以用于获取当前这次请求的 `response` 对象,包含 `HTTP Status Code`、`Headers`、
`Response Body` 等;
- 废弃: 取消对 `PKCS1` 格式私钥的支持,请转成 `PKCS8` 再使用;

---
Expand Down Expand Up @@ -86,163 +95,225 @@
- 移除 `PingppAccount`

## 2.3.8 (2018-05-22)

#### 新增

- WxLiteOAuth 接口
- Agreement 接口

#### 修改

- 合并部分内部类
- WxpubOAuth 接口错误时增加异常

## 2.3.7 (2018-03-16)

#### 新增

- BalanceSettlement 接口
- CardInfo 接口

## 2.3.5 (2018-02-27)

#### 修正

- 部分对象字段从 Integer 改成 Long

## 2.3.4 (2018-01-10)

#### 修改

- 移除已废弃接口
- 移除 transfer、batch_transfer 取消接口
- 更新示例
- 移除 order user_from 字段
- settle_account 字段更新

## 2.3.3 (2017-12-27)

#### 修正

- 修正 javadoc

## 2.3.2 (2017-12-21)

#### 修正

- 兼容 JDK 1.7

## 2.3.1 (2017-12-08)

#### 修正

- Event 解析修正

## 2.3.0 (2017-12-01)

#### 更改

- 合并账户系统相关接口

## 2.2.5 (2017-10-10)

#### 新增

- 新增重试机制

#### 修改

- 优化 SDK

## 2.2.4 (2017-06-19)

#### 修改

- Charge 增加字段 reversed,表示是否已撤销
- 针对渠道 isv_scan, isv_qr_isv_wap 增加撤销方法,`Charge.reverse(CHARGE_ID)`
- Refund 增加 extra 字段

## 2.2.3 (2017-03-27)

#### 修改

- BatchTransfer 增加字段

## 2.2.2 (2017-03-21)

#### 修正

- alipay_pc_direct/alipay_wap 渠道 credential 字段类型的修正

## 2.2.1 (2017-01-13)

#### 新增

- 添加 gradle 相关文件
- 添加部分测试文件
- batch_transfer 更新/取消接口

#### 修改

- 更改签名私钥获取方式
- Charge.list app[id] 参数改为必传
- 红包去除多余的参数
- batch_refund charges 字段格式修改

#### 修正

- Webhooks 解析对象 batch_refund、batch_transfer、customs 对应事件错误

## 2.2.0

#### 新增

- 添加 BatchRefund、BatchTransfer、Customs

#### 修改

- 签名生成规则变更
- 列表查询接口换成 `list` 方法,代替 `all` 方法
- 退款接口调用方式变更,直接使用 Refund 对象
- Refund 对象添加 charge_order_no, transaction_no 属性

## 2.1.9

#### 修改
- 添加 RateLimitException

- 添加 RateLimitException
- 兼容 http 地址,仅为方便测试

## 2.1.8

#### 新增

- Identification 身份证银行卡接口

## 2.1.7

#### 修正

- RedEnvelope、Transfer 添加字段

## 2.1.6

#### 修正

- 签名内容编码问题

## 2.1.5

#### 修改

- 补充 RedEnvelope、Transfer 缺少字段

## 2.1.4

#### 修改

- 更改 content-type 为 application/json

## 2.1.3

- 兼容两种微信公众号接入方式

## 2.1.2

- 补全确实字段
- 修正 Event 解析
- 修正部分字符 JSON 序列化问题
- 添加请求签名

## 2.1.1

- 修正 extra 类型
- 兼容 jdk 1.6

## 2.1.0

- 添加应用内快捷支付对应接口

## 2.0.10

- 增加 Refund 对象 status 字段

## 2.0.8

- 增加 ChannelException

## 2.0.6

- 增加企业转账、修改红包接口

## 2.0.5

- 增加 event sdk

## 2.0.4

- 更改 sdk 目录格式,修复wx_pub渠道timeStamp 类型问题。

## 2.0.3

- 增加 apple pay ,重写 getcredential 方法。

## 2.0.2

- 增加微信红包

## 2.0.1

#### 更改

修改 wx credential 里的 timeStamp 类型为字符串,防止变成科学计数法

## 2.0.0

#### 更改

添加新渠道支持:百付宝、百付宝WAP、微信公众平台

## 1.0.4

#### 更改:

添加 `Expanding` 机制
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mavenCentral
<dependency>
<groupId>com.pingxx</groupId>
<artifactId>pingpp-java</artifactId>
<version>2.5.4</version>
<version>2.5.6</version>
<type>jar</type>
</dependency>
```
Expand All @@ -56,7 +56,7 @@ repositories {
安装 Ping++ SDK

```
implementation 'com.pingxx:pingpp-java:2.5.4'
implementation 'com.pingxx:pingpp-java:2.5.6'
```

## 初始化
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.4
2.5.6
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
// 方法 1. 本地文件系统依赖
// implementation fileTree(dir: 'lib', includes: ['*jar'])
// 方法 2. 仓库依赖
// implementation 'com.pingxx:pingpp-java:2.5.4'
// implementation 'com.pingxx:pingpp-java:2.5.6'
// 方法 3.模块依赖
implementation project(':pingpp-sdk')
}
13 changes: 5 additions & 8 deletions example/src/main/resources/pingpp_public_key.pem
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoXV1qdwYGq6lac+EIVxx
1/wGcjjy5InO08QBvUGDQMKAWjg/UvnNmnTZJvxUu18UVtwoHIls24EHZ96im3k0
DPn43aSGyR417g9rqUL2N1H/0dCNcT8LY8sZL/sw/IV//IQcZYv/8EO6+7SClw+G
Jpib84QfmDgUPbQC0dhl1R1Q8e8RoE/+70yX6OY22kRr14KjRZiVQ0UMZS5KaPwS
FJ1egyNDCLFoLyhRQMV5vDxMdpIvxZuGW+3aTZkW8v/ISXWmSFpI/dlpxHp0+h6p
sdai2RzXYuyzbeOPyQEZkyGfR6BX2Gv/l80nEFNup7uNmAt/be9IdpSZlxpF4HlI
8wIDAQAB
-----END PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCJqcTaGUab0vBZSkGNE1AaGiY
RcbPd7QdCQuM8EpbEpEQGr9/NjbJHCLd3eaUmYM0vy34Wux+VHnw4ckiDfBuW6/Z
fIo5GBRCI/nZLOnWcOX98ZAXYnn/VVJXuBtHtHL8DWEbYmMp+Gl4k1rFSuQKk52k
YLXeFJZJV8CBV5jA+wIDAQAB
-----END PUBLIC KEY-----
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://mirrors.aliyun.com/macports/distfiles/gradle/gradle-8.6-all.zip
2 changes: 1 addition & 1 deletion pingpp-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.pingxx</groupId>
<artifactId>pingpp-java</artifactId>
<version>2.5.5</version>
<version>2.5.6</version>
<packaging>jar</packaging>

<name>pingpp-java</name>
Expand Down
2 changes: 1 addition & 1 deletion pingpp-sdk/src/main/java/com/pingplusplus/Pingpp.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public abstract class Pingpp {
/**
* version
*/
public static final String VERSION = "2.5.3";
public static final String VERSION = "2.5.6";
/**
* api key
*/
Expand Down
16 changes: 16 additions & 0 deletions pingpp-sdk/src/main/java/com/pingplusplus/net/RequestOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,23 @@ public static final class RequestOptionsBuilder {
private int readTimeout;
private int maxNetworkRetries;
private String acceptLanguage;

public String getVerifyPublicKey() {
return verifyPublicKey;
}

public RequestOptionsBuilder setVerifyPublicKey(String verifyPublicKey) {
this.verifyPublicKey = normalizePublicVerifyKey(verifyPublicKey);
return this;
}

private String verifyPublicKey;

public RequestOptionsBuilder() {
this.apiKey = Pingpp.apiKey;
this.appId = Pingpp.appId;
this.privateKey = Pingpp.privateKey;
this.verifyPublicKey = Pingpp.verifyPublicKey;
this.connectTimeout = Pingpp.getConnectTimeout();
this.readTimeout = Pingpp.getReadTimeout();
this.maxNetworkRetries = Pingpp.getMaxNetworkRetries();
Expand Down Expand Up @@ -132,6 +143,11 @@ public RequestOptionsBuilder setPrivateKey(String privateKey) {
return this;
}

public RequestOptionsBuilder clearVerifyPublicKey() {
this.verifyPublicKey = null;
return this;
}

public RequestOptionsBuilder clearAppId() {
this.appId = null;
return this;
Expand Down
2 changes: 1 addition & 1 deletion pingpp-sdk/src/test/java/com/pingplusplus/PingppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class PingppTest {
}

@Test public void testVerifyVersions() {
assertEquals("Pingpp.VERSION should match", "2.5.0", Pingpp.VERSION);
assertEquals("Pingpp.VERSION should match", "2.5.6", Pingpp.VERSION);
}

@Test public void testCreateCharge() {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.pingxx</groupId>
<artifactId>pingpp-java-parent</artifactId>
<version>2.5.4</version>
<version>2.5.6</version>
<packaging>pom</packaging>

<description>A Java SDK for Ping++ Payment API.</description>
Expand Down