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