新支付寶微信及個人免簽支付系統中-短信信息自動回調源碼監測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.請添加一起探討研究!。