Conditions | 3 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
22 | public function __invoke(string $username = ''): string |
||
23 | { |
||
24 | try { |
||
25 | $amount = Request::getInt('amount'); |
||
26 | if ($amount === 0) { |
||
27 | return $this->json( |
||
28 | $this->getFacade()->getCallbackUrl($username), |
||
29 | ); |
||
30 | } |
||
31 | |||
32 | return $this->json( |
||
33 | $this->getFacade()->generateInvoice($username, $amount), |
||
34 | ); |
||
35 | } catch (Throwable $e) { |
||
36 | return $this->error($e); |
||
37 | } |
||
55 |