正在显示
1 个修改的文件
包含
6 行增加
和
2 行删除
| @@ -16,10 +16,13 @@ class MinPayment | @@ -16,10 +16,13 @@ class MinPayment | ||
| 16 | */ | 16 | */ |
| 17 | protected $client; | 17 | protected $client; |
| 18 | 18 | ||
| 19 | + private $config = []; | ||
| 20 | + | ||
| 19 | 21 | ||
| 20 | public function __construct(array $config = []) | 22 | public function __construct(array $config = []) |
| 21 | { | 23 | { |
| 22 | - $this->client = new Client($config + (array)\config('min-payment')); | 24 | + $this->config = $config + (array)\config('min-payment'); |
| 25 | + $this->client = new Client($this->config); | ||
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | /** | 28 | /** |
| @@ -85,7 +88,8 @@ class MinPayment | @@ -85,7 +88,8 @@ class MinPayment | ||
| 85 | { | 88 | { |
| 86 | $sign = \Arr::get($input, $signName); | 89 | $sign = \Arr::get($input, $signName); |
| 87 | unset($input[$signName]); | 90 | unset($input[$signName]); |
| 91 | + $secret = \Arr::get($this->config, 'secret'); | ||
| 88 | 92 | ||
| 89 | - return Signature::make($input) === $sign; | 93 | + return Signature::make($input, $secret) === $sign; |
| 90 | } | 94 | } |
| 91 | } | 95 | } |
-
请 注册 或 登录 后发表评论