|
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\Yves\Computop; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Yves\Kernel\AbstractFactory; |
|
11
|
|
|
use Spryker\Yves\Router\Router\RouterInterface; |
|
12
|
|
|
use SprykerEco\Yves\Computop\Converter\InitCreditCardConverter; |
|
13
|
|
|
use SprykerEco\Yves\Computop\Converter\InitDirectDebitConverter; |
|
14
|
|
|
use SprykerEco\Yves\Computop\Converter\InitEasyCreditConverter; |
|
15
|
|
|
use SprykerEco\Yves\Computop\Converter\InitIdealConverter; |
|
16
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPaydirektConverter; |
|
17
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPayNowConverter; |
|
18
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPayPalConverter; |
|
19
|
|
|
use SprykerEco\Yves\Computop\Converter\InitSofortConverter; |
|
20
|
|
|
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface; |
|
21
|
|
|
use SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface; |
|
22
|
|
|
use SprykerEco\Yves\Computop\Form\CreditCardSubForm; |
|
23
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\CreditCardFormDataProvider; |
|
24
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\DirectDebitFormDataProvider; |
|
25
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\EasyCreditFormDataProvider; |
|
26
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\IdealFormDataProvider; |
|
27
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PaydirektFormDataProvider; |
|
28
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PayNowFormDataProvider; |
|
29
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PayPalFormDataProvider; |
|
30
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\SofortFormDataProvider; |
|
31
|
|
|
use SprykerEco\Yves\Computop\Form\DirectDebitSubForm; |
|
32
|
|
|
use SprykerEco\Yves\Computop\Form\EasyCreditSubForm; |
|
33
|
|
|
use SprykerEco\Yves\Computop\Form\IdealSubForm; |
|
34
|
|
|
use SprykerEco\Yves\Computop\Form\PaydirektSubForm; |
|
35
|
|
|
use SprykerEco\Yves\Computop\Form\PayNowSubForm; |
|
36
|
|
|
use SprykerEco\Yves\Computop\Form\PayPalSubForm; |
|
37
|
|
|
use SprykerEco\Yves\Computop\Form\SofortSubForm; |
|
38
|
|
|
use SprykerEco\Yves\Computop\Handler\ComputopPaymentHandler; |
|
39
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopCreditCardPaymentHandler; |
|
40
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopDirectDebitPaymentHandler; |
|
41
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopEasyCreditPaymentHandler; |
|
42
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopIdealPaymentHandler; |
|
43
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPaydirektPaymentHandler; |
|
44
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayNowPaymentHandler; |
|
45
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayPalPaymentHandler; |
|
46
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopSofortPaymentHandler; |
|
47
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\CreditCardMapper; |
|
48
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\DirectDebitMapper; |
|
49
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\EasyCreditMapper; |
|
50
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\IdealMapper; |
|
51
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PaydirektMapper; |
|
52
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayNowMapper; |
|
53
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayPalMapper; |
|
54
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\SofortMapper; |
|
55
|
|
|
use Symfony\Component\HttpFoundation\RequestStack; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @method \SprykerEco\Yves\Computop\ComputopConfig getConfig() |
|
59
|
|
|
* @method \SprykerEco\Client\Computop\ComputopClientInterface getClient() |
|
60
|
|
|
*/ |
|
61
|
|
|
class ComputopFactory extends AbstractFactory |
|
62
|
|
|
{ |
|
63
|
|
|
/** |
|
64
|
|
|
* @return \SprykerEco\Yves\Computop\ComputopConfigInterface |
|
65
|
|
|
*/ |
|
66
|
|
|
public function getComputopConfig() |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->getConfig(); |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPaymentHandlerInterface |
|
73
|
|
|
*/ |
|
74
|
|
|
public function createComputopPaymentHandler() |
|
75
|
|
|
{ |
|
76
|
|
|
return new ComputopPaymentHandler($this->getConfig()); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
81
|
|
|
*/ |
|
82
|
|
|
public function createCreditCardForm() |
|
83
|
|
|
{ |
|
84
|
|
|
return new CreditCardSubForm(); |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
89
|
|
|
*/ |
|
90
|
|
|
public function createPayNowForm() |
|
91
|
|
|
{ |
|
92
|
|
|
return new PayNowSubForm(); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
97
|
|
|
*/ |
|
98
|
|
|
public function createPayPalForm() |
|
99
|
|
|
{ |
|
100
|
|
|
return new PayPalSubForm(); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
105
|
|
|
*/ |
|
106
|
|
|
public function createSofortForm() |
|
107
|
|
|
{ |
|
108
|
|
|
return new SofortSubForm(); |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
113
|
|
|
*/ |
|
114
|
|
|
public function createDirectDebitForm() |
|
115
|
|
|
{ |
|
116
|
|
|
return new DirectDebitSubForm(); |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
/** |
|
120
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
121
|
|
|
*/ |
|
122
|
|
|
public function createPaydirektForm() |
|
123
|
|
|
{ |
|
124
|
|
|
return new PaydirektSubForm(); |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
129
|
|
|
*/ |
|
130
|
|
|
public function createIdealForm() |
|
131
|
|
|
{ |
|
132
|
|
|
return new IdealSubForm(); |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
137
|
|
|
*/ |
|
138
|
|
|
public function createEasyCreditForm() |
|
139
|
|
|
{ |
|
140
|
|
|
return new EasyCreditSubForm(); |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
/** |
|
144
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
145
|
|
|
*/ |
|
146
|
|
|
public function createCreditCardFormDataProvider() |
|
147
|
|
|
{ |
|
148
|
|
|
return new CreditCardFormDataProvider($this->getQuoteClient(), $this->createOrderCreditCardMapper()); |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
/** |
|
152
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
153
|
|
|
*/ |
|
154
|
|
|
public function createPayNowFormDataProvider() |
|
155
|
|
|
{ |
|
156
|
|
|
return new PayNowFormDataProvider($this->getQuoteClient(), $this->createOrderPayNowMapper()); |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
161
|
|
|
*/ |
|
162
|
|
|
public function createPayPalFormDataProvider() |
|
163
|
|
|
{ |
|
164
|
|
|
return new PayPalFormDataProvider($this->getQuoteClient(), $this->createOrderPayPalMapper()); |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
/** |
|
168
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
169
|
|
|
*/ |
|
170
|
|
|
public function createSofortFormDataProvider() |
|
171
|
|
|
{ |
|
172
|
|
|
return new SofortFormDataProvider($this->getQuoteClient(), $this->createOrderSofortMapper()); |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
/** |
|
176
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
177
|
|
|
*/ |
|
178
|
|
|
public function createDirectDebitFormDataProvider() |
|
179
|
|
|
{ |
|
180
|
|
|
return new DirectDebitFormDataProvider($this->getQuoteClient(), $this->createOrderDirectDebitMapper()); |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
/** |
|
184
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
185
|
|
|
*/ |
|
186
|
|
|
public function createPaydirektFormDataProvider() |
|
187
|
|
|
{ |
|
188
|
|
|
return new PaydirektFormDataProvider($this->getQuoteClient(), $this->createOrderPaydirektMapper()); |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
/** |
|
192
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
193
|
|
|
*/ |
|
194
|
|
|
public function createIdealFormDataProvider() |
|
195
|
|
|
{ |
|
196
|
|
|
return new IdealFormDataProvider($this->getQuoteClient(), $this->createOrderIdealMapper()); |
|
197
|
|
|
} |
|
198
|
|
|
|
|
199
|
|
|
/** |
|
200
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
201
|
|
|
*/ |
|
202
|
|
|
public function createEasyCreditFormDataProvider() |
|
203
|
|
|
{ |
|
204
|
|
|
return new EasyCreditFormDataProvider($this->getQuoteClient(), $this->createOrderEasyCreditMapper()); |
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
/** |
|
208
|
|
|
* @return \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface |
|
209
|
|
|
*/ |
|
210
|
|
|
public function getComputopApiService() |
|
211
|
|
|
{ |
|
212
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_COMPUTOP_API); |
|
213
|
|
|
} |
|
214
|
|
|
|
|
215
|
|
|
/** |
|
216
|
|
|
* @return \Symfony\Component\HttpKernel\HttpKernelInterface |
|
217
|
|
|
*/ |
|
218
|
|
|
public function getApplication() |
|
219
|
|
|
{ |
|
220
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::PLUGIN_APPLICATION); |
|
221
|
|
|
} |
|
222
|
|
|
|
|
223
|
|
|
/** |
|
224
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface |
|
225
|
|
|
*/ |
|
226
|
|
|
public function getQuoteClient() |
|
227
|
|
|
{ |
|
228
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_QUOTE); |
|
229
|
|
|
} |
|
230
|
|
|
|
|
231
|
|
|
/** |
|
232
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
233
|
|
|
*/ |
|
234
|
|
|
public function createCreditCardPaymentHandler() |
|
235
|
|
|
{ |
|
236
|
|
|
return new ComputopCreditCardPaymentHandler($this->createInitCreditCardConverter(), $this->getComputopClient()); |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
/** |
|
240
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
241
|
|
|
*/ |
|
242
|
|
|
public function createPayNowPaymentHandler() |
|
243
|
|
|
{ |
|
244
|
|
|
return new ComputopPayNowPaymentHandler($this->createInitPayNowConverter(), $this->getComputopClient()); |
|
245
|
|
|
} |
|
246
|
|
|
|
|
247
|
|
|
/** |
|
248
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
249
|
|
|
*/ |
|
250
|
|
|
public function createPayPalPaymentHandler() |
|
251
|
|
|
{ |
|
252
|
|
|
return new ComputopPayPalPaymentHandler($this->createInitPayPalConverter(), $this->getComputopClient()); |
|
253
|
|
|
} |
|
254
|
|
|
|
|
255
|
|
|
/** |
|
256
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
257
|
|
|
*/ |
|
258
|
|
|
public function createDirectDebitPaymentHandler() |
|
259
|
|
|
{ |
|
260
|
|
|
return new ComputopDirectDebitPaymentHandler($this->createInitDirectDebitConverter(), $this->getComputopClient()); |
|
261
|
|
|
} |
|
262
|
|
|
|
|
263
|
|
|
/** |
|
264
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
265
|
|
|
*/ |
|
266
|
|
|
public function createEasyCreditPaymentHandler() |
|
267
|
|
|
{ |
|
268
|
|
|
return new ComputopEasyCreditPaymentHandler( |
|
269
|
|
|
$this->createInitEasyCreditConverter(), |
|
270
|
|
|
$this->getComputopClient(), |
|
271
|
|
|
$this->getCalculationClient() |
|
272
|
|
|
); |
|
273
|
|
|
} |
|
274
|
|
|
|
|
275
|
|
|
/** |
|
276
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
277
|
|
|
*/ |
|
278
|
|
|
public function createPaydirektPaymentHandler() |
|
279
|
|
|
{ |
|
280
|
|
|
return new ComputopPaydirektPaymentHandler($this->createInitPaydirektConverter(), $this->getComputopClient()); |
|
281
|
|
|
} |
|
282
|
|
|
|
|
283
|
|
|
/** |
|
284
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
285
|
|
|
*/ |
|
286
|
|
|
public function createSofortPaymentHandler() |
|
287
|
|
|
{ |
|
288
|
|
|
return new ComputopSofortPaymentHandler($this->createInitSofortConverter(), $this->getComputopClient()); |
|
289
|
|
|
} |
|
290
|
|
|
|
|
291
|
|
|
/** |
|
292
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
|
293
|
|
|
*/ |
|
294
|
|
|
public function createIdealPaymentHandler() |
|
295
|
|
|
{ |
|
296
|
|
|
return new ComputopIdealPaymentHandler($this->createInitIdealConverter(), $this->getComputopClient()); |
|
297
|
|
|
} |
|
298
|
|
|
|
|
299
|
|
|
/** |
|
300
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
301
|
|
|
*/ |
|
302
|
|
|
protected function createInitCreditCardConverter() |
|
303
|
|
|
{ |
|
304
|
|
|
return new InitCreditCardConverter($this->getComputopApiService(), $this->getConfig()); |
|
305
|
|
|
} |
|
306
|
|
|
|
|
307
|
|
|
/** |
|
308
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
309
|
|
|
*/ |
|
310
|
|
|
protected function createInitPayNowConverter() |
|
311
|
|
|
{ |
|
312
|
|
|
return new InitPayNowConverter($this->getComputopApiService(), $this->getConfig()); |
|
313
|
|
|
} |
|
314
|
|
|
|
|
315
|
|
|
/** |
|
316
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
317
|
|
|
*/ |
|
318
|
|
|
protected function createInitPayPalConverter() |
|
319
|
|
|
{ |
|
320
|
|
|
return new InitPayPalConverter($this->getComputopApiService(), $this->getConfig()); |
|
321
|
|
|
} |
|
322
|
|
|
|
|
323
|
|
|
/** |
|
324
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
325
|
|
|
*/ |
|
326
|
|
|
protected function createInitDirectDebitConverter() |
|
327
|
|
|
{ |
|
328
|
|
|
return new InitDirectDebitConverter($this->getComputopApiService(), $this->getConfig()); |
|
329
|
|
|
} |
|
330
|
|
|
|
|
331
|
|
|
/** |
|
332
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
333
|
|
|
*/ |
|
334
|
|
|
protected function createInitEasyCreditConverter() |
|
335
|
|
|
{ |
|
336
|
|
|
return new InitEasyCreditConverter($this->getComputopApiService(), $this->getConfig()); |
|
337
|
|
|
} |
|
338
|
|
|
|
|
339
|
|
|
/** |
|
340
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
341
|
|
|
*/ |
|
342
|
|
|
protected function createInitPaydirektConverter() |
|
343
|
|
|
{ |
|
344
|
|
|
return new InitPaydirektConverter($this->getComputopApiService(), $this->getConfig()); |
|
345
|
|
|
} |
|
346
|
|
|
|
|
347
|
|
|
/** |
|
348
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
349
|
|
|
*/ |
|
350
|
|
|
protected function createInitSofortConverter() |
|
351
|
|
|
{ |
|
352
|
|
|
return new InitSofortConverter($this->getComputopApiService(), $this->getConfig()); |
|
353
|
|
|
} |
|
354
|
|
|
|
|
355
|
|
|
/** |
|
356
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
|
357
|
|
|
*/ |
|
358
|
|
|
protected function createInitIdealConverter() |
|
359
|
|
|
{ |
|
360
|
|
|
return new InitIdealConverter($this->getComputopApiService(), $this->getConfig()); |
|
361
|
|
|
} |
|
362
|
|
|
|
|
363
|
|
|
/** |
|
364
|
|
|
* @return \SprykerEco\Client\Computop\ComputopClientInterface |
|
365
|
|
|
*/ |
|
366
|
|
|
protected function getComputopClient() |
|
367
|
|
|
{ |
|
368
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP); |
|
369
|
|
|
} |
|
370
|
|
|
|
|
371
|
|
|
/** |
|
372
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface |
|
373
|
|
|
*/ |
|
374
|
|
|
protected function getStore() |
|
375
|
|
|
{ |
|
376
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::STORE); |
|
377
|
|
|
} |
|
378
|
|
|
|
|
379
|
|
|
/** |
|
380
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface |
|
381
|
|
|
*/ |
|
382
|
|
|
protected function getCalculationClient() |
|
383
|
|
|
{ |
|
384
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CALCULATION); |
|
385
|
|
|
} |
|
386
|
|
|
|
|
387
|
|
|
/** |
|
388
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
389
|
|
|
*/ |
|
390
|
|
|
protected function createOrderCreditCardMapper() |
|
391
|
|
|
{ |
|
392
|
|
|
return new CreditCardMapper( |
|
393
|
|
|
$this->getComputopApiService(), |
|
394
|
|
|
$this->getRouter(), |
|
395
|
|
|
$this->getStore(), |
|
396
|
|
|
$this->getConfig(), |
|
397
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
398
|
|
|
$this->getUtilEncodingService(), |
|
399
|
|
|
$this->getCountryClient() |
|
400
|
|
|
); |
|
401
|
|
|
} |
|
402
|
|
|
|
|
403
|
|
|
/** |
|
404
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
405
|
|
|
*/ |
|
406
|
|
|
protected function createOrderPayNowMapper() |
|
407
|
|
|
{ |
|
408
|
|
|
return new PayNowMapper( |
|
409
|
|
|
$this->getComputopApiService(), |
|
410
|
|
|
$this->getRouter(), |
|
411
|
|
|
$this->getStore(), |
|
412
|
|
|
$this->getConfig(), |
|
413
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
414
|
|
|
$this->getUtilEncodingService(), |
|
415
|
|
|
$this->getCountryClient() |
|
416
|
|
|
); |
|
417
|
|
|
} |
|
418
|
|
|
|
|
419
|
|
|
/** |
|
420
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
421
|
|
|
*/ |
|
422
|
|
|
protected function createOrderPayPalMapper() |
|
423
|
|
|
{ |
|
424
|
|
|
return new PayPalMapper( |
|
425
|
|
|
$this->getComputopApiService(), |
|
426
|
|
|
$this->getRouter(), |
|
427
|
|
|
$this->getStore(), |
|
428
|
|
|
$this->getConfig(), |
|
429
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
430
|
|
|
$this->getUtilEncodingService(), |
|
431
|
|
|
$this->getCountryClient() |
|
432
|
|
|
); |
|
433
|
|
|
} |
|
434
|
|
|
|
|
435
|
|
|
/** |
|
436
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
437
|
|
|
*/ |
|
438
|
|
|
protected function createOrderDirectDebitMapper() |
|
439
|
|
|
{ |
|
440
|
|
|
return new DirectDebitMapper( |
|
441
|
|
|
$this->getComputopApiService(), |
|
442
|
|
|
$this->getRouter(), |
|
443
|
|
|
$this->getStore(), |
|
444
|
|
|
$this->getConfig(), |
|
445
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
446
|
|
|
$this->getUtilEncodingService(), |
|
447
|
|
|
$this->getCountryClient() |
|
448
|
|
|
); |
|
449
|
|
|
} |
|
450
|
|
|
|
|
451
|
|
|
/** |
|
452
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
453
|
|
|
*/ |
|
454
|
|
|
protected function createOrderSofortMapper() |
|
455
|
|
|
{ |
|
456
|
|
|
return new SofortMapper( |
|
457
|
|
|
$this->getComputopApiService(), |
|
458
|
|
|
$this->getRouter(), |
|
459
|
|
|
$this->getStore(), |
|
460
|
|
|
$this->getConfig(), |
|
461
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
462
|
|
|
$this->getUtilEncodingService(), |
|
463
|
|
|
$this->getCountryClient() |
|
464
|
|
|
); |
|
465
|
|
|
} |
|
466
|
|
|
|
|
467
|
|
|
/** |
|
468
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
469
|
|
|
*/ |
|
470
|
|
|
protected function createOrderPaydirektMapper() |
|
471
|
|
|
{ |
|
472
|
|
|
return new PaydirektMapper( |
|
473
|
|
|
$this->getComputopApiService(), |
|
474
|
|
|
$this->getRouter(), |
|
475
|
|
|
$this->getStore(), |
|
476
|
|
|
$this->getConfig(), |
|
477
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
478
|
|
|
$this->getUtilEncodingService(), |
|
479
|
|
|
$this->getCountryClient() |
|
480
|
|
|
); |
|
481
|
|
|
} |
|
482
|
|
|
|
|
483
|
|
|
/** |
|
484
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
485
|
|
|
*/ |
|
486
|
|
|
protected function createOrderIdealMapper() |
|
487
|
|
|
{ |
|
488
|
|
|
return new IdealMapper( |
|
489
|
|
|
$this->getComputopApiService(), |
|
490
|
|
|
$this->getRouter(), |
|
491
|
|
|
$this->getStore(), |
|
492
|
|
|
$this->getConfig(), |
|
493
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
494
|
|
|
$this->getUtilEncodingService(), |
|
495
|
|
|
$this->getCountryClient() |
|
496
|
|
|
); |
|
497
|
|
|
} |
|
498
|
|
|
|
|
499
|
|
|
/** |
|
500
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
|
501
|
|
|
*/ |
|
502
|
|
|
protected function createOrderEasyCreditMapper() |
|
503
|
|
|
{ |
|
504
|
|
|
return new EasyCreditMapper( |
|
505
|
|
|
$this->getComputopApiService(), |
|
506
|
|
|
$this->getRouter(), |
|
507
|
|
|
$this->getStore(), |
|
508
|
|
|
$this->getConfig(), |
|
509
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
|
|
510
|
|
|
$this->getUtilEncodingService(), |
|
511
|
|
|
$this->getCountryClient() |
|
512
|
|
|
); |
|
513
|
|
|
} |
|
514
|
|
|
|
|
515
|
|
|
/** |
|
516
|
|
|
* @return \Spryker\Yves\Router\Router\RouterInterface |
|
517
|
|
|
*/ |
|
518
|
|
|
public function getRouter(): RouterInterface |
|
519
|
|
|
{ |
|
520
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_ROUTER); |
|
521
|
|
|
} |
|
522
|
|
|
|
|
523
|
|
|
/** |
|
524
|
|
|
* @return \Symfony\Component\HttpFoundation\RequestStack |
|
525
|
|
|
*/ |
|
526
|
|
|
public function getRequestStack(): RequestStack |
|
527
|
|
|
{ |
|
528
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_REQUEST_STACK); |
|
529
|
|
|
} |
|
530
|
|
|
|
|
531
|
|
|
/** |
|
532
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface |
|
533
|
|
|
*/ |
|
534
|
|
|
public function getUtilEncodingService(): ComputopToUtilEncodingServiceInterface |
|
535
|
|
|
{ |
|
536
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_UTIL_ENCODING); |
|
537
|
|
|
} |
|
538
|
|
|
|
|
539
|
|
|
/** |
|
540
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface |
|
541
|
|
|
*/ |
|
542
|
|
|
public function getCountryClient(): ComputopToCountryClientInterface |
|
543
|
|
|
{ |
|
544
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COUNTRY); |
|
545
|
|
|
} |
|
546
|
|
|
} |
|
547
|
|
|
|