Completed
Pull Request — master (#4)
by Oleksandr
17:46 queued 08:55
created

CrefoPayStub::processNotification()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Client\CrefoPay\Zed;
9
10
use Generated\Shared\Transfer\CrefoPayNotificationTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...PayNotificationTransfer 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 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...
12
use SprykerEco\Client\CrefoPay\Dependency\Client\CrefoPayToZedRequestClientInterface;
13
14
class CrefoPayStub implements CrefoPayStubInterface
15
{
16
    /**
17
     * @var \SprykerEco\Client\CrefoPay\Dependency\Client\CrefoPayToZedRequestClientInterface
18
     */
19
    protected $zedRequestClient;
20
21
    /**
22
     * @param \SprykerEco\Client\CrefoPay\Dependency\Client\CrefoPayToZedRequestClientInterface $zedRequestClient
23
     */
24
    public function __construct(CrefoPayToZedRequestClientInterface $zedRequestClient)
25
    {
26
        $this->zedRequestClient = $zedRequestClient;
27
    }
28
29
    /**
30
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
31
     *
32
     * @return \Generated\Shared\Transfer\QuoteTransfer
33
     */
34
    public function startCrefoPayTransaction(QuoteTransfer $quoteTransfer): QuoteTransfer
35
    {
36
        /** @var \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer */
37
        $quoteTransfer = $this->zedRequestClient->call('/crefo-pay/gateway/start-crefo-pay-transaction', $quoteTransfer);
38
39
        return $quoteTransfer;
40
    }
41
42
    /**
43
     * @param \Generated\Shared\Transfer\CrefoPayNotificationTransfer $notificationTransfer
44
     *
45
     * @return \Generated\Shared\Transfer\CrefoPayNotificationTransfer
46
     */
47
    public function processNotification(CrefoPayNotificationTransfer $notificationTransfer): CrefoPayNotificationTransfer
48
    {
49
        /** @var \Generated\Shared\Transfer\CrefoPayNotificationTransfer $notificationTransfer */
50
        $notificationTransfer = $this->zedRequestClient->call('/crefo-pay/gateway/process-notification', $notificationTransfer);
51
52
        return $notificationTransfer;
53
    }
54
}
55