| Conditions | 4 |
| Paths | 8 |
| Total Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 18 |
| CRAP Score | 4.016 |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | 6 | public function getData() |
|
| 9 | { |
||
| 10 | 6 | $this->validate('amount', 'description', 'transactionId'); |
|
| 11 | |||
| 12 | 6 | $targets = $this->getTargets(); |
|
| 13 | 6 | if (!$targets) { |
|
| 14 | 6 | $targets = $this->getDescription(); |
|
| 15 | } |
||
| 16 | |||
| 17 | $data = [ |
||
| 18 | 6 | 'targets' => $targets, |
|
| 19 | 6 | 'receiver' => $this->getReceiver(), |
|
| 20 | 6 | 'quickpay-form' => $this->getQuickpayForm(), |
|
| 21 | 6 | 'paymentType' => $this->getPaymentType(), |
|
| 22 | 6 | 'sum' => $this->getAmount(), |
|
| 23 | 6 | 'label' => $this->getTransactionId(), |
|
| 24 | 6 | 'need-fio' => $this->getNeedFio(), |
|
| 25 | 6 | 'need-email' => $this->getNeedEmail(), |
|
| 26 | 6 | 'need-phone' => $this->getNeedPhone(), |
|
| 27 | 6 | 'need-address' => $this->getNeedAddress(), |
|
| 28 | ]; |
||
| 29 | |||
| 30 | 6 | if ($this->getSuccessUrl()) { |
|
| 31 | $data['successURL'] = $this->getSuccessUrl(); |
||
| 32 | } |
||
| 33 | |||
| 34 | 6 | if ($this->getTargets()) { |
|
| 35 | $data['comment'] = $this->getDescription(); |
||
| 36 | } |
||
| 37 | |||
| 38 | 6 | return $data; |
|
| 39 | } |
||
| 40 | |||
| 46 |