[更新] 网点增加门店号
This commit is contained in:
@@ -63,6 +63,7 @@ class IndexController extends AdminController
|
||||
$filter->like('server_id', '渠道编号');
|
||||
$filter->like('outlet_id', '网点编号');
|
||||
$filter->like('PaOutletId', '平安网点id');
|
||||
$filter->like('shop_id', '门店号');
|
||||
$filter->between('created_at', '注册时间')->datetime();
|
||||
});
|
||||
$filter->column(1 / 2, function ($filter) {
|
||||
@@ -94,6 +95,10 @@ class IndexController extends AdminController
|
||||
return $this->PaOutletId ?? '---';
|
||||
});
|
||||
|
||||
$grid->column('门店号')->display(function () {
|
||||
return $this->shop_id ?? '---';
|
||||
});
|
||||
|
||||
$grid->column('所属项目')->display(function () {
|
||||
return $this->type_text;
|
||||
});
|
||||
@@ -147,6 +152,9 @@ class IndexController extends AdminController
|
||||
$export->column('网点编号', function ($value, $original) {
|
||||
return $value . "\t";
|
||||
});
|
||||
$export->column('门店号', function ($value, $original) {
|
||||
return $value . "\t";
|
||||
});
|
||||
$export->filename($this->title . date("YmdHis"));
|
||||
});
|
||||
|
||||
@@ -177,6 +185,7 @@ class IndexController extends AdminController
|
||||
]);
|
||||
|
||||
$form->text('PaOutletId', '平安网点id');
|
||||
$form->text('shop_id', '门店号')->help('银联pos里的门店号');
|
||||
|
||||
$form->select('type', '项目')
|
||||
->options(['pingan' => '平安券和自有券', 'wo' => '沃支付'])
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Http\Request;
|
||||
use League\Flysystem\Sftp\SftpAdapter;
|
||||
use League\Flysystem\Filesystem;
|
||||
use XuanChen\UnionPay\Check;
|
||||
use XuanChen\UnionPay\Models\UnionpayLog;
|
||||
|
||||
class SkyxuController extends Controller
|
||||
{
|
||||
@@ -70,4 +72,75 @@ class SkyxuController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 获取sign
|
||||
* @Author: 玄尘
|
||||
* @Date : 2021/2/19 8:17
|
||||
*/
|
||||
public function checkUnionLog()
|
||||
{
|
||||
$url = 'http://pac.ysd-bs.com/api/V1/unionpay/query';
|
||||
$info = UnionpayLog::find(177);
|
||||
$in_source = $info->in_source;
|
||||
$out_source = $info->out_source;
|
||||
$res = $this->http($in_source, $url);
|
||||
dd($res);
|
||||
dump($info->in_source);
|
||||
dump($info->out_source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 校验签名
|
||||
* @Author: 玄尘
|
||||
* @Date : 2021/2/19 9:03
|
||||
* @param $params
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function checkSign($params)
|
||||
{
|
||||
$sign = $params['sign'];
|
||||
$signStr = $params['str'];
|
||||
$app = app('xuanchen.unionpay');
|
||||
$out = false;
|
||||
if (isset($params['isout'])) {
|
||||
$out = true;
|
||||
}
|
||||
$public_key = $app->getPublic($out);
|
||||
|
||||
$pub_key_id = openssl_get_publickey($public_key);
|
||||
|
||||
dump('sign: ' . $sign);
|
||||
dump('signStr: ' . $signStr);
|
||||
|
||||
$sign = $app->hexXbin($sign);
|
||||
if (!$sign) {
|
||||
throw new \Exception('签名错误');
|
||||
}
|
||||
|
||||
if ($pub_key_id) {
|
||||
$result = (bool) openssl_verify($signStr, $sign, $pub_key_id);
|
||||
openssl_free_key($pub_key_id);
|
||||
} else {
|
||||
throw new \Exception('私钥格式有误');
|
||||
}
|
||||
$res_str = ($result === true) ? '成功' : '失败';
|
||||
dd('验签结果:' . $res_str);
|
||||
}
|
||||
|
||||
public function http($data, $url)
|
||||
{
|
||||
$client = new Client();
|
||||
$response = $client->request('POST', $url,
|
||||
[
|
||||
'form_params' => $data,
|
||||
'http_errors' => false,
|
||||
]);
|
||||
|
||||
$body = $response->getBody();
|
||||
$content = $body->getContents();
|
||||
$result = json_decode($content, true);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
return [
|
||||
//是否调试
|
||||
'debug' => false,
|
||||
'debug' => true,
|
||||
//环境变量
|
||||
'this_type' => 'test',
|
||||
//添加日志
|
||||
|
||||
Reference in New Issue
Block a user