@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function register(Container $pimple) |
| 31 | 31 | { |
| 32 | - $pimple['logger'] = function ($app) { |
|
| 32 | + $pimple[ 'logger' ] = function ($app) { |
|
| 33 | 33 | $config = $this->logConfig($app); |
| 34 | 34 | |
| 35 | 35 | return new Log($config); |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function logConfig($app) |
| 47 | 47 | { |
| 48 | - $logConfig = []; |
|
| 49 | - if (!empty($app['config']->get('log'))) { |
|
| 50 | - $logConfig = $app['config']->get('log'); |
|
| 48 | + $logConfig = [ ]; |
|
| 49 | + if (!empty($app[ 'config' ]->get('log'))) { |
|
| 50 | + $logConfig = $app[ 'config' ]->get('log'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return array_merge([ |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | 'product_code' => 'FACE_TO_FACE_PAYMENT', |
| 40 | 40 | ], $params); |
| 41 | 41 | $this->app->setEndpointConfig($method, [ |
| 42 | - 'notify_url' => $this->app['config']->get('notify_url'), |
|
| 42 | + 'notify_url' => $this->app[ 'config' ]->get('notify_url'), |
|
| 43 | 43 | ]); |
| 44 | 44 | |
| 45 | 45 | return $this->request($method, [ |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $method = 'alipay.trade.create'; |
| 64 | 64 | $this->app->setEndpointConfig($method, [ |
| 65 | - 'notify_url' => $this->app['config']->get('notify_url'), |
|
| 65 | + 'notify_url' => $this->app[ 'config' ]->get('notify_url'), |
|
| 66 | 66 | ]); |
| 67 | 67 | |
| 68 | 68 | return $this->request($method, [ |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $method = 'alipay.trade.precreate'; |
| 87 | 87 | $this->app->setEndpointConfig($method, [ |
| 88 | - 'notify_url' => $this->app['config']->get('notify_url'), |
|
| 88 | + 'notify_url' => $this->app[ 'config' ]->get('notify_url'), |
|
| 89 | 89 | ]); |
| 90 | 90 | |
| 91 | 91 | return $this->request($method, [ |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | return !($this->checkEmpty($value)); |
| 119 | 119 | }); |
| 120 | 120 | $this->app->setEndpointConfig($method, [ |
| 121 | - 'notify_url' => $this->app['config']->get('notify_url'), |
|
| 121 | + 'notify_url' => $this->app[ 'config' ]->get('notify_url'), |
|
| 122 | 122 | ]); |
| 123 | 123 | |
| 124 | 124 | return $this->request($method, [ |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException |
| 141 | 141 | * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException |
| 142 | 142 | */ |
| 143 | - public function refund(string $tradeNo, $amount, string $outTradeNo = null, array $params = []) |
|
| 143 | + public function refund(string $tradeNo, $amount, string $outTradeNo = null, array $params = [ ]) |
|
| 144 | 144 | { |
| 145 | 145 | $params = array_merge(array_filter([ |
| 146 | 146 | 'trade_no' => $tradeNo, |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function orderSettle(string $outRequestNo, string $tradeNo, array $royaltyParameters, string $operatorId = null) |
| 227 | 227 | { |
| 228 | - $royalty = []; |
|
| 228 | + $royalty = [ ]; |
|
| 229 | 229 | if (count($royaltyParameters) === count($royaltyParameters, COUNT_RECURSIVE)) { |
| 230 | - $royalty[0] = $royaltyParameters; |
|
| 230 | + $royalty[ 0 ] = $royaltyParameters; |
|
| 231 | 231 | } else { |
| 232 | 232 | $royalty = $royaltyParameters; |
| 233 | 233 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | }); |
| 273 | 273 | |
| 274 | 274 | if (!($this->checkEmpty($orderBizInfo))) { |
| 275 | - $params['order_biz_info'] = json_encode(['status' => $orderBizInfo]); |
|
| 275 | + $params[ 'order_biz_info' ] = json_encode([ 'status' => $orderBizInfo ]); |
|
| 276 | 276 | } |
| 277 | 277 | return $this->request('alipay.trade.orderinfo.sync', [ |
| 278 | 278 | 'biz_content' => $params, |
@@ -42,6 +42,6 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function __call($name, $arguments) |
| 44 | 44 | { |
| 45 | - return call_user_func_array([$this['base'], $name], $arguments); |
|
| 45 | + return call_user_func_array([ $this[ 'base' ], $name ], $arguments); |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | ], $params); |
| 40 | 40 | |
| 41 | 41 | $this->app->setEndpointConfig($method, [ |
| 42 | - 'return_url' => $returnUrl ?: $this->app['config']->get('return_url'), |
|
| 43 | - 'notify_url' => $this->app['config']->get('notify_url'), |
|
| 42 | + 'return_url' => $returnUrl ?: $this->app[ 'config' ]->get('return_url'), |
|
| 43 | + 'notify_url' => $this->app[ 'config' ]->get('notify_url'), |
|
| 44 | 44 | ]); |
| 45 | 45 | |
| 46 | 46 | return $this->sdkExecute($method, [ |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | ], $params); |
| 69 | 69 | |
| 70 | 70 | $this->app->setEndpointConfig($method, [ |
| 71 | - 'return_url' => $returnUrl ?: $this->app['config']->get('return_url'), |
|
| 72 | - 'notify_url' => $this->app['config']->get('notify_url'), |
|
| 71 | + 'return_url' => $returnUrl ?: $this->app[ 'config' ]->get('return_url'), |
|
| 72 | + 'notify_url' => $this->app[ 'config' ]->get('notify_url'), |
|
| 73 | 73 | ]); |
| 74 | 74 | |
| 75 | 75 | return $this->pageExecute($method, [ |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | 'product_code' => 'FAST_INSTANT_TRADE_PAY', |
| 97 | 97 | ], $params); |
| 98 | 98 | $this->app->setEndpointConfig($method, [ |
| 99 | - 'return_url' => $returnUrl ?: $this->app['config']->get('return_url'), |
|
| 100 | - 'notify_url' => $this->app['config']->get('notify_url'), |
|
| 99 | + 'return_url' => $returnUrl ?: $this->app[ 'config' ]->get('return_url'), |
|
| 100 | + 'notify_url' => $this->app[ 'config' ]->get('notify_url'), |
|
| 101 | 101 | ]); |
| 102 | 102 | |
| 103 | 103 | return $this->pageExecute($method, [ |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function getBaseInfo() |
| 27 | 27 | { |
| 28 | 28 | $method = 'alipay.open.mini.baseinfo.query'; |
| 29 | - $params = []; |
|
| 29 | + $params = [ ]; |
|
| 30 | 30 | |
| 31 | 31 | return $this->request($method, [ |
| 32 | 32 | 'biz_content' => $params, |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | public function getCategoryList() |
| 151 | 151 | { |
| 152 | 152 | $method = 'alipay.open.mini.category.query'; |
| 153 | - $params = []; |
|
| 153 | + $params = [ ]; |
|
| 154 | 154 | |
| 155 | 155 | return $this->request($method, [ |
| 156 | 156 | 'biz_content' => $params, |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | public function faceAuthenticationResultsQuery() |
| 170 | 170 | { |
| 171 | 171 | $method = 'zoloz.identification.customer.certifyzhub.query'; |
| 172 | - $params = []; |
|
| 172 | + $params = [ ]; |
|
| 173 | 173 | |
| 174 | 174 | return $this->request($method, [ |
| 175 | 175 | 'biz_content' => $params, |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | public function getList() |
| 198 | 198 | { |
| 199 | 199 | $method = 'alipay.open.mini.version.list.query'; |
| 200 | - $params = []; |
|
| 200 | + $params = [ ]; |
|
| 201 | 201 | |
| 202 | 202 | return $this->request($method, [ |
| 203 | 203 | 'biz_content' => $params, |
@@ -56,6 +56,6 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function __call($name, $arguments) |
| 58 | 58 | { |
| 59 | - return call_user_func_array([$this['base'], $name], $arguments); |
|
| 59 | + return call_user_func_array([ $this[ 'base' ], $name ], $arguments); |
|
| 60 | 60 | } |
| 61 | 61 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | class Alipay |
| 27 | 27 | { |
| 28 | - protected static $config = []; |
|
| 28 | + protected static $config = [ ]; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * make. |
@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @throws \EasyAlipay\Kernel\Exceptions\ApplicationException |
| 39 | 39 | */ |
| 40 | - public static function make(string $name, array $config = []) |
|
| 40 | + public static function make(string $name, array $config = [ ]) |
|
| 41 | 41 | { |
| 42 | 42 | $namespace = Str::studly($name); |
| 43 | - $application = __NAMESPACE__."\\{$namespace}\\Application"; |
|
| 43 | + $application = __NAMESPACE__ . "\\{$namespace}\\Application"; |
|
| 44 | 44 | |
| 45 | 45 | if (class_exists($application)) { |
| 46 | 46 | $config = array_replace_recursive(self::$config, $config); |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | public function run(Closure $closure): Response |
| 73 | 73 | { |
| 74 | 74 | try { |
| 75 | - $response = \call_user_func($closure, $this->getMessage(), [$this, 'response']); |
|
| 75 | + $response = \call_user_func($closure, $this->getMessage(), [ $this, 'response' ]); |
|
| 76 | 76 | } catch (\Exception $e) { |
| 77 | - $this->app['logger']->error('Alipay asynchronous notification fatal error:'.$e->getMessage()); |
|
| 77 | + $this->app[ 'logger' ]->error('Alipay asynchronous notification fatal error:' . $e->getMessage()); |
|
| 78 | 78 | $response = $this->response(false); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function getMessage(): Collection |
| 109 | 109 | { |
| 110 | - $signData = $request = $this->app['request']->request->all(); |
|
| 111 | - unset($signData['sign'], $signData['sign_type']); |
|
| 112 | - if ($this->verify($this->getSignContentUrlencode($signData), $request['sign'], $request['sign_type'])) { |
|
| 110 | + $signData = $request = $this->app[ 'request' ]->request->all(); |
|
| 111 | + unset($signData[ 'sign' ], $signData[ 'sign_type' ]); |
|
| 112 | + if ($this->verify($this->getSignContentUrlencode($signData), $request[ 'sign' ], $request[ 'sign_type' ])) { |
|
| 113 | 113 | return new Collection($request); |
| 114 | 114 | } |
| 115 | 115 | |