RequestPaymentTransaction::request()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 17
rs 9.8666
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\Request\Payment\Handler\Transaction;
9
10
use Generated\Shared\Transfer\RatepayPaymentRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...yPaymentRequestTransfer 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 SprykerEco\Zed\Ratepay\Business\Api\Constants as ApiConstants;
12
13
class RequestPaymentTransaction extends BaseTransaction implements RequestPaymentTransactionInterface
14
{
15
    public const TRANSACTION_TYPE = ApiConstants::REQUEST_MODEL_PAYMENT_REQUEST;
16
17
    /**
18
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
19
     *
20
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\RatepayResponseTransfer 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...
21
     */
22
    public function request(RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer)
23
    {
24
        $paymentMethodName = $ratepayPaymentRequestTransfer
25
            ->getRatepayPaymentInit()
26
            ->getPaymentMethodName();
27
28
        $request = $this->getMethodMapper($paymentMethodName)
29
            ->paymentRequest($ratepayPaymentRequestTransfer);
0 ignored issues
show
Bug introduced by
The method paymentRequest() does not exist on SprykerEco\Zed\Ratepay\B...\Method\MethodInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
            ->/** @scrutinizer ignore-call */ paymentRequest($ratepayPaymentRequestTransfer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
30
        $response = $this->sendRequest((string)$request);
31
        $this->logInfo($request, $response, $paymentMethodName, $ratepayPaymentRequestTransfer->getOrderId());
32
33
        $responseTransfer = $this->converterFactory
34
            ->createTransferObjectConverter($response)
35
            ->convert();
36
        $this->fixResponseTransferTransactionId($responseTransfer, $responseTransfer->getTransactionId(), $responseTransfer->getTransactionShortId());
0 ignored issues
show
Bug introduced by
The method getTransactionShortId() does not exist on Spryker\Shared\Kernel\Transfer\AbstractTransfer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
        $this->fixResponseTransferTransactionId($responseTransfer, $responseTransfer->getTransactionId(), $responseTransfer->/** @scrutinizer ignore-call */ getTransactionShortId());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getTransactionId() does not exist on Spryker\Shared\Kernel\Transfer\AbstractTransfer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
        $this->fixResponseTransferTransactionId($responseTransfer, $responseTransfer->/** @scrutinizer ignore-call */ getTransactionId(), $responseTransfer->getTransactionShortId());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
38
        return $responseTransfer;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $responseTransfer returns the type Spryker\Shared\Kernel\Transfer\AbstractTransfer which is incompatible with the documented return type Generated\Shared\Transfer\RatepayResponseTransfer.
Loading history...
39
    }
40
}
41