├── .gitignore
├── CHANGELOG.md
├── README.md
├── build.gradle
├── docs
├── image
│ ├── example-middle-page.png
│ ├── import-01.png
│ ├── import-02.png
│ ├── import-03.png
│ ├── import-04.png
│ └── import-05.png
├── 招行使用说明.md
└── 支付中间页面说明.md
├── example
├── .gitignore
├── AndroidManifest.xml
├── build.gradle
├── ic_launcher-web.png
├── libs
│ └── org.simalliance.openmobileapi.jar
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ ├── home.png
│ │ ├── ic_launcher.png
│ │ ├── icon.png
│ │ ├── icon2.png
│ │ ├── icon3.png
│ │ ├── pinus.png
│ │ ├── textfield_activated_holo_dark.9.png
│ │ ├── textfield_default_holo_dark.9.png
│ │ ├── textfield_disabled_focused_holo_dark.9.png
│ │ ├── textfield_disabled_holo_dark.9.png
│ │ └── textfield_focused_holo_dark.9.png
│ ├── drawable-ldpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── drawable
│ │ ├── blue_btn_bg.xml
│ │ ├── btn.xml
│ │ ├── btn_bg.xml
│ │ ├── edit_text_holo_dark.xml
│ │ ├── gray_btn.xml
│ │ ├── gray_btn_bg.xml
│ │ └── pinus.png
│ ├── layout
│ │ ├── activity_client_sdk.xml
│ │ ├── activity_main.xml
│ │ └── pingpp_payment_activity_main.xml
│ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── xml
│ │ └── network_security_config.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── pingxx
│ └── demoapp
│ ├── ClientSDKActivity.java
│ └── MainActivity.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── lib
└── pingpp
│ ├── .gitignore
│ ├── AndroidManifest.xml
│ ├── build.gradle
│ ├── libs
│ ├── alipaysdk-15.8.06.211122170115.aar
│ ├── alipaysdk-noutdid-15.8.06.211122165332.aar
│ ├── ccbnetpay_nowx_v2.2.0.jar
│ ├── lkl-pay-sdk.aar
│ ├── mqqopenpay.jar
│ ├── pingpp-android-2.3.5.aar
│ ├── pingpp-android-upacp-3.5.9.aar
│ └── wechat-sdk-android-without-mta-5.1.6.jar
│ ├── proguard-project.txt
│ ├── project.properties
│ └── src
│ └── .gitkeep
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Log Files
26 | *.log
27 |
28 | # Android Studio Navigation editor temp files
29 | .navigation/
30 |
31 | # Android Studio captures folder
32 | captures/
33 |
34 | .settings/
35 |
36 | *.iml
37 |
38 | .DS_Store
39 | Thumbs.db
40 |
41 | # Output
42 | lib/pingpp/target
43 | lib/pingpp/gen
44 | lib/pingpp/bin
45 | lib/bdwallet_pay_sdk/target
46 | lib/bdwallet_pay_sdk/gen
47 | lib/bdwallet_pay_sdk/bin
48 | example/bin
49 | example/target
50 | example/gen
51 | .idea
52 | .classpath
53 | .project
54 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # ChangeLog
2 |
3 | ### 2.3.5
4 |
5 | - 更新: 支持 wx_app_lakala
6 |
7 | ---
8 |
9 | ### 2.3.4
10 |
11 | - 更新: cmb_wallet SDK 更新至渠道版本 1.1.1,新增招行相关设置方法;
12 | - 更新: 移除不需要的加密方法;
13 | - 修正:某些机型某些场景下,可能出现 lakala 相关类未找到的报错;
14 |
15 | ---
16 |
17 | ### 2.3.2
18 |
19 | - 更新: webView 类渠道关闭中间页
20 | - 更新: qpay 报错修复
21 | - 更新:webView settings 更新
22 | - 更新:alipay sdk 更新至 15.7.4;unionpay sdk 更新至 3.4.9
23 |
24 | ---
25 |
26 | ### 2.3.1
27 |
28 | - 更新: 银联设备支付判断修改
29 | - 新增: 新增 alipay_app_lakala 支持
30 |
31 | ---
32 |
33 | ### 2.3.0
34 |
35 | - 更新: 源码使用 Kotlin
36 | - 新增: 添加“中间页面”支持,用于处理一些异常情况,用户需要使用 XML 自定义页面替换
37 |
38 | ---
39 |
40 | ### 2.2.6
41 |
42 | - 更新: 微信签约更新
43 |
44 | ### 2.2.5
45 |
46 | - 修正: 签约方法修正
47 |
48 | ### 2.2.4
49 |
50 | - 更新: 银联 SDK 更新至 3.4.8
51 | - 更新: 支付宝 SDK 更新至 15.6.5
52 | - 更新:渠道 SDK 版本号换成渠道的版本号
53 | - 新增:`Pingpp.useSEPay(boolean);` 代替 `Pingpp.isPermissionSEPay = false;`
54 | - 更新:银联渠道去掉请求权限
55 |
56 | ### 2.2.3
57 |
58 | - 更新: 银联 SDK 更新至 3.4.6
59 | - 更新: 支付宝 SDK 更新至 15.6.4
60 | - 新增: cb_isv_alipay, cb_isv_wx 支持
61 |
62 | ### 2.2.2
63 |
64 | * 新增:
65 | 和包支付
66 |
67 | ### 2.2.1
68 |
69 | * 新增:
70 | 支付宝支付中签约
71 | 支付宝纯签约
72 |
73 | ### 2.2.0
74 |
75 | * 更新:
76 | 银联 SDK 更新至 3.4.5
77 | 微信 SDK 更新至 5.1.6
78 | 新增签约接口
79 |
80 | ### 2.1.19 (2018-10-31)
81 | * 新增:
82 | 新增建行支付渠道
83 |
84 | ### 2.1.18 (2018-06-29)
85 | * 新增:
86 | 新增招行 app 支付
87 |
88 | ### 2.1.17 (2018-01-16)
89 | * 更新:
90 | 更新支付宝 SDK
91 | 更新微信 SDK
92 | 更新银联 SDK
93 | * 新增:
94 | pingpp_ui 库
95 |
96 |
97 | ### 2.1.16 (2017-12-14)
98 | * 新增:
99 | 跨境支付宝APP支付
100 | 跨境微信APP支付
101 |
102 | ### 2.1.15 (2017-11-27)
103 | * 更新:
104 | 更新银联 SDK
105 |
106 | ### 2.1.14 (2017-09-28)
107 | * 修复:
108 | 修复 order 取值问题
109 |
110 | ### 2.1.13 (2017-09-13)
111 | * 新增:
112 | 添加线下渠道支付
113 | * 更新:
114 | test 模式下支付状态的判断
115 | * 修复:
116 | 修复壹收款花呗分期入口
117 |
118 |
119 | ### 2.1.12 (2017-08-29)
120 | * 更新:
121 | 更新 Ping++ SDK v2.1.12
122 | 更新 支付宝 SDK (alipaySdk-20170725.jar)
123 | 更新 银联 SDK
124 | 兼容账户系统 1.4
125 |
126 | ### 2.1.11 (2017-07-24)
127 | * 更新:
128 | 更新 Ping++ SDK v2.1.11
129 |
130 | ### 2.1.10 (2017-07-10)
131 | * 更新:
132 | 更新支付宝 SDK (alipaySingle-20170510.jar)
133 | 更新微信 SDK v1.1.7
134 | 更新接入文档
135 | 兼容招行一网通混淆加密方式
136 | * 修复:
137 | 修复qpay在被杀死进程时的返回错误结果的问题
138 |
139 | ### 2.1.9 (2017-03-06)
140 | * 更新支付宝SDK v15.2.8
141 |
142 | ### 2.1.8 (2017-01-12)
143 | * 修复:
144 | 修复京东支付按返回键返回结果状态不正确问题
145 | 修复WebView在4.2系统以下检测出漏洞问题
146 | * 更新:
147 | 更新壹收款到2.1.2
148 | 兼容微信新旧jar包
149 | 兼容招行一网通2.0
150 |
151 | ### 2.1.7
152 | * 修复:
153 | 修复微信在Android7.0下的返回结果问题
154 | * 更新:
155 | 更新银联支付到 3.3.5
156 | * 新增:
157 | 添加账户余额系统(兼容charge与order对象)
158 |
159 | ### 2.1.6
160 | * 更改:
161 | 更新支付宝SDK v15.2.2
162 |
163 | ### 2.1.5
164 | * 新增:
165 | 添加QQ钱包(qpay)
166 | * 更改
167 | 更新京东支付到2.0(jdpay_wap2.0)
168 |
169 | ### 2.1.4
170 | * 新增:
171 | 添加招行一网通(cmb_wallet)
172 |
173 |
174 | ### 2.1.3
175 | * 新增:
176 | 添加么么贷(mmdpay_wap)
177 | * 更改:
178 | 更新支付宝到 alipaySdk-20160223.jar
179 | 更新银联支付到 3.3.3
180 | 更新微信支付
181 |
182 | ### 2.1.2
183 | * 新增:
184 | 添加量化派(qgbc_wap)
185 | 添加分期乐(fqlpay_wap)
186 |
187 | ### 2.1.1
188 | * 更改:
189 | 统一 SDK 调用接口,使用 Pingpp 类
190 | * 修复:
191 | 在 Android 6.0 以上申请权限的问题
192 |
193 | ### 2.1.0
194 | * 更改:
195 | 更新壹收款
196 |
197 | ### 2.0.7
198 | * 更改:
199 | 改为 Library Project 导入方式
200 | 修复不能去除微信 jar 包的问题
201 |
202 | ### 2.0.6
203 | 更换银联支付 SDK
204 |
205 | ### 2.0.5
206 | 更新银联支付到 3.1.0,接入方式改为 jar 方式接入。
207 | 更新支付宝到 alipaySDK-20150818.jar
208 |
209 | ### 2.0.4
210 | 增加京东支付(jdpay_wap)
211 |
212 | ### 2.0.3
213 | * 修复:
214 | Java 版本兼容问题
215 |
216 | ### 2.0.2
217 | * 更改:
218 | 新的测试模式
219 |
220 | ### 2.0.1
221 | * 更改:
222 | 百付宝 SDK 更新
223 |
224 | ### 2.0.0
225 | * 更改:
226 | 添加新渠道:百付宝
227 | callback 添加返回错误信息
228 |
229 | ### 1.0.5
230 | * 修复:
231 | 微信未登录情况下,点返回,应用无响应,需要再按一次返回才能继续操作
232 |
233 | ### 1.0.4
234 | * 更改:
235 | 更换了测试环境 URL
236 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Ping++ Android SDK
2 |
3 | ## 目录
4 |
5 | * [1. 简介](#1)
6 | * [2. 环境要求](#2)
7 | * [3. 快速体验](#3)
8 | * [4. 工程配置及使用](#4)
9 | * [4.1 导入依赖包](#4.1)
10 | * [4.2 权限配置](#4.2)
11 | * [4.3 使用 Ping++ 标准版 SDK](#4.3)
12 | * [5. 日志开关](#5)
13 | * [6. 注意事项](#6)
14 | * [7. 常见问题](#issues)
15 |
16 | ##
简介
17 |
18 | lib 目录包含 Library Project: `pingpp`。
19 | 可以直接将两个 Library Project 作为依赖库,导入到你的项目。支持 Android Studio。
20 | example 文件夹里面是一个简单的接入示例,该示例仅供参考。想使用该示例,请直接将本仓库导入。
21 | docs 目录里面是 Android SDK 的接入指南。
22 |
23 | * **推荐使用 Gradle 方式**,本项目的库文件更新可能有延迟。
24 |
25 | ## 版本要求
26 |
27 | Android SDK 要求 `Android 4.1` 及以上版本
28 | 请使用 `Java 8` 或以上版本
29 |
30 | **需要 Kotlin 标准库**
31 |
32 | ## 额外说明
33 |
34 | 1. [中间页说明](/docs/支付中间页面说明.md)
35 |
36 | ## 快速体验
37 |
38 | ### Android Studio
39 |
40 | 导入 pingpp-android 整个项目,即可运行该 demo。
41 |
42 | 需要注意: 测试微信支付,需要签名和包名与微信开放平台上的一致,才可支付成功。给出的 demo 并没给出正确的签名,会返回微信支付失败的结果。
43 | 导入 demo 中可能会遇到的开发环境版本问题,修改 build.gradle 中的版本
44 |
45 | ## 工程配置及使用
46 |
47 | ### 一、导入依赖包
48 |
49 | (注:依赖渠道 SDK 时,可能会和其他第三方SDK有冲突,移除依赖冲突的包就可以。如:[问题二](#issue2)、[问题三](#issue3))
50 |
51 | #### Gradle 导入方式
52 |
53 | 修改项目的 `build.gradle` 文件,添加 `bintray` 仓库地址
54 |
55 | ```groovy
56 | allprojects {
57 | repositories {
58 | // ...其他仓库地址...
59 | mavenCentral()
60 | // maven {
61 | // url "https://maven.aliyun.com/repository/jcenter"
62 | // }
63 |
64 | // 本地 aar 目录,根据实际 aar 放置的目录修改 dirs 中内容。以下为当前项目的示例
65 | flatDir {
66 | dirs(
67 | project(":lib:pingpp").file("libs")
68 | )
69 | }
70 | }
71 | }
72 | ```
73 |
74 | ```groovy
75 | dependencies {
76 | implementation 'com.pingxx:pingpp-android:2.3.6' // (Ping++ 标准版 SDK) 必须添加
77 | implementation 'com.tencent.mm.opensdk:wechat-sdk-android:6.8.26' // 使用微信支付时添加,具体版本参考微信官方文档
78 | implementation "com.alipay.sdk:alipaysdk-android:15.8.17" // 使用支付宝时添加。可参考 https://opendocs.alipay.com/open/04km1h
79 | implementation "com.pingxx:pingpp-android-upacp:3.5.9" // 使用银联支付时添加
80 | implementation 'com.pingxx:pingpp-qpay:2.1.19' // 使用QQ钱包时添加
81 | implementation 'com.pingxx:pingpp-android-cmbwallet:1.1.1' // 使用招行一网通时添加
82 | implementation 'com.pingxx:pingpp-ccbpay:2.1.19' // 使用建行支付时添加
83 | implementation 'com.pingxx:pingpp-android-cmpay:2.2.2' // 使用和包支付时添加
84 | implementation 'com.pingxx:pingpp-android-lakala:2.0.0' // 使用拉卡拉支付时添加
85 | }
86 | ```
87 |
88 | [微信 SDK](https://developers.weixin.qq.com/doc/oplatform/Downloads/Android_Resource.html)
89 |
90 | #### Maven 导入方式
91 |
92 | ```xml
93 |
94 | com.pingxx
95 | pingpp-android
96 |
97 | VERSION
98 | pom
99 |
100 | ```
101 |
102 | ### 二、清单文件配置所需权限
103 |
104 | > 缺少时或者需要覆盖时可按下述说明添加
105 |
106 | (注:有些权限是需要动态注册的,如 `READ_PHONE_STATE` 权限)
107 |
108 | ``` xml
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | ```
118 |
119 | ### 三、使用 Ping++ 标准版 SDK
120 |
121 | #### 1. 清单文件注册相关类
122 |
123 | - Ping++ SDK 所需要注册
124 |
125 | > 已默认包含于 aar 文件中,如果不需要自定义,可以忽略。
126 |
127 | ```xml
128 |
133 |
134 | ```
135 |
136 | - 微信支付需要注册
137 | 注:
138 | 1. 需要将以下“替换成自己 APK 的包名”换成在微信平台上注册填写的包名
139 | 2. WxPayEntryActivity 这个类在 SDK 内部实现,开发者不需要额外实现该类
140 |
141 |
142 | ```xml
143 |
147 | ```
148 |
149 | - QQ 钱包需注册(scheme 填写规则:qwallet + QQ 钱包中的 app_id)
150 |
151 | ```xml
152 |
153 |
154 |
155 |
156 |
157 |
158 | ```
159 |
160 | 将以上代码添加到 Ping++ SDK 注册的 Activity,如:
161 |
162 | ```xml
163 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 | ```
174 |
175 | - 招行一网通 app 需注册 `scheme`
176 |
177 | ```xml
178 |
179 |
180 |
181 |
182 |
183 | ```
184 |
185 | 将以上代码添加到 Ping++ SDK 注册的 Activity,如:
186 |
187 | ```xml
188 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | ```
198 |
199 | - 建行支付需注册 (自定义 action-name 保持与服务端的 third_app_info 一致)
200 |
201 | ``` xml
202 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
214 |
215 |
218 | ```
219 |
220 | - 使用拉卡拉微信(wx_app_lakala)需要添加声明
221 |
222 | ```xml
223 |
227 |
228 |
232 | ```
233 |
234 | #### 2. 获取到 charge/order 后,调起支付
235 |
236 | ##### 获取 charge/order
237 |
238 | charge/order 对象是一个包含支付信息的 JSON 对象,是 Ping++ SDK 发起支付的必要参数。该参数需要请求用户服务器获得,服务端生成 charge 或 order 的方式参考 服务端接入简介。SDK 中的 demo 里面提供了如何获取 charge/order 的实例方法,供用户参考。
239 |
240 | ##### 调起支付
241 |
242 | 因为 Ping++ 已经封装好了相应的调用方法,所以只需要调用支付方法即可调起支付控件:
243 | (注:该调用方法需要在主线程(UI 线程)完成)
244 |
245 | ```java
246 | // 参数一:Activity 当前调起支付的 Activity
247 | // 参数二:data 获取到的 charge 或 order 的 JSON 字符串
248 | Pingpp.createPayment(YourActivity.this, data);
249 | ```
250 |
251 | #### 3. 获取支付结果
252 |
253 | 从 Activity 的 onActivityResult 方法中获得支付结果。支付成功后,用户服务器也会收到 Ping++ 服务器发送的异步通知。 (最终支付成功请根据服务端异步通知为准)
254 |
255 | ```java
256 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
257 | // 支付页面返回处理
258 | if (requestCode == Pingpp.REQUEST_CODE_PAYMENT) {
259 | String result = data.getExtras().getString("pay_result");
260 | /* 处理返回值
261 | * "success" - 支付成功
262 | * "fail" - 支付失败
263 | * "cancel" - 取消支付
264 | * "invalid" - 支付插件未安装(一般是微信客户端未安装的情况)
265 | * "unknown" - app进程异常被杀死(一般是低内存状态下,app进程被杀死)
266 | */
267 | String errorMsg = data.getExtras().getString("error_msg"); // 错误信息
268 | String extraMsg = data.getExtras().getString("extra_msg"); // 错误信息
269 | }
270 | }
271 |
272 | // 注:线下渠道无支付结果返回, 返回 unknown 字段。需要从服务端获取正确的支付结果。
273 | ```
274 |
275 | #### 4. 其他辅助方法及变量
276 |
277 | ##### 1. 判断是否安装了招商银行客户端
278 |
279 | ```
280 | // isInstalled true: 已安装 false: 未安装
281 | boolean isInstalled = Pingpp.isCmbWalletInstalled(context);
282 | ```
283 |
284 | ##### 2. 是否允许使用手机 Pay
285 |
286 | ```
287 | // true: 允许 (默认) false: 不允许
288 | Pingpp.useSEPay(false);
289 | ```
290 |
291 | ##### 3. 控制招行支付方式
292 |
293 | ```
294 | // 自动判断,安装有招行 app 时打开 app 支付,否则通过 webView 打开 H5 页面支付
295 | Pingpp.setCmbPayMethod(CmbPayMethod.AUTO);
296 | // 仅通过 webView 打开 H5 页面支付
297 | Pingpp.setCmbPayMethod(CmbPayMethod.H5_ONLY);
298 | // 仅通过打开招行 app 支付
299 | Pingpp.setCmbPayMethod(CmbPayMethod.APP_ONLY);
300 | ```
301 |
302 | ##### 3. 设置招行 H5 地址
303 |
304 | > 生产环境不需要设置
305 |
306 | ```
307 | // 参数 1,Boolean,是否启用招行测试地址;
308 | // 参数 2,String,招行测试 H5 地址。仅参数 1 为 true 时生效。如果参数 2 传 null,则会使用默认测试地址。
309 | Pingpp.setCmbEnv(true, null);
310 | Pingpp.setCmbEnv(true, "https://...");
311 | ```
312 |
313 | #### 5. 调起签约接口
314 |
315 | ```java
316 | // 参数一:Activity 当前调起支付的Activity
317 | // 参数二:data 获取到的 agreement 的 JSON 字符串
318 | Pingpp.signAgreement(YourActivity.this, data);
319 | ```
320 |
321 | ##### 获取签约结果
322 |
323 | 签约结果不会在客户端返回,商户需要自己在前端查询服务端的 `agreement` 对象状态。
324 |
325 | ## 混淆设置
326 |
327 | > 使用 aar/jcenter 方式导入的不需要额外设置混淆。
328 |
329 | (注:将以下对应渠道的混淆代码加到主 module 以及该 SDK 依赖所在的 module 中,不然会出现 jar 包重复或者找不到该类的问题,如:[问题二](#issue2))
330 |
331 | ```
332 | # Ping++ 混淆过滤
333 | -dontwarn com.pingplusplus.**
334 | -keep class com.pingplusplus.** {*;}
335 | -keep public class com.pingplusplus.android.Pingpp$CmbPayMethod {
336 | *;
337 | }
338 |
339 | # 支付宝混淆过滤
340 | -dontwarn com.alipay.**
341 | -keep class com.alipay.** {*;}
342 |
343 | # 微信或 QQ 钱包混淆过滤
344 | -dontwarn com.tencent.**
345 | -keep class com.tencent.** {*;}
346 |
347 | # 银联支付混淆过滤
348 | -dontwarn com.unionpay.**
349 | -keep class com.unionpay.** {*;}
350 |
351 | # 内部 WebView 混淆过滤
352 | -keepclassmembers class * {
353 | @android.webkit.JavascriptInterface ;
354 | }
355 | ```
356 |
357 | ## 日志开关
358 |
359 | SDK 提供了日志功能,默认日志为关闭状态。 开发者可以通过下面设置打开日志开关。通过 PING++ 来对日志进行筛选。
360 |
361 | ``` java
362 | //开启调试模式
363 | Pingpp.enableDebugLog(true);
364 | ```
365 |
366 | ## 注意事项
367 |
368 | - Pingpp Android SDK 可能会与友盟、百度地图等其他第三方 jar 包冲突,当同时使用这些 jar 包的时候用户需要根据情况判断保留哪一方的 jar 包。
369 | - 请勿直接使用客户端支付结果作为最终判定订单状态的依据,由于 Ping++ 没有参与你的客户端和第三方渠道的交互,无法保证客户端支付结果的安全性,建议订单状态的更新对比客户端的渠道同步回调信息和服务端的 Ping++ Webhooks 通知来确定是否修改。
370 |
371 | ## 常见问题
372 | ### 问题一: 微信支付失败,返回 wx_err_code:-1
373 |
374 | - 报错原因:
375 | 微信验证 apk 的签名包名失败。
376 | - 解决方案:
377 | 1. 项目的 package 名字、AndroidManifest.xml 里面的包名,必须和微信开放平台注册的一致;
378 | 2. 必须打包成为发布版本的 apk,apk 签名必须和在微信开放平台注册的一致,微信开放平台签名要求: MD5,无冒号;
379 | 3. 清理微信缓存;
380 | 4. 如果签名包名均正确,仍旧返回 -1 报错,请检查时间戳格式是否有问题或重置微信开放平台的安卓版本的签名包名。
381 |
382 | ### 问题二:与其他第三方SDK有冲突(如:友盟SDK)
383 |
384 | - 报错Log:
385 |
386 | ```java
387 | Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
388 | com.android.build.api.transform.TransformException:
389 | java.util.zip.ZipException: duplicate entry: a/a/a/a.class
390 | ```
391 |
392 | - 报错原因:
393 | 1. 没有加过滤混淆的代码
394 | 2. 有重复的 jar 包存在
395 |
396 | - 解决方案:
397 | 1. 加上混淆过滤的代码(出现 a/a/a/a.class 的 log 时)
398 | 2. 删除重复的 jar 包(可以是第三方 SDK 中的,也可以是 Ping++ SDK 中的 jar 包)
399 |
400 | ### 问题三:Ping++ 和其他第三方 SDK(如:高德地图)同时存在,使用 gradle 导入 Ping++, 会导致其他第三方 SDK(如:高德地图)找不到 so 而无法使用
401 |
402 | - 报错原因:
403 | Ping++ SDK 提供了 `armeabi-v7a`、`arm64-v8a`,而其他第三方 SDK(如:高德地图)提供了 `armeabi-v7a`, 当手机是 `arm64-v8a` 的会去加载 `arm64-v8a` 包下的 so 文件,这时会报其他第三方 SDK (如:高德地图)的 so 文件找不到,而你上面的代码在打包的时候就只打包了 `armeabi-v7a`,所以只会去 `armeabi-v7a` 包下找,因此不会出现报错 建议使用各种 SDK 时保持相同的 so 文件。
404 |
405 | - 解决方案:
406 | 在 build.gradle 中设置 ndk
407 |
408 | ```java
409 | ndk {
410 | // 选择要添加的对应 cpu 类型的 .so 库。选择的 so 文件需要各种 SDK 保持一致
411 | abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
412 | // 根据实际情况选择所有 SDK 可以支持的类型
413 | }
414 | ```
415 |
416 | ### 问题四:银联支付报错:
417 |
418 | ```java
419 | java.lang.ClassNotFoundException: org.simalliance.openmobileapi.SEService
420 | 或 can’t find reference class org.openmobileapi.SEService
421 | ```
422 |
423 | - 报错原因:
424 | 缺少 `org.simalliance.openmobileapi.SEService`, 编译失败
425 |
426 | - 解决方案:
427 | 将 example 中 libs 下的 `org.simalliance.openmobileapi.jar` 拷到项目中依赖,但不要打包进 apk 中,有些手机会存在这个 jar 包
428 |
429 | ```java
430 | dependencies {
431 | compileOnly files('libs/org.simalliance.openmobileapi.jar') // 使用 compileOnly, 不打包进 apk
432 | }
433 | ```
434 |
435 | ### 更多问题请到[帮助中心](https://help.pingxx.com/)搜索
436 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | maven {
6 | url "https://maven.aliyun.com/repository/jcenter"
7 | }
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:7.0.4'
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | maven {
19 | url "https://maven.aliyun.com/repository/jcenter"
20 | }
21 |
22 | // 本地 aar 目录
23 | flatDir {
24 | dirs(
25 | project(":lib:pingpp").file("libs")
26 | )
27 | }
28 | }
29 | }
30 |
31 | task clean(type: Delete) {
32 | delete rootProject.buildDir
33 | }
34 |
--------------------------------------------------------------------------------
/docs/image/example-middle-page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/docs/image/example-middle-page.png
--------------------------------------------------------------------------------
/docs/image/import-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/docs/image/import-01.png
--------------------------------------------------------------------------------
/docs/image/import-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/docs/image/import-02.png
--------------------------------------------------------------------------------
/docs/image/import-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/docs/image/import-03.png
--------------------------------------------------------------------------------
/docs/image/import-04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/docs/image/import-04.png
--------------------------------------------------------------------------------
/docs/image/import-05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/docs/image/import-05.png
--------------------------------------------------------------------------------
/docs/招行使用说明.md:
--------------------------------------------------------------------------------
1 | ## Ping++ 招行使用流程
2 |
3 | ### DEPRECATED
4 |
--------------------------------------------------------------------------------
/docs/支付中间页面说明.md:
--------------------------------------------------------------------------------
1 | # 支付中间页面说明
2 |
3 | ## 说明
4 |
5 | 为了处理兼容各种渠道 SDK 的返回逻辑,以及在不同机型的不同 Activity 生命周期表现,和一些“异常”操作流程,引入了“中间页面”。
6 |
7 | 在渠道客户端 SDK 没有返回支付结果的时候,可以让用户手动点击“取消”、“完成”或者“重新打开”。
8 |
9 | > 如果不启用中间页面,处理逻辑保持原有的不变。
10 |
11 | ## 使用方法
12 |
13 | 示例代码都以 Kotlin 举例。
14 |
15 | ### 启用中间页面
16 |
17 | ```kotlin
18 | Pingpp.enableMiddlePage(true, 1.0)
19 | ```
20 |
21 | #### 参数说明
22 |
23 | - 参数 1: Boolean, 是否启用中间页面;
24 | - 参数 2: Double, 中间页面的显示延迟时间,单位秒。传入 0 表示直接展示。延迟显示可以使中间页面在大多数正操操作流程下都不需要显示出来。
25 |
26 | 该方法等价于:
27 |
28 | ```kotlin
29 | Pingpp.enableMiddlePage(true)
30 | Pingpp.delayMiddlePage(1.0)
31 | ```
32 |
33 | ### 页面布局自定义
34 |
35 | SDK 自带的页面布局很简陋,请添加自定义页面布局文件。
36 |
37 | #### layout 文件名
38 |
39 | ```
40 | pingpp_payment_activity_main.xml
41 | ```
42 |
43 | 参考 [example/.../pingpp_payment_activity_main.xml](/example/res/layout/pingpp_payment_activity_main.xml)
44 |
45 | #### 必须包含的元素
46 |
47 | 1. Button, `android:id="@+id/pingpp_button_reopen"`
48 | - 用户点击该按钮,会再次尝试打开渠道支付页面
49 | 2. Button, `android:id="@+id/pingpp_button_cancel"`
50 | - 用户点击该按钮,会返回 pay_result=user_cancel
51 | 3. Button, `android:id="@+id/pingpp_button_success"`
52 | - 用户点击该按钮,会返回 pay_result=user_success
53 |
54 | > 前端的结果均不能作为最终结果,实际支付结果需要通过服务器查询。
55 |
56 | #### 自定义主题/Theme
57 |
58 | 在 app 的 manifest 中添加
59 |
60 | ```xml
61 |
65 |
66 | ```
67 |
68 | ### example 中的页面布局样例
69 |
70 | 
71 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | /release
2 | /build
--------------------------------------------------------------------------------
/example/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
66 |
67 |
68 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
81 |
82 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/example/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 31
5 | defaultConfig {
6 | applicationId "com.pingxx.demoapp"
7 | minSdkVersion 19
8 | targetSdkVersion 31
9 | }
10 |
11 | buildTypes {
12 | release {
13 | minifyEnabled true
14 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
15 | }
16 | debug {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
19 | }
20 | }
21 | sourceSets {
22 | main {
23 | manifest.srcFile 'AndroidManifest.xml'
24 | res.srcDirs = ['res']
25 | assets.srcDirs = ['assets']
26 | }
27 | }
28 | lintOptions {
29 | checkReleaseBuilds false
30 | abortOnError false
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation 'com.google.android.material:material:1.2.0-alpha05'
36 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
37 |
38 | implementation 'com.pingxx:pingpp-android:2.3.6'
39 | // 使用微信支付时添加
40 | implementation 'com.tencent.mm.opensdk:wechat-sdk-android:6.8.26'
41 | // 使用支付宝时添加不包含 UTDID (当同时使用阿里百川等 SDK 时出现 UTDID 相关冲突可以用这个)
42 | implementation(group: "", name: "alipaysdk-noutdid-15.8.06.211122165332", ext: "aar")
43 |
44 | // 使用支付宝时添加(包含 UTDID)
45 | // implementation(group = "", name = "alipaysdk-15.8.06.211122170115", ext = "aar")
46 | // 使用银联支付时添加
47 | implementation(group: "", name: "pingpp-android-upacp-3.5.9", ext: "aar")
48 | // 使用QQ钱包时添加
49 | implementation 'com.pingxx:pingpp-qpay:2.1.19'
50 | // 使用招行一网通时添加
51 | implementation 'com.pingxx:pingpp-cmbwallet:2.1.19'
52 | // 使用建行支付时添加
53 | implementation 'com.pingxx:pingpp-ccbpay:2.1.19'
54 |
55 | // 使用拉卡拉支付时添加
56 | implementation 'com.pingxx:pingpp-android-lakala:2.0.0'
57 | compileOnly files('libs/org.simalliance.openmobileapi.jar')
58 | }
59 |
--------------------------------------------------------------------------------
/example/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/ic_launcher-web.png
--------------------------------------------------------------------------------
/example/libs/org.simalliance.openmobileapi.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/libs/org.simalliance.openmobileapi.jar
--------------------------------------------------------------------------------
/example/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
22 | -keep class * extends android.app.Activity {
23 | *;
24 | }
25 |
26 | # Ping++ 混淆过滤
27 | -dontwarn com.pingplusplus.**
28 | -keep class com.pingplusplus.** {*;}
29 |
30 | # 支付宝混淆过滤
31 | -dontwarn com.alipay.**
32 | -keep class com.alipay.** {*;}
33 |
34 | # 微信或QQ钱包混淆过滤
35 | -dontwarn com.tencent.**
36 | -keep class com.tencent.** {*;}
37 |
38 | # 银联支付混淆过滤
39 | -dontwarn com.unionpay.**
40 | -keep class com.unionpay.** {*;}
41 |
42 | # 招行一网通混淆过滤
43 | -keepclasseswithmembers class cmb.pb.util.CMBKeyboardFunc {
44 | public (android.app.Activity);
45 | public boolean HandleUrlCall(android.webkit.WebView,java.lang.String);
46 | public void callKeyBoardActivity();
47 | }
48 |
49 | # 百付宝混淆过滤
50 | -dontwarn com.baidu.**
51 | -keep class com.baidu.** {*;}
52 |
53 | # 内部WebView混淆过滤
54 | -keepclassmembers class * {
55 | @android.webkit.JavascriptInterface ;
56 | }
57 |
58 | -keep class org.json.** {*;}
59 |
60 | -dontwarn android.test.**
61 |
--------------------------------------------------------------------------------
/example/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-23
15 | android.library.reference.1=../lib/pingpp
16 | android.library.reference.2=../lib/pingpp_one
17 | android.library.reference.3=../lib/bdwallet_pay_sdk
18 |
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/home.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/icon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/icon2.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/icon3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/icon3.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/pinus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/pinus.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/textfield_activated_holo_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/textfield_activated_holo_dark.9.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/textfield_default_holo_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/textfield_default_holo_dark.9.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/textfield_disabled_holo_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/textfield_disabled_holo_dark.9.png
--------------------------------------------------------------------------------
/example/res/drawable-hdpi/textfield_focused_holo_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-hdpi/textfield_focused_holo_dark.9.png
--------------------------------------------------------------------------------
/example/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/res/drawable/blue_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/example/res/drawable/btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/example/res/drawable/btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/example/res/drawable/edit_text_holo_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/res/drawable/gray_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/example/res/drawable/gray_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/example/res/drawable/pinus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/example/res/drawable/pinus.png
--------------------------------------------------------------------------------
/example/res/layout/activity_client_sdk.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
23 |
24 |
40 |
41 |
55 |
56 |
70 |
71 |
85 |
86 |
100 |
101 |
115 |
116 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/example/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/example/res/layout/pingpp_payment_activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
30 |
31 |
42 |
43 |
53 |
54 |
--------------------------------------------------------------------------------
/example/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #AAAAAA
3 | #008dff
4 | #bbbbbb
5 |
--------------------------------------------------------------------------------
/example/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | demoapp
5 | 完成
6 | 微信
7 | 支付宝
8 | QQ钱包
9 | 银联
10 | 百度钱包
11 | 京东支付
12 | 确认
13 | 元
14 | \u3000\u3000感谢你的爱心,\n但是系统出现了一些错误
15 | 错误
16 | 未安装支付软件
17 | 支付金额
18 | 图片加载失败
19 | 壹收款
20 | Hello world!
21 | 壹收款
22 | 橡胶花瓶
23 |
24 | 支付结果确认
25 |
26 |
--------------------------------------------------------------------------------
/example/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
12 |
13 |
24 |
25 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 218.244.151.190
5 |
6 |
--------------------------------------------------------------------------------
/example/src/main/java/com/pingxx/demoapp/ClientSDKActivity.java:
--------------------------------------------------------------------------------
1 | package com.pingxx.demoapp;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 |
6 | import java.io.InputStreamReader;
7 | import java.math.BigDecimal;
8 | import java.net.HttpURLConnection;
9 | import java.net.URL;
10 | import java.text.NumberFormat;
11 | import java.util.Locale;
12 |
13 | import android.app.Activity;
14 | import android.app.AlertDialog;
15 | import android.app.AlertDialog.Builder;
16 | import android.content.Intent;
17 | import android.os.AsyncTask;
18 | import android.os.Bundle;
19 | import android.text.Editable;
20 | import android.text.TextWatcher;
21 | import android.util.Log;
22 | import android.view.View;
23 | import android.view.View.OnClickListener;
24 | import android.widget.Button;
25 | import android.widget.EditText;
26 |
27 | import com.pingplusplus.android.Pingpp;
28 | import org.json.JSONObject;
29 |
30 | /**
31 | *
32 | * ping++ sdk 示例程序,仅供开发者参考。
33 | * 【说明文档】https://github.com/PingPlusPlus/pingpp-android/blob/master/docs/ping%2B%2B安卓SDK使用文档.md
34 | *
35 | * 【注意】运行该示例,需要用户填写一个YOUR_URL。
36 | *
37 | * ping++ sdk 使用流程如下:
38 | * 1)客户端已经有订单号、订单金额、支付渠道
39 | * 2)客户端请求服务端获得charge。服务端生成charge的方式参考ping++ 官方文档,地址 https://pingxx.com/guidance/server/import
40 | * 3)收到服务端的charge,调用ping++ sdk 。
41 | * 4)onActivityResult 中获得支付结构。
42 | * 5)如果支付成功。服务端会收到ping++ 异步通知,支付成功依据服务端异步通知为准。
43 | */
44 | public class ClientSDKActivity extends Activity implements OnClickListener {
45 |
46 | /**
47 | *开发者需要填一个服务端URL 该URL是用来请求支付需要的charge。务必确保,URL能返回json格式的charge对象。
48 | *服务端生成charge 的方式可以参考ping++官方文档,地址 https://pingxx.com/guidance/server/import
49 | *
50 | *【 http://218.244.151.190/demo/charge 】是 ping++ 为了方便开发者体验 sdk 而提供的一个临时 url 。
51 | * 该 url 仅能调用【模拟支付控件】,开发者需要改为自己服务端的 url 。
52 | */
53 | private static String YOUR_URL = "http://218.244.151.190/demo/charge";
54 |
55 | public static final String CHARGE_URL = YOUR_URL;
56 | public static final boolean LIVEMODE = false;
57 |
58 | /**
59 | * 银联支付渠道
60 | */
61 | private static final String CHANNEL_UPACP = "upacp";
62 | /**
63 | * 微信支付渠道
64 | */
65 | private static final String CHANNEL_WECHAT = "wx";
66 | /**
67 | * QQ钱包支付渠道
68 | */
69 | private static final String CHANNEL_QPAY = "qpay";
70 | /**
71 | * 支付宝支付渠道
72 | */
73 | private static final String CHANNEL_ALIPAY = "alipay";
74 | /**
75 | * 百度支付渠道
76 | */
77 | private static final String CHANNEL_BFB = "bfb_wap";
78 | /**
79 | * 京东支付渠道
80 | */
81 | private static final String CHANNEL_JDPAY_WAP = "jdpay_wap";
82 |
83 | private EditText amountEditText;
84 | private Button wechatButton;
85 | private Button alipayButton;
86 | private Button upmpButton;
87 | private Button bfbButton;
88 | private Button jdpayButton;
89 | private Button qpayButton;
90 |
91 | private String currentAmount = "";
92 |
93 | @Override
94 | public void onCreate(Bundle savedInstanceState)
95 | {
96 | super.onCreate(savedInstanceState);
97 | setContentView(R.layout.activity_client_sdk);
98 |
99 | amountEditText = (EditText) findViewById(R.id.amountEditText);
100 | wechatButton = (Button) findViewById(R.id.wechatButton);
101 | alipayButton = (Button) findViewById(R.id.alipayButton);
102 | upmpButton = (Button) findViewById(R.id.upmpButton);
103 | bfbButton = (Button) findViewById(R.id.bfbButton);
104 | jdpayButton =(Button) findViewById(R.id.jdpayButton);
105 | qpayButton =(Button) findViewById(R.id.qpayButton);
106 |
107 | wechatButton.setOnClickListener(ClientSDKActivity.this);
108 | alipayButton.setOnClickListener(ClientSDKActivity.this);
109 | upmpButton.setOnClickListener(ClientSDKActivity.this);
110 | bfbButton.setOnClickListener(ClientSDKActivity.this);
111 | jdpayButton.setOnClickListener(ClientSDKActivity.this);
112 | qpayButton.setOnClickListener(ClientSDKActivity.this);
113 |
114 | Log.d("Pingpp.VERSION", Pingpp.VERSION);
115 | Pingpp.enableDebugLog(true);
116 |
117 | amountEditText.addTextChangedListener(new TextWatcher() {
118 | @Override
119 | public void beforeTextChanged(CharSequence s, int start, int count, int after) {
120 | }
121 |
122 | @Override
123 | public void onTextChanged(CharSequence s, int start, int before, int count) {
124 | }
125 |
126 | @Override
127 | public void afterTextChanged(Editable s) {
128 | if (!s.toString().equals(currentAmount)) {
129 | amountEditText.removeTextChangedListener(this);
130 | String replaceable = String.format("[%s, \\s.]", NumberFormat.getCurrencyInstance(Locale.CHINA).getCurrency().getSymbol(Locale.CHINA));
131 | String cleanString = s.toString().replaceAll(replaceable, "");
132 |
133 | if (cleanString.equals("") || new BigDecimal(cleanString).toString().equals("0")) {
134 | amountEditText.setText(null);
135 | } else {
136 | double parsed = Double.parseDouble(cleanString);
137 | String formatted = NumberFormat.getCurrencyInstance(Locale.CHINA).format((parsed / 100));
138 | currentAmount = formatted;
139 | amountEditText.setText(formatted);
140 | amountEditText.setSelection(formatted.length());
141 | }
142 | amountEditText.addTextChangedListener(this);
143 | }
144 | }
145 | });
146 | }
147 |
148 | @Override
149 | public void onClick(View view) {
150 | String amountText = amountEditText.getText().toString();
151 | if (amountText.equals("")) return;
152 |
153 | String replaceable = String.format("[%s, \\s.]", NumberFormat.getCurrencyInstance(Locale.CHINA).getCurrency().getSymbol(Locale.CHINA));
154 | String cleanString = amountText.toString().replaceAll(replaceable, "");
155 | int amount = Integer.valueOf(new BigDecimal(cleanString).toString());
156 |
157 | // 支付宝,微信支付,银联,百度钱包,QQ钱包,京东支付 按键的点击响应处理
158 | if (view.getId() == R.id.upmpButton) {
159 | new PaymentTask().execute(new PaymentRequest(CHANNEL_UPACP, amount));
160 | } else if (view.getId() == R.id.alipayButton) {
161 | new PaymentTask().execute(new PaymentRequest(CHANNEL_ALIPAY, amount));
162 | } else if (view.getId() == R.id.wechatButton) {
163 | new PaymentTask().execute(new PaymentRequest(CHANNEL_WECHAT, amount));
164 | } else if (view.getId() == R.id.bfbButton) {
165 | new PaymentTask().execute(new PaymentRequest(CHANNEL_BFB, amount));
166 | } else if(view.getId() == R.id.jdpayButton){
167 | new PaymentTask().execute(new PaymentRequest(CHANNEL_JDPAY_WAP, amount));
168 | } else if(view.getId() == R.id.qpayButton){
169 | new PaymentTask().execute(new PaymentRequest(CHANNEL_QPAY, amount));
170 | }
171 | }
172 |
173 | class PaymentTask extends AsyncTask {
174 |
175 | @Override
176 | protected void onPreExecute() {
177 | //按键点击之后的禁用,防止重复点击
178 | wechatButton.setOnClickListener(null);
179 | alipayButton.setOnClickListener(null);
180 | upmpButton.setOnClickListener(null);
181 | bfbButton.setOnClickListener(null);
182 | qpayButton.setOnClickListener(null);
183 | }
184 |
185 | @Override
186 | protected String doInBackground(PaymentRequest... pr) {
187 | PaymentRequest paymentRequest = pr[0];
188 | String data = null;
189 | try {
190 | JSONObject object = new JSONObject();
191 | object.put("channel", paymentRequest.channel);
192 | object.put("amount", paymentRequest.amount);
193 | object.put("livemode", paymentRequest.livemode);
194 | String json = object.toString();
195 | //向Your Ping++ Server SDK请求数据
196 | data = postJson(CHARGE_URL, json);
197 | } catch (Exception e) {
198 | e.printStackTrace();
199 | }
200 | return data;
201 | }
202 |
203 | /**
204 | * 获得服务端的charge,调用ping++ sdk。
205 | */
206 | @Override
207 | protected void onPostExecute(String data) {
208 | if(null == data){
209 | showMsg("请求出错", "请检查URL", "URL无法获取charge");
210 | return;
211 | }
212 | Log.d("charge", data);
213 |
214 | /*
215 | 启用中间跳转页面,并且设置延迟 1.0s 才显示页面内容,
216 | SDK 自带非常简陋的页面布局,用户需要自定义该页面,
217 | 参考示例增加一个 pingpp_payment_activity_main.xml 布局文件。
218 | 必须保证包含三个按钮,id 分别为:
219 | pingpp_button_reopen 用于重试调用打开支付组件
220 | pingpp_button_cancel 当 SDK 无法获取结果时,用户点击这个,会返回值为 "user_cancel" 的 pay_result
221 | pingpp_button_success 同上,会返回值为 "user_success" 的 pay_result
222 | */
223 | Pingpp.enableMiddlePage(true, 1.0);
224 |
225 | // 除 QQ 钱包外,其他渠道调起支付方式:
226 | // 参数一:Activity 当前调起支付的 Activity
227 | // 参数二:data 获取到的 charge 或 order 的 JSON 字符串
228 | Pingpp.createPayment(ClientSDKActivity.this, data);
229 |
230 | // QQ 钱包调用方式
231 | // 参数一:Activity 当前调起支付的 Activity
232 | // 参数二:data 获取到的 charge 或 order 的 SON 字符串
233 | // 参数三:“qwalletXXXXXXX” 需与 AndroidManifest.xml 中的 scheme 值一致
234 | // Pingpp.createPayment(ClientSDKActivity.this, data, "qwalletXXXXXXX");
235 | }
236 | }
237 |
238 | /**
239 | * onActivityResult 获得支付结果,如果支付成功,服务器会收到ping++ 服务器发送的异步通知。
240 | * 最终支付成功根据异步通知为准
241 | */
242 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
243 |
244 | wechatButton.setOnClickListener(ClientSDKActivity.this);
245 | alipayButton.setOnClickListener(ClientSDKActivity.this);
246 | upmpButton.setOnClickListener(ClientSDKActivity.this);
247 | bfbButton.setOnClickListener(ClientSDKActivity.this);
248 | qpayButton.setOnClickListener(ClientSDKActivity.this);
249 |
250 | //支付页面返回处理
251 | if (requestCode == Pingpp.REQUEST_CODE_PAYMENT) {
252 | if (resultCode == Activity.RESULT_OK) {
253 | String result = data.getExtras().getString("pay_result");
254 | /* 处理返回值
255 | * "success" - payment succeed
256 | * "fail" - payment failed
257 | * "cancel" - user canceld
258 | * "invalid" - payment plugin not installed
259 | */
260 | String errorMsg = data.getExtras().getString("error_msg"); // 错误信息
261 | String extraMsg = data.getExtras().getString("extra_msg"); // 错误信息
262 | showMsg(result, errorMsg, extraMsg);
263 | }
264 | }
265 | }
266 |
267 | public void showMsg(String title, String msg1, String msg2) {
268 | String str = title;
269 | if (null !=msg1 && msg1.length() != 0) {
270 | str += "\n" + msg1;
271 | }
272 | if (null !=msg2 && msg2.length() != 0) {
273 | str += "\n" + msg2;
274 | }
275 | AlertDialog.Builder builder = new Builder(ClientSDKActivity.this);
276 | builder.setMessage(str);
277 | builder.setTitle("提示");
278 | builder.setPositiveButton("OK", null);
279 | builder.create().show();
280 | }
281 |
282 | /**
283 | * 获取charge
284 | * @param urlStr charge_url
285 | * @param json 获取charge的传参
286 | * @return charge
287 | * @throws IOException
288 | */
289 | private static String postJson(String urlStr, String json) throws IOException {
290 | URL url = new URL(urlStr);
291 | HttpURLConnection conn = (HttpURLConnection) url.openConnection();
292 | conn.setConnectTimeout(8000);
293 | conn.setReadTimeout(8000);
294 | conn.setRequestMethod("POST");
295 | conn.setRequestProperty("Content-Type","application/json");
296 | conn.setDoOutput(true);
297 | conn.setDoInput(true);
298 | conn.getOutputStream().write(json.getBytes());
299 |
300 | if(conn.getResponseCode() == 200) {
301 | BufferedReader
302 | reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
303 | StringBuilder response = new StringBuilder();
304 | String line;
305 | while ((line = reader.readLine()) != null) {
306 | response.append(line);
307 | }
308 | return response.toString();
309 | }
310 | return null;
311 | }
312 |
313 | class PaymentRequest {
314 | String channel;
315 | int amount;
316 | boolean livemode;
317 |
318 | public PaymentRequest(String channel, int amount) {
319 | this.channel = channel;
320 | this.amount = amount;
321 | this.livemode = LIVEMODE;
322 | }
323 | }
324 | }
325 |
--------------------------------------------------------------------------------
/example/src/main/java/com/pingxx/demoapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.pingxx.demoapp;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | public class MainActivity extends Activity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_main);
14 | }
15 |
16 | public void btnClick(View v){
17 | Class clz = null;
18 | switch (v.getId()) {
19 | case R.id.client_sdk:
20 | clz = ClientSDKActivity.class;
21 | break;
22 | default:
23 | break;
24 | }
25 | Intent intent = new Intent(MainActivity.this, clz);
26 | startActivity(intent);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | android.enableJetifier=true
2 | android.useAndroidX=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jan 15 17:30:42 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/lib/pingpp/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Log Files
26 | *.log
27 |
28 | # Android Studio Navigation editor temp files
29 | .navigation/
30 |
31 | # Android Studio captures folder
32 | captures/
33 |
34 | .settings/
--------------------------------------------------------------------------------
/lib/pingpp/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
25 |
30 |
31 |
36 |
37 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/lib/pingpp/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | }
4 |
5 | android {
6 | compileSdkVersion 33
7 | defaultConfig {
8 | minSdkVersion 19
9 | targetSdkVersion 33
10 | }
11 | buildTypes {
12 | release {
13 | minifyEnabled true
14 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
15 | }
16 | }
17 | sourceSets {
18 | main {
19 | manifest.srcFile 'AndroidManifest.xml'
20 | res.srcDirs = ['res']
21 | assets.srcDirs = ['assets']
22 | }
23 | }
24 |
25 | lintOptions {
26 | abortOnError false
27 | }
28 | }
29 |
30 | dependencies {
31 | api fileTree(include: ['*.jar'], dir: 'libs')
32 | }
33 |
--------------------------------------------------------------------------------
/lib/pingpp/libs/alipaysdk-15.8.06.211122170115.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/alipaysdk-15.8.06.211122170115.aar
--------------------------------------------------------------------------------
/lib/pingpp/libs/alipaysdk-noutdid-15.8.06.211122165332.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/alipaysdk-noutdid-15.8.06.211122165332.aar
--------------------------------------------------------------------------------
/lib/pingpp/libs/ccbnetpay_nowx_v2.2.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/ccbnetpay_nowx_v2.2.0.jar
--------------------------------------------------------------------------------
/lib/pingpp/libs/lkl-pay-sdk.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/lkl-pay-sdk.aar
--------------------------------------------------------------------------------
/lib/pingpp/libs/mqqopenpay.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/mqqopenpay.jar
--------------------------------------------------------------------------------
/lib/pingpp/libs/pingpp-android-2.3.5.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/pingpp-android-2.3.5.aar
--------------------------------------------------------------------------------
/lib/pingpp/libs/pingpp-android-upacp-3.5.9.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/pingpp-android-upacp-3.5.9.aar
--------------------------------------------------------------------------------
/lib/pingpp/libs/wechat-sdk-android-without-mta-5.1.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/libs/wechat-sdk-android-without-mta-5.1.6.jar
--------------------------------------------------------------------------------
/lib/pingpp/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 | -dontwarn com.pingplusplus.**
22 | -keep class com.pingplusplus.** {*;}
23 |
24 | -dontwarn com.alipay.**
25 | -keep class com.alipay.** {*;}
26 |
27 | -dontwarn com.ta.utdid2.**
28 | -keep class com.ta.utdid2.** {*;}
29 |
30 | -keep class com.ut.device.** {*;}
31 |
32 | -dontwarn com.tencent.**
33 | -keep class com.tencent.** {*;}
34 |
35 | -dontwarn com.unionpay.**
36 | -keep class com.unionpay.** {*;}
37 |
38 | -keepclassmembers class * {
39 | @android.webkit.JavascriptInterface ;
40 | }
--------------------------------------------------------------------------------
/lib/pingpp/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-23
15 | android.library=true
16 |
--------------------------------------------------------------------------------
/lib/pingpp/src/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PingPlusPlus/pingpp-android/aeb8520b6050ecc53af0e90e859817de9da74743/lib/pingpp/src/.gitkeep
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':lib:pingpp'
2 | include ':example'
3 |
--------------------------------------------------------------------------------