|
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\Zed\Heidelpay\Communication; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Zed\Kernel\Communication\AbstractCommunicationFactory; |
|
11
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Command\DebitOnRegistrationOmsCommand; |
|
12
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Command\HeidelpayOmsCommandByOrderInterface; |
|
13
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Command\RefundOmsCommand; |
|
14
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\HeidelpayOmsConditionInterface; |
|
15
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\IsAuthorizationFailedOmsCondition; |
|
16
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\IsAuthorizationFinishedOmsCondition; |
|
17
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\IsFinalizingFailedOmsCondition; |
|
18
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\IsFinalizingFinishedOmsCondition; |
|
19
|
|
|
use SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\IsOrderPaidOmsCondition; |
|
20
|
|
|
use SprykerEco\Zed\Heidelpay\Dependency\Facade\HeidelpayToSalesFacadeInterface; |
|
21
|
|
|
use SprykerEco\Zed\Heidelpay\HeidelpayDependencyProvider; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* @method \SprykerEco\Zed\Heidelpay\Persistence\HeidelpayQueryContainerInterface getQueryContainer() |
|
25
|
|
|
* @method \SprykerEco\Zed\Heidelpay\Persistence\HeidelpayRepositoryInterface getRepository() |
|
26
|
|
|
* @method \SprykerEco\Zed\Heidelpay\Persistence\HeidelpayEntityManagerInterface getEntityManager() |
|
27
|
|
|
* @method \SprykerEco\Zed\Heidelpay\HeidelpayConfig getConfig() |
|
28
|
|
|
* @method \SprykerEco\Zed\Heidelpay\Business\HeidelpayFacadeInterface getFacade() |
|
29
|
|
|
*/ |
|
30
|
|
|
class HeidelpayCommunicationFactory extends AbstractCommunicationFactory |
|
31
|
|
|
{ |
|
32
|
|
|
/** |
|
33
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\HeidelpayOmsConditionInterface |
|
34
|
|
|
*/ |
|
35
|
|
|
public function createIsAuthorizationFinishedOmsCondition(): HeidelpayOmsConditionInterface |
|
36
|
|
|
{ |
|
37
|
|
|
return new IsAuthorizationFinishedOmsCondition($this->getRepository()); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\HeidelpayOmsConditionInterface |
|
42
|
|
|
*/ |
|
43
|
|
|
public function createIsAuthorizationFailedOmsCondition(): HeidelpayOmsConditionInterface |
|
44
|
|
|
{ |
|
45
|
|
|
return new IsAuthorizationFailedOmsCondition($this->getRepository()); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\HeidelpayOmsConditionInterface |
|
50
|
|
|
*/ |
|
51
|
|
|
public function createIsFinalizingFinishedOmsCondition(): HeidelpayOmsConditionInterface |
|
52
|
|
|
{ |
|
53
|
|
|
return new IsFinalizingFinishedOmsCondition($this->getRepository()); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\HeidelpayOmsConditionInterface |
|
58
|
|
|
*/ |
|
59
|
|
|
public function createIsFinalizingFailedOmsCondition(): HeidelpayOmsConditionInterface |
|
60
|
|
|
{ |
|
61
|
|
|
return new IsFinalizingFailedOmsCondition($this->getRepository()); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Communication\Oms\Condition\HeidelpayOmsConditionInterface |
|
66
|
|
|
*/ |
|
67
|
|
|
public function createIsOrderPaidOmsCondition(): HeidelpayOmsConditionInterface |
|
68
|
|
|
{ |
|
69
|
|
|
return new IsOrderPaidOmsCondition( |
|
70
|
|
|
$this->getRepository(), |
|
71
|
|
|
$this->getSalesFacade() |
|
72
|
|
|
); |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Communication\Oms\Command\HeidelpayOmsCommandByOrderInterface |
|
77
|
|
|
*/ |
|
78
|
|
|
public function createDebitOnRegistrationOmsCommand(): HeidelpayOmsCommandByOrderInterface |
|
79
|
|
|
{ |
|
80
|
|
|
return new DebitOnRegistrationOmsCommand( |
|
81
|
|
|
$this->getFacade(), |
|
82
|
|
|
$this->getSalesFacade() |
|
83
|
|
|
); |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Communication\Oms\Command\HeidelpayOmsCommandByOrderInterface |
|
88
|
|
|
*/ |
|
89
|
|
|
public function createRefundOmsCommand(): HeidelpayOmsCommandByOrderInterface |
|
90
|
|
|
{ |
|
91
|
|
|
return new RefundOmsCommand( |
|
92
|
|
|
$this->getFacade(), |
|
93
|
|
|
$this->getSalesFacade() |
|
94
|
|
|
); |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* @return \SprykerEco\Zed\Heidelpay\Dependency\Facade\HeidelpayToSalesFacadeInterface |
|
99
|
|
|
*/ |
|
100
|
|
|
public function getSalesFacade(): HeidelpayToSalesFacadeInterface |
|
101
|
|
|
{ |
|
102
|
|
|
return $this->getProvidedDependency(HeidelpayDependencyProvider::FACADE_SALES); |
|
103
|
|
|
} |
|
104
|
|
|
} |
|
105
|
|
|
|