This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeNum(number, func) { | |
if (func == null) { return number; } | |
else { return func(number); } | |
} | |
function two(func) { | |
return makeNum(2, func); | |
} | |
function three(func) { | |
return makeNum(3, func); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Ping++ 的数据可以这样获取 | |
// $rawData = file_get_contents('php://input'); | |
// 判断是否返回 1 ,最后记得返回 http_response_code(200); | |
protected function verifyPing($rawData) { | |
$headers = \Pingpp\Util\Util::getRequestHeaders();//这是Ping++的package提供的 | |
$signature = isset($headers['X-Pingplusplus-Signature']) ? $headers['X-Pingplusplus-Signature'] : NULL; | |
$publicKeyContents = file_get_contents(public_path(). '/rsa_public_key.pem');//注意这里面的文件路径相对应 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function isFromAlipay($notifyId) | |
{ | |
$url = 'https://mapi.alipay.com/gateway.do?service=notify_verify&partner=' . trim(env('ALIPAY_PID')) . '¬ify_id=' . $notifyId; | |
$response = $this->httpGet($url); | |
return (bool) preg_match("/true$/i",$response); | |
} |
NewerOlder