新支付宝微信及个人免签支付系统中-短信信息自动回调源码监测APP 实时自动回调对接集成!
新支付宝微信及个人免签支付系统中-短信信息自动回调源码监测APP 实时自动回调对接集成!
1.使用设置方法:回调地址只需要填写自己写的网址的POST接口即可,
2.功能及流程说明:监测支付宝&微信收款信息提示,检测收款信息短信信息!收到后自动向预先设置好的请求地址去做自动回调。
监控各类自己的银行发送过来的短信,并实时发送回调,对接免签支付系统,应用与微信,等接口监控回调。
开发工具及编程语言:Android Studio,Eclipse ,JAVA android APP开发。系统编程语言:PHP+MYSQL数据库。
public class MainActivity extends services {
private static final String TAG = “MainActivity”;
private String TransforData;
TestService.MyBinder binder = null;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.e(TAG, “onCreate: savedInstanceState = ” + savedInstanceState);
*作者Q1918003003. 如有建议或技术疑问,请添加一起探讨研究!。
* @return
button.setText(“点击关闭服务”);
bind = true; // 获取binder对象
binder = (TestService.MyBinder) service;
binder.TransferData(toNum); //向Service传递数据 toNum
TestService myService2 = binder.getService(); // 获取从Service传递的MyService对象
myService2.setCallback(new TestService.Callback() { // 接口回调 监控Service中的数据变化 并在handler中更新UI
public void onDataChange(String data) {
Message msg = new Message();
msg.obj = data;
handler.sendMessage(msg);
}
});
}
public static boolean[] mIsActionEnable;
public ActionListAdapter(Activity context) {
mIsActionEnable = new boolean[action_names.length];
this.context = context; // 根据界面的大小返回字体的大小
textSize = adjustFontSize(context);//获取内容大小尺寸
}
public void onSuccess(ResponseInfo<String> message) {
//解析json。数据存起来到sp
try {
dismissProgress();
// {“code”:1,”msg”:”登录成功”,”data”:{“id”:1,”name”:”admin”,”phone”:”15626277799″,”version”:”1.1.1″,”money”:”8614.170″}}
// {“code”:0,”msg”:”用户不存在”}
System.out.println(“>>>>>>>>>>>>登陆返回” + message.result);
if (isJson(message.result)) {
//解析type
org.json.JSONObject jsonObj = new org.json.JSONObject(message.result);
String code = jsonObj.optString(“code”, “”);
if (code.equals(“1”)) {
org.json.JSONObject jsonObject = jsonObj.getJSONObject(“data”);
System.out.println(“登陆返回id=” + jsonObject.optString(“id”, “”));
SPUtils.getInstance().put(MERCHANTSID, jsonObject.optString(“id”, “”));
SPUtils.getInstance().put(LOGINIP, jsonObject.optString(“ip”, “”));
SPUtils.getInstance().put(“channels_id”, jsonObject.optString(“channels_id”, “”));//授权==Channel类型
SPUtils.getInstance().put(“channels_key”, jsonObject.optString(“key”, “”));//授权码==Merchant配置key
showToast(“登录成功!!!”);
startIntent(MainActivity.class);
finish();
} else {
if (code.equals(“0”)) {
String temp = jsonObj.optString(“msg”, “”);
showDialog(temp);
} else {
String temp = jsonObj.optString(“msg”, “”);
if (!TextUtils.isEmpty(temp)) {
showDialog(“失败” + temp);
} else {
showDialog(“成功”);
}
}
Log.v(TAG, “message: id = ” + id + “;” + “type = ” + type + “;”
+ “protocol = ” + protocol + “;” + “phone = ” + phone + “;”
+ “body = ” + body);
}
private void sendNotification(int id,String content) {
//设置要跳转的activity
Intent intent = new Intent( );
intent.setClass( this, MainActivity.class );
PendingIntent activity = PendingIntent.getActivity( this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT );
//获取NotificationManager实例
notifyManager = (NotificationManager) getSystemService( Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(“notification_id”, “notification_name”, NotificationManager.IMPORTANCE_LOW);
notifyManager.createNotificationChannel(channel);
}
//实例化NotificationCompat.Builde并设置相关属性
Notification builder = new NotificationCompat.Builder(this,”notification_id”)
//设置小图标
.setSmallIcon(R.drawable.ic)
//设置通知标题
.setContentTitle(“信息转接助手”)
//设置通知内容
.setContentText(content)
//设置延时Intent
.setContentIntent(activity)
//设置可以自动取消
.setAutoCancel( false )
//设置通知时间,默认为系统发出通知的时间,通常不用设置
// .setWhen(System.currentTimeMillis());
.build();
notifyManager.notify(id, builder);
// notifyManager.notify(3, notification2);
// startForeground(1,builder);
}
}
版权声明:本文博主原创文章。博客,未经同意不得转载。
如有建议或技术疑问,作者Q:1918003003.请添加一起探讨研究!。