Payment::getRootTag()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Ratepay\Business\Api\Builder;
9
10
class Payment extends AbstractBuilder implements PaymentInterface
11
{
12
    public const ROOT_TAG = 'payment';
13
14
    /**
15
     * @return array
16
     */
17
    public function buildData()
18
    {
19
        $return = [
20
            '@method' => $this->requestTransfer->getPayment()->getMethod(),
21
            '@currency' => $this->requestTransfer->getPayment()->getCurrency(),
22
            'amount' => $this->requestTransfer->getPayment()->getAmount(),
23
            'debit-pay-type' => $this->requestTransfer->getPayment()->getDebitPayType(),
24
        ];
25
26
        if ($this->requestTransfer->getInstallmentPayment()) {
27
            $return['amount'] = $this->requestTransfer->getInstallmentPayment()->getAmount();
28
            $return['debit-pay-type'] = $this->requestTransfer->getInstallmentPayment()->getDebitPayType();
29
            $return['installment-details'] = (new InstallmentDetail($this->requestTransfer));
30
        }
31
32
        return $return;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getRootTag()
39
    {
40
        return static::ROOT_TAG;
41
    }
42
}
43