mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-11-12 21:53:44 +08:00
优化插件更新逻辑
This commit is contained in:
@@ -4,15 +4,16 @@ class MpayClass
|
||||
{
|
||||
private $pid;
|
||||
private $key;
|
||||
private $host = 'https://mpay.zhaidashi.cn/';
|
||||
private $host;
|
||||
private $check_neworder_url;
|
||||
private $submit_records_url;
|
||||
function __construct($config)
|
||||
{
|
||||
$this->pid = $config['pid'];
|
||||
$this->key = $config['key'];
|
||||
$this->check_neworder_url = $this->host . 'order.php';
|
||||
$this->submit_records_url = $this->host . 'payHeart';
|
||||
$this->host = $config['host'];
|
||||
$this->check_neworder_url = $this->host . '/order.php';
|
||||
$this->submit_records_url = $this->host . '/payHeart';
|
||||
}
|
||||
// 查询新订单
|
||||
public function orderHeart()
|
||||
|
||||
@@ -17,13 +17,13 @@ class ShouQianBa
|
||||
$this->username = $config['username'];
|
||||
$this->password = $config['password'];
|
||||
// 检查token目录
|
||||
$dir_path = runtime_path() . 'token/shouqianba';
|
||||
$dir_path = runtime_path() . 'token/sqbpay';
|
||||
if (!is_dir($dir_path)) {
|
||||
if (!mkdir($dir_path, 755, true)) {
|
||||
echo '目录创建失败';
|
||||
}
|
||||
}
|
||||
$this->token_path = $dir_path . '/' . md5($this->username . $this->password . 'ShouQianBa') . '.json';
|
||||
$this->token_path = $dir_path . '/' . md5($this->username . $this->password . 'sqbpay') . '.json';
|
||||
if (!file_exists($this->token_path)) {
|
||||
// 失效Token刷新
|
||||
$token_info = ['token' => 'Y2FjZmRiMi04MjRjLTQ2NDgtYTU0Ny1lNzg2MDllMTQ1ZTI6MTcxOTQ1Mzg0MzU3OTozNjAwMDAw.txcnX60Za8', 'expire_time' => 1719453843579];
|
||||
|
||||
Reference in New Issue
Block a user