|
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\Yves\CrefoPay; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Yves\Kernel\AbstractFactory; |
|
11
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface; |
|
12
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface; |
|
13
|
|
|
use SprykerEco\Yves\CrefoPay\Dependency\Service\CrefoPayToCrefoPayApiServiceInterface; |
|
14
|
|
|
use SprykerEco\Yves\CrefoPay\Form\BillSubForm; |
|
15
|
|
|
use SprykerEco\Yves\CrefoPay\Form\CashOnDeliverySubForm; |
|
16
|
|
|
use SprykerEco\Yves\CrefoPay\Form\CreditCard3DSubForm; |
|
17
|
|
|
use SprykerEco\Yves\CrefoPay\Form\CreditCardSubForm; |
|
18
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\BillFormDataProvider; |
|
19
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\CashOnDeliveryFormDataProvider; |
|
20
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\CreditCard3DFormDataProvider; |
|
21
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\CreditCardFormDataProvider; |
|
22
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\DirectDebitFormDataProvider; |
|
23
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\PayPalFormDataProvider; |
|
24
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\PrepaidFormDataProvider; |
|
25
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DataProvider\SofortFormDataProvider; |
|
26
|
|
|
use SprykerEco\Yves\CrefoPay\Form\DirectDebitSubForm; |
|
27
|
|
|
use SprykerEco\Yves\CrefoPay\Form\PayPalSubForm; |
|
28
|
|
|
use SprykerEco\Yves\CrefoPay\Form\PrepaidSubForm; |
|
29
|
|
|
use SprykerEco\Yves\CrefoPay\Form\SofortSubForm; |
|
30
|
|
|
use SprykerEco\Yves\CrefoPay\Payment\CrefoPayPaymentExpander; |
|
31
|
|
|
use SprykerEco\Yves\CrefoPay\Payment\CrefoPayPaymentExpanderInterface; |
|
32
|
|
|
use SprykerEco\Yves\CrefoPay\Processor\Notification\CrefoPayNotificationProcessor; |
|
33
|
|
|
use SprykerEco\Yves\CrefoPay\Processor\Notification\CrefoPayNotificationProcessorInterface; |
|
34
|
|
|
use SprykerEco\Yves\CrefoPay\Processor\Notification\Mapper\CrefoPayNotificationProcessorMapper; |
|
35
|
|
|
use SprykerEco\Yves\CrefoPay\Processor\Notification\Mapper\CrefoPayNotificationProcessorMapperInterface; |
|
36
|
|
|
use SprykerEco\Yves\CrefoPay\Quote\CrefoPayQuoteExpander; |
|
37
|
|
|
use SprykerEco\Yves\CrefoPay\Quote\CrefoPayQuoteExpanderInterface; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @method \SprykerEco\Yves\CrefoPay\CrefoPayConfig getConfig() |
|
41
|
|
|
* @method \SprykerEco\Client\CrefoPay\CrefoPayClientInterface getClient() |
|
42
|
|
|
*/ |
|
43
|
|
|
class CrefoPayFactory extends AbstractFactory |
|
44
|
|
|
{ |
|
45
|
|
|
/** |
|
46
|
|
|
* @return \SprykerEco\Yves\CrefoPay\Quote\CrefoPayQuoteExpanderInterface |
|
47
|
|
|
*/ |
|
48
|
|
|
public function createQuoteExpander(): CrefoPayQuoteExpanderInterface |
|
49
|
|
|
{ |
|
50
|
|
|
return new CrefoPayQuoteExpander($this->getClient()); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @return \SprykerEco\Yves\CrefoPay\Payment\CrefoPayPaymentExpanderInterface |
|
55
|
|
|
*/ |
|
56
|
|
|
public function createPaymentExpander(): CrefoPayPaymentExpanderInterface |
|
57
|
|
|
{ |
|
58
|
|
|
return new CrefoPayPaymentExpander(); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @return \SprykerEco\Yves\CrefoPay\Processor\Notification\CrefoPayNotificationProcessorInterface |
|
63
|
|
|
*/ |
|
64
|
|
|
public function createCrefoPayNotificationProcessor(): CrefoPayNotificationProcessorInterface |
|
65
|
|
|
{ |
|
66
|
|
|
return new CrefoPayNotificationProcessor( |
|
67
|
|
|
$this->createCrefoPayNotificationProcessorMapper(), |
|
68
|
|
|
$this->getClient(), |
|
69
|
|
|
$this->getCrefoPayApiService(), |
|
70
|
|
|
); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @return \SprykerEco\Yves\CrefoPay\Processor\Notification\Mapper\CrefoPayNotificationProcessorMapperInterface |
|
75
|
|
|
*/ |
|
76
|
|
|
public function createCrefoPayNotificationProcessorMapper(): CrefoPayNotificationProcessorMapperInterface |
|
77
|
|
|
{ |
|
78
|
|
|
return new CrefoPayNotificationProcessorMapper(); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
83
|
|
|
*/ |
|
84
|
|
|
public function createBillForm(): SubFormInterface |
|
85
|
|
|
{ |
|
86
|
|
|
return new BillSubForm(); |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
91
|
|
|
*/ |
|
92
|
|
|
public function createCashOnDeliveryForm(): SubFormInterface |
|
93
|
|
|
{ |
|
94
|
|
|
return new CashOnDeliverySubForm(); |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
99
|
|
|
*/ |
|
100
|
|
|
public function createDirectDebitForm(): SubFormInterface |
|
101
|
|
|
{ |
|
102
|
|
|
return new DirectDebitSubForm(); |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
107
|
|
|
*/ |
|
108
|
|
|
public function createPayPalForm(): SubFormInterface |
|
109
|
|
|
{ |
|
110
|
|
|
return new PayPalSubForm(); |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
115
|
|
|
*/ |
|
116
|
|
|
public function createPrepaidForm(): SubFormInterface |
|
117
|
|
|
{ |
|
118
|
|
|
return new PrepaidSubForm(); |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
123
|
|
|
*/ |
|
124
|
|
|
public function createSofortForm(): SubFormInterface |
|
125
|
|
|
{ |
|
126
|
|
|
return new SofortSubForm(); |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
131
|
|
|
*/ |
|
132
|
|
|
public function createCreditCardForm(): SubFormInterface |
|
133
|
|
|
{ |
|
134
|
|
|
return new CreditCardSubForm(); |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
139
|
|
|
*/ |
|
140
|
|
|
public function createCreditCard3DForm(): SubFormInterface |
|
141
|
|
|
{ |
|
142
|
|
|
return new CreditCard3DSubForm(); |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
/** |
|
146
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
147
|
|
|
*/ |
|
148
|
|
|
public function createBillFormDataProvider(): StepEngineFormDataProviderInterface |
|
149
|
|
|
{ |
|
150
|
|
|
return new BillFormDataProvider($this->getConfig()); |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
/** |
|
154
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
155
|
|
|
*/ |
|
156
|
|
|
public function createCashOnDeliveryFormDataProvider(): StepEngineFormDataProviderInterface |
|
157
|
|
|
{ |
|
158
|
|
|
return new CashOnDeliveryFormDataProvider($this->getConfig()); |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
/** |
|
162
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
163
|
|
|
*/ |
|
164
|
|
|
public function createDirectDebitFormDataProvider(): StepEngineFormDataProviderInterface |
|
165
|
|
|
{ |
|
166
|
|
|
return new DirectDebitFormDataProvider($this->getConfig()); |
|
167
|
|
|
} |
|
168
|
|
|
|
|
169
|
|
|
/** |
|
170
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
171
|
|
|
*/ |
|
172
|
|
|
public function createPayPalFormDataProvider(): StepEngineFormDataProviderInterface |
|
173
|
|
|
{ |
|
174
|
|
|
return new PayPalFormDataProvider($this->getConfig()); |
|
175
|
|
|
} |
|
176
|
|
|
|
|
177
|
|
|
/** |
|
178
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
179
|
|
|
*/ |
|
180
|
|
|
public function createPrepaidFormDataProvider(): StepEngineFormDataProviderInterface |
|
181
|
|
|
{ |
|
182
|
|
|
return new PrepaidFormDataProvider($this->getConfig()); |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
/** |
|
186
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
187
|
|
|
*/ |
|
188
|
|
|
public function createSofortFormDataProvider(): StepEngineFormDataProviderInterface |
|
189
|
|
|
{ |
|
190
|
|
|
return new SofortFormDataProvider($this->getConfig()); |
|
191
|
|
|
} |
|
192
|
|
|
|
|
193
|
|
|
/** |
|
194
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
195
|
|
|
*/ |
|
196
|
|
|
public function createCreditCardFormDataProvider(): StepEngineFormDataProviderInterface |
|
197
|
|
|
{ |
|
198
|
|
|
return new CreditCardFormDataProvider($this->getConfig()); |
|
199
|
|
|
} |
|
200
|
|
|
|
|
201
|
|
|
/** |
|
202
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
203
|
|
|
*/ |
|
204
|
|
|
public function createCreditCard3DFormDataProvider(): StepEngineFormDataProviderInterface |
|
205
|
|
|
{ |
|
206
|
|
|
return new CreditCard3DFormDataProvider($this->getConfig()); |
|
207
|
|
|
} |
|
208
|
|
|
|
|
209
|
|
|
/** |
|
210
|
|
|
* @return \SprykerEco\Yves\CrefoPay\Dependency\Service\CrefoPayToCrefoPayApiServiceInterface |
|
211
|
|
|
*/ |
|
212
|
|
|
public function getCrefoPayApiService(): CrefoPayToCrefoPayApiServiceInterface |
|
213
|
|
|
{ |
|
214
|
|
|
return $this->getProvidedDependency(CrefoPayDependencyProvider::SERVICE_CREFO_PAY_API); |
|
215
|
|
|
} |
|
216
|
|
|
} |
|
217
|
|
|
|