Skip to content

Commit 55df509

Browse files
author
chengliang.zhang
committed
add wechat agreement example of notify
1 parent 6836579 commit 55df509

File tree

10 files changed

+64
-16
lines changed

10 files changed

+64
-16
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# ChangeLog
22

3+
## 2.5.0
4+
5+
- 新增: 响应签名验签
6+
- 新增: 微信扣款预扣费通知实现
7+
- 更新: `RequestOptions` 新增`Ping++`公钥设置参数
8+
- 更新: webhook验签方法移动至 `PingppSignature` 类中
9+
- 更新: `gson``2.10`;`commons-codec``1.17.0`
10+
311
## 2.4.1
412

513
- 修改: Refund 对象新增`currency` 字段

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.1
1+
2.5.0

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ sourceCompatibility = 1.8
1515
targetCompatibility = 1.8
1616

1717
dependencies {
18-
implementation 'com.google.code.gson:gson:2.8.9'
19-
implementation 'commons-codec:commons-codec:1.13'
18+
implementation 'com.google.code.gson:gson:2.10'
19+
implementation 'commons-codec:commons-codec:1.17.0'
2020

2121
testImplementation 'junit:junit:4.13.2'
2222
}

example/build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
apply plugin: 'java'
22

33
dependencies {
4-
implementation 'com.google.code.gson:gson:2.8.9'
5-
implementation 'commons-codec:commons-codec:1.13'
4+
implementation 'com.google.code.gson:gson:2.10'
5+
implementation 'commons-codec:commons-codec:1.17.0'
66

7-
implementation 'com.pingxx:pingpp-java:2.4.1'
7+
// 方法 1. 本地文件系统依赖
8+
// implementation fileTree(dir: 'lib', includes: ['*jar'])
9+
// 方法 2. 仓库依赖
10+
// implementation 'com.pingxx:pingpp-sdk:1.2.0'
11+
// 方法 3.模块依赖
12+
implementation project(':pingpp-sdk')
813
}

example/res/pingpp_public_key.pem

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.pingxx.example;
2+
3+
import com.pingplusplus.exception.PingppException;
4+
import com.pingplusplus.model.AgreementNotify;
5+
6+
import java.util.HashMap;
7+
import java.util.Map;
8+
9+
public class AgreementNotifyExample {
10+
private String appId;
11+
12+
AgreementNotifyExample(String appId) {
13+
this.appId = appId;
14+
}
15+
16+
public static void runDemos(String appId) {
17+
AgreementNotifyExample example = new AgreementNotifyExample(appId);
18+
System.out.println("------- 创建 charge -------");
19+
example.create("agr_123456");
20+
}
21+
22+
public AgreementNotify create(String id) {
23+
AgreementNotify agreementNotify = null;
24+
Map<String, Object> params = new HashMap<String, Object>();
25+
params.put("amount", 100);
26+
try {
27+
agreementNotify = AgreementNotify.create(id, params);
28+
} catch (PingppException e) {
29+
e.printStackTrace();
30+
}
31+
return agreementNotify;
32+
}
33+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-----BEGIN PUBLIC KEY-----
2+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoXV1qdwYGq6lac+EIVxx
3+
1/wGcjjy5InO08QBvUGDQMKAWjg/UvnNmnTZJvxUu18UVtwoHIls24EHZ96im3k0
4+
DPn43aSGyR417g9rqUL2N1H/0dCNcT8LY8sZL/sw/IV//IQcZYv/8EO6+7SClw+G
5+
Jpib84QfmDgUPbQC0dhl1R1Q8e8RoE/+70yX6OY22kRr14KjRZiVQ0UMZS5KaPwS
6+
FJ1egyNDCLFoLyhRQMV5vDxMdpIvxZuGW+3aTZkW8v/ISXWmSFpI/dlpxHp0+h6p
7+
sdai2RzXYuyzbeOPyQEZkyGfR6BX2Gv/l80nEFNup7uNmAt/be9IdpSZlxpF4HlI
8+
8wIDAQAB
9+
-----END PUBLIC KEY-----

libs/pingpp-sdk-2.5.0.jar

161 KB
Binary file not shown.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.pingxx</groupId>
66
<artifactId>pingpp-java</artifactId>
7-
<version>2.4.1</version>
7+
<version>2.5.0</version>
88

99
<description>A Java SDK for Ping++ Payment API.</description>
1010
<licenses>

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
rootProject.name = 'pingpp-java'
22
include 'example'
3+
include 'pingpp-sdk'
4+

0 commit comments

Comments
 (0)