Installment::getMethodName()   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\Order\MethodMapper;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Orm\Zed\Ratepay\Persistence\SpyPaymentRatepay;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Ratepay\Persistence\SpyPaymentRatepay was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use SprykerEco\Shared\Ratepay\RatepayConfig;
13
14
class Installment extends AbstractMapper
15
{
16
    /**
17
     * @return string
18
     */
19
    public function getMethodName()
20
    {
21
        return RatepayConfig::INSTALLMENT;
22
    }
23
24
    /**
25
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
26
     *
27
     * @return \Generated\Shared\Transfer\RatepayPaymentInstallmentTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...mentInstallmentTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
28
     */
29
    protected function getPaymentTransfer(QuoteTransfer $quoteTransfer)
30
    {
31
        return $quoteTransfer->getPayment()->getRatepayInstallment();
32
    }
33
34
    /**
35
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
36
     * @param \Orm\Zed\Ratepay\Persistence\SpyPaymentRatepay $payment
37
     *
38
     * @return void
39
     */
40
    public function mapMethodDataToPayment(QuoteTransfer $quoteTransfer, SpyPaymentRatepay $payment)
41
    {
42
        parent::mapMethodDataToPayment($quoteTransfer, $payment);
43
44
        $paymentTransfer = $this->getPaymentTransfer($quoteTransfer);
45
        $payment
46
            ->setBankAccountBic($paymentTransfer->getBankAccountBic())
47
            ->setBankAccountIban($paymentTransfer->getBankAccountIban())
48
49
            ->setDebitPayType($paymentTransfer->getDebitPayType())
50
51
            ->setInstallmentTotalAmount($paymentTransfer->getInstallmentGrandTotalAmount())
52
            ->setInstallmentInterestAmount($paymentTransfer->getInstallmentInterestAmount())
53
            ->setInstallmentInterestRate($paymentTransfer->getInstallmentInterestRate())
54
            ->setInstallmentLastRate($paymentTransfer->getInstallmentLastRate())
55
            ->setInstallmentRate($paymentTransfer->getInstallmentRate())
56
            ->setInstallmentPaymentFirstDay($paymentTransfer->getInstallmentPaymentFirstDay())
57
            ->setInstallmentMonth($paymentTransfer->getInstallmentMonth())
58
            ->setInstallmentNumberRates($paymentTransfer->getInstallmentNumberRates())
59
            ->setInstallmentCalculationStart($paymentTransfer->getInstallmentCalculationStart())
60
            ->setInstallmentServiceCharge($paymentTransfer->getInstallmentServiceCharge())
61
            ->setInstallmentAnnualPercentageRate($paymentTransfer->getInstallmentAnnualPercentageRate())
62
            ->setInstallmentMonthAllowed($paymentTransfer->getInstallmentMonthAllowed());
63
    }
64
}
65