Blogger Information
Blog 19
fans 0
comment 1
visits 19333
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
微信个人支付接口 免签约微信支付 支付宝接口开发原理+软件下载+代码
TANKING的代码日志
Original
2178 people have browsed it

前言

要做免签约微信支付的话,很简单,就是使用软件来监听微信收款通知栏的通知,然后将结果返回给服务器,这样就可以做回调。

软件

这个软件叫做“双卡助手”,是一个监听手机短信、应用通知的软件,他可以将你手机的短信、应用通知等信息进行转发,可以转发到邮箱,公众号,甚至是手机号,还可以转发给服务器。

那么我们只需要使用他这个特性,将收到的微信支付通知,转发给服务器就可以了。

设置

要转发的内容我们选择【应用通知】,进去选择微信。选择转发方式,选择【使用网络转发】,进去填写POST或者GET接口。


然后就可以狂奔啦!记得开启无障碍还有开启后台运行、自启等权限。

服务端

服务端我就简单写写

<?php$servername = "";$username = "";$password = "";$dbname = "";$data = $_GET["desp"];$data_2 = $_GET["text"];//截取数据$tofee_1 = substr($data,strripos($data,"款")+3);$tofee_2 = substr($tofee_1,0,strrpos($tofee_1,"元"));echo $tofee_2;$con = mysql_connect($servername,$username,$password);if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db($dbname, $con);if (strpos($data,'微信支付') ) {    mysql_query("INSERT INTO test (text_1, text_2) VALUES ('$tofee_2','$data_2')");}else{    //}mysql_close($con);?>

流程

首先在配置转发接口的时候,我们只需要传1个参数就行,其他都是没什么意义的参数,那就是desp

这是通知栏的内容,例如微信制支付后,接收到的内容是:微信支付收款0.01元(朋友到店)

我们只需要提取0.01就行了,告诉服务器,收到了0.01元,就可以做回调了。

这个软件的缺点是,只要是微信收到的通知都会转发,例如好友发一条信息过来,也会给POST的,所以我们在后端要做好过滤,只接收带有【微信支付】字眼的通知就行了。

Demo

这是我简单做一个微信支付的demo,可以体验下反应速度和效果
http://www.liketube.cn/test/wx_pay/pay.php

软件下载

https://www.coolapk.com/apk/com.cozylife.smshelper

Author:TANKING
Date:2020-03-18
WeChat:face6009

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!