- 新增epay v2、v3、v3new版本的支付类库及证书文件 - 新增cos云存储类库文件 - 调整文件上传保存格式为按分类存储 - 修复会员、规则、类目等语言翻译键名 - 新增小程序图标等静态资源文件
24 行
628 B
PHP
24 行
628 B
PHP
<?php
|
|
|
|
namespace Qcloud\Cos;
|
|
|
|
use Psr\Http\Message\RequestInterface;
|
|
|
|
class SignatureMiddleware {
|
|
private $nextHandler;
|
|
protected $signature;
|
|
|
|
/**
|
|
* @param callable $nextHandler Next handler to invoke.
|
|
*/
|
|
public function __construct(callable $nextHandler, $accessKey, $secretKey, $options) {
|
|
$this->nextHandler = $nextHandler;
|
|
$this->signature = new Signature($accessKey, $secretKey, $options);
|
|
}
|
|
|
|
public function __invoke(RequestInterface $request, array $options) {
|
|
$fn = $this->nextHandler;
|
|
return $fn($this->signature->signRequest($request), $options);
|
|
}
|
|
}
|