Conditions | 5 |
Paths | 8 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function handle(Closure $closure) |
||
41 | { |
||
42 | $result = \call_user_func($closure, $this->getMessage(), [$this, 'fail'], [$this, 'alert']); |
||
43 | |||
44 | $attributes = [ |
||
45 | 'result_code' => is_null($this->alert) && is_null($this->fail) ? static::SUCCESS : static::FAIL, |
||
46 | 'err_code_des' => $this->alert, |
||
47 | ]; |
||
48 | |||
49 | if (is_null($this->alert) && is_string($result)) { |
||
50 | $attributes += [ |
||
51 | 'appid' => $this->app['config']->app_id, |
||
52 | 'mch_id' => $this->app['config']->mch_id, |
||
53 | 'nonce_str' => uniqid(), |
||
54 | 'prepay_id' => $result, |
||
55 | ]; |
||
56 | } |
||
57 | |||
58 | return $this->respondWith($attributes, true)->toResponse(); |
||
59 | } |
||
61 |