Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严琪
/
paysplug-in
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6e67daed
authored
Mar 19, 2018
by
jeffrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不知道修改了啥
parent
7a2e0b2d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
9 deletions
+66
-9
app/src/main/java/com/yuqirong/listenwechatnotification/MyApplication.java
+1
-0
app/src/main/java/com/yuqirong/listenwechatnotification/http/HttpService.java
+3
-2
app/src/main/java/com/yuqirong/listenwechatnotification/service/WeChatNotificationListenerService.java
+10
-7
接口.txt
+52
-0
No files found.
app/src/main/java/com/yuqirong/listenwechatnotification/MyApplication.java
View file @
6e67daed
...
...
@@ -12,4 +12,5 @@ public class MyApplication extends Application {
public
void
onCreate
()
{
super
.
onCreate
();
}
}
app/src/main/java/com/yuqirong/listenwechatnotification/http/HttpService.java
View file @
6e67daed
...
...
@@ -15,8 +15,9 @@ import retrofit2.http.Query;
public
interface
HttpService
{
// public String base_url = "http://test.haoyiwangluo.com/";
public
String
base_url
=
"http://www.haoyiwangluo.com/"
;
public
String
base_url
=
"http://test.haoyiwangluo.com/"
;
// public String base_url = "http://www.haoyiwangluo.com/";
public
String
notify_money_come
=
"index/pay/notify/person_app"
;
@POST
(
"index/pay/notify/person_app"
)
Call
<
String
>
postClientMoney
(
@Field
(
"notify_text"
)
String
notify_text
,
@Field
(
"pay_to"
)
String
pay_to
,
@Field
(
"type"
)
String
type
);
...
...
app/src/main/java/com/yuqirong/listenwechatnotification/service/WeChatNotificationListenerService.java
View file @
6e67daed
...
...
@@ -48,7 +48,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
private
static
String
paytype
;
private
Save2SharedPreferences
save2SharedPreferences
;
//
private Save2SharedPreferences save2SharedPreferences;
// @Override
// public void onCreate() {
...
...
@@ -62,6 +62,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
return
START_STICKY
;
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
@Override
public
void
onNotificationPosted
(
StatusBarNotification
sbn
)
{
...
...
@@ -70,15 +71,15 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
}
String
pay2set
=
""
;
save2SharedPreferences
=
new
Save2SharedPreferences
();
//
save2SharedPreferences = new Save2SharedPreferences();
if
(
aliPayPackageName
.
equals
(
sbn
.
getPackageName
()))
{
paytype
=
aliPayType
;
pay2set
=
s
ave2SharedPreferences
.
read
(
MainActivity
.
ALIPAYNAME
,
getApplicationContext
());
pay2set
=
S
ave2SharedPreferences
.
read
(
MainActivity
.
ALIPAYNAME
,
getApplicationContext
());
}
if
(
weChatPayPackageName
.
equals
(
sbn
.
getPackageName
()))
{
paytype
=
weChatPayType
;
pay2set
=
s
ave2SharedPreferences
.
read
(
MainActivity
.
WECHATPAYNAME
,
getApplicationContext
());
pay2set
=
S
ave2SharedPreferences
.
read
(
MainActivity
.
WECHATPAYNAME
,
getApplicationContext
());
}
...
...
@@ -86,8 +87,8 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
Log
.
i
(
"xiaolong"
,
"open"
+
"-----"
+
sbn
.
getPackageName
());
Log
.
i
(
"xiaolong"
,
"open"
+
"------"
+
sbn
.
getNotification
().
tickerText
);
String
alipay
=
s
ave2SharedPreferences
.
read
(
MainActivity
.
ALIPAYNAME
,
getApplicationContext
());
String
api
=
s
ave2SharedPreferences
.
read
(
MainActivity
.
API
,
getApplicationContext
());
String
alipay
=
S
ave2SharedPreferences
.
read
(
MainActivity
.
ALIPAYNAME
,
getApplicationContext
());
String
api
=
S
ave2SharedPreferences
.
read
(
MainActivity
.
API
,
getApplicationContext
());
Log
.
i
(
"xiaolong"
,
"open"
+
"-----"
+
alipay
);
Log
.
i
(
"xiaolong"
,
"open"
+
"------"
+
api
);
...
...
@@ -154,6 +155,8 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
}
cancelNotification
(
sbn
.
getKey
());
}
...
...
@@ -166,7 +169,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
public
void
run
()
{
try
{
OkHttpClient
client
=
new
OkHttpClient
();
String
api
=
s
ave2SharedPreferences
.
read
(
MainActivity
.
API
,
getApplicationContext
());
String
api
=
S
ave2SharedPreferences
.
read
(
MainActivity
.
API
,
getApplicationContext
());
//这边讲请求不用ref的方式,是因为api地址后期会随着变化而变化,不可以写成结构形式
RequestBody
requestBody
=
new
FormBody
.
Builder
()
...
...
接口.txt
0 → 100644
View file @
6e67daed
# APP接口
# APP接口
## 接口URL
http://test.fourth-pay.checheng.net/app-api/
## 接口说明
### 请求方法
POST
### 通用请求参数
token: string,由服务端生成提供
### HTTP返回码
200: 请求成功
401: TOKEN验证失败
422: 请求失败,返回{'message': '错误信息', errors: [...]}
## 接口
### 获取要生成的金额
#### 请求URL
amounts
#### 请求参数
channel: string, 支付宝为'alipaypersonal'、微信为'wechatpersonal'
username: string, 支付宝或微信的账号名称
#### 响应结果
返回所有需要生产的金额: 如[1, 2, 3]
### 提交二维码
#### 请求URL
amounts/submit
#### 请求参数
channel: string, 支付宝为'alipaypersonal'、微信为'wechatpersonal'
username: string, 支付宝或微信的账号名称
data: array, 数组中每条数据结构为{amount: 1, code: 'HTTP://alipay.com/897jas8fau0s9'}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment