Commit 6e67daed by jeffrey

不知道修改了啥

parent 7a2e0b2d
...@@ -12,4 +12,5 @@ public class MyApplication extends Application { ...@@ -12,4 +12,5 @@ public class MyApplication extends Application {
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
} }
} }
...@@ -15,8 +15,9 @@ import retrofit2.http.Query; ...@@ -15,8 +15,9 @@ import retrofit2.http.Query;
public interface HttpService { public interface HttpService {
// public String base_url = "http://test.haoyiwangluo.com/"; public String base_url = "http://test.haoyiwangluo.com/";
public String base_url = "http://www.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") @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); Call<String> postClientMoney(@Field("notify_text") String notify_text, @Field("pay_to") String pay_to, @Field("type") String type);
......
...@@ -48,7 +48,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi ...@@ -48,7 +48,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
private static String paytype; private static String paytype;
private Save2SharedPreferences save2SharedPreferences; // private Save2SharedPreferences save2SharedPreferences;
// @Override // @Override
// public void onCreate() { // public void onCreate() {
...@@ -62,6 +62,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi ...@@ -62,6 +62,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
return START_STICKY; return START_STICKY;
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override @Override
public void onNotificationPosted(StatusBarNotification sbn) { public void onNotificationPosted(StatusBarNotification sbn) {
...@@ -70,15 +71,15 @@ public class WeChatNotificationListenerService extends NotificationListenerServi ...@@ -70,15 +71,15 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
} }
String pay2set = ""; String pay2set = "";
save2SharedPreferences = new Save2SharedPreferences(); // save2SharedPreferences = new Save2SharedPreferences();
if (aliPayPackageName.equals(sbn.getPackageName())) { if (aliPayPackageName.equals(sbn.getPackageName())) {
paytype = aliPayType; paytype = aliPayType;
pay2set = save2SharedPreferences.read(MainActivity.ALIPAYNAME,getApplicationContext()); pay2set = Save2SharedPreferences.read(MainActivity.ALIPAYNAME,getApplicationContext());
} }
if (weChatPayPackageName.equals(sbn.getPackageName())) { if (weChatPayPackageName.equals(sbn.getPackageName())) {
paytype = weChatPayType; paytype = weChatPayType;
pay2set = save2SharedPreferences.read(MainActivity.WECHATPAYNAME,getApplicationContext()); pay2set = Save2SharedPreferences.read(MainActivity.WECHATPAYNAME,getApplicationContext());
} }
...@@ -86,8 +87,8 @@ public class WeChatNotificationListenerService extends NotificationListenerServi ...@@ -86,8 +87,8 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
Log.i("xiaolong", "open" + "-----" + sbn.getPackageName()); Log.i("xiaolong", "open" + "-----" + sbn.getPackageName());
Log.i("xiaolong", "open" + "------" + sbn.getNotification().tickerText); Log.i("xiaolong", "open" + "------" + sbn.getNotification().tickerText);
String alipay = save2SharedPreferences.read(MainActivity.ALIPAYNAME,getApplicationContext()); String alipay = Save2SharedPreferences.read(MainActivity.ALIPAYNAME,getApplicationContext());
String api = save2SharedPreferences.read(MainActivity.API,getApplicationContext()); String api = Save2SharedPreferences.read(MainActivity.API,getApplicationContext());
Log.i("xiaolong", "open" + "-----" + alipay); Log.i("xiaolong", "open" + "-----" + alipay);
Log.i("xiaolong", "open" + "------" + api); Log.i("xiaolong", "open" + "------" + api);
...@@ -154,6 +155,8 @@ public class WeChatNotificationListenerService extends NotificationListenerServi ...@@ -154,6 +155,8 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
} }
cancelNotification(sbn.getKey());
} }
...@@ -166,7 +169,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi ...@@ -166,7 +169,7 @@ public class WeChatNotificationListenerService extends NotificationListenerServi
public void run() { public void run() {
try { try {
OkHttpClient client = new OkHttpClient(); OkHttpClient client = new OkHttpClient();
String api = save2SharedPreferences.read(MainActivity.API,getApplicationContext()); String api = Save2SharedPreferences.read(MainActivity.API,getApplicationContext());
//这边讲请求不用ref的方式,是因为api地址后期会随着变化而变化,不可以写成结构形式 //这边讲请求不用ref的方式,是因为api地址后期会随着变化而变化,不可以写成结构形式
RequestBody requestBody = new FormBody.Builder() RequestBody requestBody = new FormBody.Builder()
......
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment