1
This commit is contained in:
parent
55e2f8c7e8
commit
0e6cb66fd5
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use hema\wechat\Index;
|
||||
use hema\wechat\Pay as WxPay;
|
||||
use app\api\model\Record as RecordModel;
|
||||
|
||||
@ -14,9 +16,11 @@ class Wechat
|
||||
/**
|
||||
* 微信小程序充值成功异步通知
|
||||
*/
|
||||
public function wxapp()
|
||||
public function index()
|
||||
{
|
||||
$WxPay = new WxPay([]);
|
||||
$WxPay->notify(new RecordModel,'','add');
|
||||
$WxPay = new Index();
|
||||
$WxPay->index();
|
||||
|
||||
var_dump(2222222222);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace hema\wechat;
|
||||
|
||||
use app\applet\model\Setting as SettingModel;
|
||||
@ -14,14 +15,20 @@ class Index
|
||||
{
|
||||
private $config;
|
||||
private $error;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$value = Setting::getItem('wxopen');
|
||||
$value['component_access_token'] = Cache::get('component_access_token','');
|
||||
$this->config = $value;
|
||||
|
||||
$config = [
|
||||
'app_id' => 'wx89c12dd426a55a2e',
|
||||
'appSecret' => '33e66bcf944f9810abbb5ddd7825403d',
|
||||
'token' => 'cxhxy',
|
||||
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -29,6 +36,12 @@ class Index
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (isset($_GET['echostr'])) {
|
||||
echo $_GET["echostr"];
|
||||
exit;
|
||||
}
|
||||
|
||||
die('success');
|
||||
//接收微信推送数据
|
||||
$nonce = empty ($_GET ['nonce']) ? "" : trim($_GET ['nonce']);
|
||||
$signature = empty ($_GET['signature']) ? "" : trim($_GET ['signature']);
|
||||
@ -73,17 +86,9 @@ class Index
|
||||
}
|
||||
die('success');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user