Passed
Pull Request — dev (#4)
by Mykyta
11:52 queued 07:39
created

PaypalPayment::capture()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
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\Heidelpay\Business\Adapter\Payment;
9
10
use Generated\Shared\Transfer\HeidelpayRequestTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfer\HeidelpayRequestTransfer 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 Heidelpay\PhpApi\PaymentMethods\PayPalPaymentMethod;
12
13
class PaypalPayment extends BasePayment implements PaypalPaymentInterface
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\HeidelpayRequestTransfer $authorizeRequestTransfer
17
     *
18
     * @return \Generated\Shared\Transfer\HeidelpayResponseTransfer
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfe...idelpayResponseTransfer 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...
19
     */
20 View Code Duplication
    public function authorize(HeidelpayRequestTransfer $authorizeRequestTransfer)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        $paypalMethod = new PayPalPaymentMethod();
23
        $this->prepareRequest($authorizeRequestTransfer, $paypalMethod->getRequest());
24
        $paypalMethod->authorize();
25
        return $this->verifyAndParseResponse($paypalMethod->getResponse());
26
    }
27
28
    /**
29
     * @param \Generated\Shared\Transfer\HeidelpayRequestTransfer $captureRequestTransfer
30
     *
31
     * @return \Generated\Shared\Transfer\HeidelpayResponseTransfer
32
     */
33 View Code Duplication
    public function capture(HeidelpayRequestTransfer $captureRequestTransfer)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        $paypalMethod = new PayPalPaymentMethod();
36
        $this->prepareRequest($captureRequestTransfer, $paypalMethod->getRequest());
37
        $paypalMethod->capture($captureRequestTransfer->getIdPaymentReference());
38
39
        return $this->verifyAndParseResponse($paypalMethod->getResponse());
40
    }
41
42
    /**
43
     * @param \Generated\Shared\Transfer\HeidelpayRequestTransfer $debitRequestTransfer
44
     *
45
     * @return \Generated\Shared\Transfer\HeidelpayResponseTransfer
46
     */
47 View Code Duplication
    public function debit(HeidelpayRequestTransfer $debitRequestTransfer)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
48
    {
49
        $paypalMethod = new PayPalPaymentMethod();
50
        $this->prepareRequest($debitRequestTransfer, $paypalMethod->getRequest());
51
        $paypalMethod->debit();
52
        return $this->verifyAndParseResponse($paypalMethod->getResponse());
53
    }
54
}
55