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 Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface; |
13
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface; |
14
|
|
|
use SprykerEco\Client\Computop\ComputopClientInterface; |
15
|
|
|
use SprykerEco\Service\ComputopApi\ComputopApiServiceInterface; |
16
|
|
|
use SprykerEco\Yves\Computop\Converter\ConverterInterface; |
17
|
|
|
use SprykerEco\Yves\Computop\Converter\InitCreditCardConverter; |
18
|
|
|
use SprykerEco\Yves\Computop\Converter\InitDirectDebitConverter; |
19
|
|
|
use SprykerEco\Yves\Computop\Converter\InitEasyCreditConverter; |
20
|
|
|
use SprykerEco\Yves\Computop\Converter\InitIdealConverter; |
21
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPaydirektConverter; |
22
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPayNowConverter; |
23
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPayPalConverter; |
24
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPayPalExpressConverter; |
25
|
|
|
use SprykerEco\Yves\Computop\Converter\InitPayuCeeSingleConverter; |
26
|
|
|
use SprykerEco\Yves\Computop\Converter\InitSofortConverter; |
27
|
|
|
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface; |
28
|
|
|
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface; |
29
|
|
|
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface; |
30
|
|
|
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface; |
31
|
|
|
use SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface; |
32
|
|
|
use SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface; |
33
|
|
|
use SprykerEco\Yves\Computop\Form\CreditCardSubForm; |
34
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\CreditCardFormDataProvider; |
35
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\DirectDebitFormDataProvider; |
36
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\EasyCreditFormDataProvider; |
37
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\IdealFormDataProvider; |
38
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PaydirektFormDataProvider; |
39
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PayNowFormDataProvider; |
40
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PayPalExpressFormDataProvider; |
41
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PayPalFormDataProvider; |
42
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\PayuCeeSingleFormDataProvider; |
43
|
|
|
use SprykerEco\Yves\Computop\Form\DataProvider\SofortFormDataProvider; |
44
|
|
|
use SprykerEco\Yves\Computop\Form\DirectDebitSubForm; |
45
|
|
|
use SprykerEco\Yves\Computop\Form\EasyCreditSubForm; |
46
|
|
|
use SprykerEco\Yves\Computop\Form\IdealSubForm; |
47
|
|
|
use SprykerEco\Yves\Computop\Form\PaydirektSubForm; |
48
|
|
|
use SprykerEco\Yves\Computop\Form\PayNowSubForm; |
49
|
|
|
use SprykerEco\Yves\Computop\Form\PayPalSubForm; |
50
|
|
|
use SprykerEco\Yves\Computop\Form\PayuCeeSingleSubForm; |
51
|
|
|
use SprykerEco\Yves\Computop\Form\SofortSubForm; |
52
|
|
|
use SprykerEco\Yves\Computop\Handler\ComputopPaymentHandler; |
53
|
|
|
use SprykerEco\Yves\Computop\Handler\ComputopPaymentHandlerInterface; |
54
|
|
|
use SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface; |
55
|
|
|
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregator; |
56
|
|
|
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregatorInterface; |
57
|
|
|
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregator; |
58
|
|
|
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregatorInterface; |
59
|
|
|
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregator; |
60
|
|
|
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregatorInterface; |
61
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopCreditCardPaymentHandler; |
62
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopDirectDebitPaymentHandler; |
63
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopEasyCreditPaymentHandler; |
64
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopIdealPaymentHandler; |
65
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPaydirektPaymentHandler; |
66
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayNowPaymentHandler; |
67
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayPalPaymentHandler; |
68
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayuCeeSinglePaymentHandler; |
69
|
|
|
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopSofortPaymentHandler; |
70
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\MapperInterface; |
71
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\CreditCardMapper; |
72
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\DirectDebitMapper; |
73
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\EasyCreditMapper; |
74
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\IdealMapper; |
75
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PaydirektMapper; |
76
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayNowMapper; |
77
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayPalExpressMapper; |
78
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayPalMapper; |
79
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayuCeeSingleMapper; |
80
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\SofortMapper; |
81
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapper; |
82
|
|
|
use SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapperInterface; |
83
|
|
|
use Symfony\Component\HttpFoundation\RequestStack; |
84
|
|
|
use Symfony\Component\HttpKernel\HttpKernelInterface; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @method \SprykerEco\Yves\Computop\ComputopConfig getConfig() |
88
|
|
|
* @method \SprykerEco\Client\Computop\ComputopClientInterface getClient() |
89
|
|
|
*/ |
90
|
|
|
class ComputopFactory extends AbstractFactory |
91
|
|
|
{ |
92
|
|
|
/** |
93
|
|
|
* @return \SprykerEco\Yves\Computop\ComputopConfigInterface |
94
|
|
|
*/ |
95
|
|
|
public function getComputopConfig(): ComputopConfigInterface |
96
|
|
|
{ |
97
|
|
|
return $this->getConfig(); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPaymentHandlerInterface |
102
|
|
|
*/ |
103
|
|
|
public function createComputopPaymentHandler(): ComputopPaymentHandlerInterface |
104
|
|
|
{ |
105
|
|
|
return new ComputopPaymentHandler($this->getConfig()); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
110
|
|
|
*/ |
111
|
|
|
public function createCreditCardForm(): SubFormInterface |
112
|
|
|
{ |
113
|
|
|
return new CreditCardSubForm(); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
118
|
|
|
*/ |
119
|
|
|
public function createPayNowForm(): SubFormInterface |
120
|
|
|
{ |
121
|
|
|
return new PayNowSubForm(); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
126
|
|
|
*/ |
127
|
|
|
public function createPayPalForm(): SubFormInterface |
128
|
|
|
{ |
129
|
|
|
return new PayPalSubForm(); |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
134
|
|
|
*/ |
135
|
|
|
public function createSofortForm(): SubFormInterface |
136
|
|
|
{ |
137
|
|
|
return new SofortSubForm(); |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
142
|
|
|
*/ |
143
|
|
|
public function createDirectDebitForm(): SubFormInterface |
144
|
|
|
{ |
145
|
|
|
return new DirectDebitSubForm(); |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
150
|
|
|
*/ |
151
|
|
|
public function createPaydirektForm(): SubFormInterface |
152
|
|
|
{ |
153
|
|
|
return new PaydirektSubForm(); |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
158
|
|
|
*/ |
159
|
|
|
public function createIdealForm(): SubFormInterface |
160
|
|
|
{ |
161
|
|
|
return new IdealSubForm(); |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
166
|
|
|
*/ |
167
|
|
|
public function createEasyCreditForm(): SubFormInterface |
168
|
|
|
{ |
169
|
|
|
return new EasyCreditSubForm(); |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
174
|
|
|
*/ |
175
|
|
|
public function createPayuCeeSingleSubForm(): SubFormInterface |
176
|
|
|
{ |
177
|
|
|
return new PayuCeeSingleSubForm(); |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
182
|
|
|
*/ |
183
|
|
|
public function createCreditCardFormDataProvider(): StepEngineFormDataProviderInterface |
184
|
|
|
{ |
185
|
|
|
return new CreditCardFormDataProvider($this->getQuoteClient(), $this->createOrderCreditCardMapper()); |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
190
|
|
|
*/ |
191
|
|
|
public function createPayNowFormDataProvider(): StepEngineFormDataProviderInterface |
192
|
|
|
{ |
193
|
|
|
return new PayNowFormDataProvider($this->getQuoteClient(), $this->createOrderPayNowMapper()); |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
198
|
|
|
*/ |
199
|
|
|
public function createPayPalFormDataProvider(): StepEngineFormDataProviderInterface |
200
|
|
|
{ |
201
|
|
|
return new PayPalFormDataProvider($this->getQuoteClient(), $this->createOrderPayPalMapper()); |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
206
|
|
|
*/ |
207
|
|
|
public function createPayPalExpressFormDataProvider(): StepEngineFormDataProviderInterface |
208
|
|
|
{ |
209
|
|
|
return new PayPalExpressFormDataProvider($this->getQuoteClient(), $this->createPayPalExpressMapper()); |
210
|
|
|
} |
211
|
|
|
|
212
|
|
|
/** |
213
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
214
|
|
|
*/ |
215
|
|
|
public function createSofortFormDataProvider(): StepEngineFormDataProviderInterface |
216
|
|
|
{ |
217
|
|
|
return new SofortFormDataProvider($this->getQuoteClient(), $this->createOrderSofortMapper()); |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
222
|
|
|
*/ |
223
|
|
|
public function createDirectDebitFormDataProvider(): StepEngineFormDataProviderInterface |
224
|
|
|
{ |
225
|
|
|
return new DirectDebitFormDataProvider($this->getQuoteClient(), $this->createOrderDirectDebitMapper()); |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
230
|
|
|
*/ |
231
|
|
|
public function createPaydirektFormDataProvider(): StepEngineFormDataProviderInterface |
232
|
|
|
{ |
233
|
|
|
return new PaydirektFormDataProvider($this->getQuoteClient(), $this->createOrderPaydirektMapper()); |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
238
|
|
|
*/ |
239
|
|
|
public function createIdealFormDataProvider(): StepEngineFormDataProviderInterface |
240
|
|
|
{ |
241
|
|
|
return new IdealFormDataProvider($this->getQuoteClient(), $this->createOrderIdealMapper()); |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
246
|
|
|
*/ |
247
|
|
|
public function createEasyCreditFormDataProvider(): StepEngineFormDataProviderInterface |
248
|
|
|
{ |
249
|
|
|
return new EasyCreditFormDataProvider($this->getQuoteClient(), $this->createOrderEasyCreditMapper()); |
250
|
|
|
} |
251
|
|
|
|
252
|
|
|
/** |
253
|
|
|
* @return \SprykerEco\Yves\Computop\Form\DataProvider\PayuCeeSingleFormDataProvider |
254
|
|
|
*/ |
255
|
|
|
public function createPayuCeeSingleFormDataProvider(): PayuCeeSingleFormDataProvider |
256
|
|
|
{ |
257
|
|
|
return new PayuCeeSingleFormDataProvider($this->getQuoteClient(), $this->createOrderPayuCeeSingleMapper()); |
258
|
|
|
} |
259
|
|
|
|
260
|
|
|
/** |
261
|
|
|
* @return \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface |
262
|
|
|
*/ |
263
|
|
|
public function getComputopApiService(): ComputopApiServiceInterface |
264
|
|
|
{ |
265
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_COMPUTOP_API); |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* @return \Symfony\Component\HttpKernel\HttpKernelInterface |
270
|
|
|
*/ |
271
|
|
|
public function getApplication(): HttpKernelInterface |
272
|
|
|
{ |
273
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::PLUGIN_APPLICATION); |
274
|
|
|
} |
275
|
|
|
|
276
|
|
|
/** |
277
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface |
278
|
|
|
*/ |
279
|
|
|
public function getQuoteClient(): ComputopToQuoteClientInterface |
280
|
|
|
{ |
281
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_QUOTE); |
282
|
|
|
} |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
286
|
|
|
*/ |
287
|
|
|
public function createCreditCardPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
288
|
|
|
{ |
289
|
|
|
return new ComputopCreditCardPaymentHandler($this->createInitCreditCardConverter(), $this->getComputopClient()); |
290
|
|
|
} |
291
|
|
|
|
292
|
|
|
/** |
293
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
294
|
|
|
*/ |
295
|
|
|
public function createPayNowPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
296
|
|
|
{ |
297
|
|
|
return new ComputopPayNowPaymentHandler($this->createInitPayNowConverter(), $this->getComputopClient()); |
298
|
|
|
} |
299
|
|
|
|
300
|
|
|
/** |
301
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
302
|
|
|
*/ |
303
|
|
|
public function createPayPalPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
304
|
|
|
{ |
305
|
|
|
return new ComputopPayPalPaymentHandler($this->createInitPayPalConverter(), $this->getComputopClient()); |
306
|
|
|
} |
307
|
|
|
|
308
|
|
|
/** |
309
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregatorInterface |
310
|
|
|
*/ |
311
|
|
|
public function createComputopPayPalExpressInitAggregator(): ComputopPayPalExpressInitAggregatorInterface |
312
|
|
|
{ |
313
|
|
|
return new ComputopPayPalExpressInitAggregator( |
314
|
|
|
$this->createComputopPaymentHandler(), |
315
|
|
|
$this->createInitPayPalExpressConverter(), |
316
|
|
|
$this->getQuoteClient(), |
317
|
|
|
$this->createPayPalExpressToQuoteMapper(), |
318
|
|
|
$this->getPayPalExpressInitQuoteExpanderPlugins() |
319
|
|
|
); |
320
|
|
|
} |
321
|
|
|
|
322
|
|
|
/** |
323
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregatorInterface |
324
|
|
|
*/ |
325
|
|
|
public function createComputopPayPalExpressPrepareAggregator(): ComputopPayPalExpressPrepareAggregatorInterface |
326
|
|
|
{ |
327
|
|
|
return new ComputopPayPalExpressPrepareAggregator( |
328
|
|
|
$this->getQuoteClient(), |
329
|
|
|
$this->createPayPalExpressFormDataProvider(), |
330
|
|
|
$this->getComputopApiClient() |
331
|
|
|
); |
332
|
|
|
} |
333
|
|
|
|
334
|
|
|
/** |
335
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregatorInterface |
336
|
|
|
*/ |
337
|
|
|
public function createComputopPayPalExpressCompleteAggregator(): ComputopPayPalExpressCompleteAggregatorInterface |
338
|
|
|
{ |
339
|
|
|
return new ComputopPayPalExpressCompleteAggregator( |
340
|
|
|
$this->getComputopApiClient(), |
341
|
|
|
$this->getComputopClient() |
342
|
|
|
); |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
347
|
|
|
*/ |
348
|
|
|
public function createDirectDebitPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
349
|
|
|
{ |
350
|
|
|
return new ComputopDirectDebitPaymentHandler($this->createInitDirectDebitConverter(), $this->getComputopClient()); |
351
|
|
|
} |
352
|
|
|
|
353
|
|
|
/** |
354
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
355
|
|
|
*/ |
356
|
|
|
public function createEasyCreditPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
357
|
|
|
{ |
358
|
|
|
return new ComputopEasyCreditPaymentHandler( |
359
|
|
|
$this->createInitEasyCreditConverter(), |
360
|
|
|
$this->getComputopClient(), |
361
|
|
|
$this->getCalculationClient() |
362
|
|
|
); |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
367
|
|
|
*/ |
368
|
|
|
public function createPayuCeeSinglePaymentHandler(): ComputopPrePostPaymentHandlerInterface |
369
|
|
|
{ |
370
|
|
|
return new ComputopPayuCeeSinglePaymentHandler( |
371
|
|
|
$this->createInitPayuCeeSingleConverter(), |
372
|
|
|
$this->getComputopClient() |
373
|
|
|
); |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
/** |
377
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
378
|
|
|
*/ |
379
|
|
|
public function createPaydirektPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
380
|
|
|
{ |
381
|
|
|
return new ComputopPaydirektPaymentHandler($this->createInitPaydirektConverter(), $this->getComputopClient()); |
382
|
|
|
} |
383
|
|
|
|
384
|
|
|
/** |
385
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
386
|
|
|
*/ |
387
|
|
|
public function createSofortPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
388
|
|
|
{ |
389
|
|
|
return new ComputopSofortPaymentHandler($this->createInitSofortConverter(), $this->getComputopClient()); |
390
|
|
|
} |
391
|
|
|
|
392
|
|
|
/** |
393
|
|
|
* @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
394
|
|
|
*/ |
395
|
|
|
public function createIdealPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
396
|
|
|
{ |
397
|
|
|
return new ComputopIdealPaymentHandler($this->createInitIdealConverter(), $this->getComputopClient()); |
398
|
|
|
} |
399
|
|
|
|
400
|
|
|
/** |
401
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
402
|
|
|
*/ |
403
|
|
|
public function createInitCreditCardConverter(): ConverterInterface |
404
|
|
|
{ |
405
|
|
|
return new InitCreditCardConverter($this->getComputopApiService(), $this->getConfig()); |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
/** |
409
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
410
|
|
|
*/ |
411
|
|
|
public function createInitPayNowConverter(): ConverterInterface |
412
|
|
|
{ |
413
|
|
|
return new InitPayNowConverter($this->getComputopApiService(), $this->getConfig()); |
414
|
|
|
} |
415
|
|
|
|
416
|
|
|
/** |
417
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
418
|
|
|
*/ |
419
|
|
|
public function createInitPayPalConverter(): ConverterInterface |
420
|
|
|
{ |
421
|
|
|
return new InitPayPalConverter($this->getComputopApiService(), $this->getConfig()); |
422
|
|
|
} |
423
|
|
|
|
424
|
|
|
/** |
425
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
426
|
|
|
*/ |
427
|
|
|
public function createInitPayPalExpressConverter(): ConverterInterface |
428
|
|
|
{ |
429
|
|
|
return new InitPayPalExpressConverter($this->getComputopApiService(), $this->getConfig()); |
430
|
|
|
} |
431
|
|
|
|
432
|
|
|
/** |
433
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
434
|
|
|
*/ |
435
|
|
|
public function createInitDirectDebitConverter(): ConverterInterface |
436
|
|
|
{ |
437
|
|
|
return new InitDirectDebitConverter($this->getComputopApiService(), $this->getConfig()); |
438
|
|
|
} |
439
|
|
|
|
440
|
|
|
/** |
441
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
442
|
|
|
*/ |
443
|
|
|
public function createInitEasyCreditConverter(): ConverterInterface |
444
|
|
|
{ |
445
|
|
|
return new InitEasyCreditConverter($this->getComputopApiService(), $this->getConfig()); |
446
|
|
|
} |
447
|
|
|
|
448
|
|
|
/** |
449
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
450
|
|
|
*/ |
451
|
|
|
public function createInitPayuCeeSingleConverter(): ConverterInterface |
452
|
|
|
{ |
453
|
|
|
return new InitPayuCeeSingleConverter($this->getComputopApiService(), $this->getConfig()); |
454
|
|
|
} |
455
|
|
|
|
456
|
|
|
/** |
457
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
458
|
|
|
*/ |
459
|
|
|
public function createInitPaydirektConverter(): ConverterInterface |
460
|
|
|
{ |
461
|
|
|
return new InitPaydirektConverter($this->getComputopApiService(), $this->getConfig()); |
462
|
|
|
} |
463
|
|
|
|
464
|
|
|
/** |
465
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
466
|
|
|
*/ |
467
|
|
|
public function createInitSofortConverter(): ConverterInterface |
468
|
|
|
{ |
469
|
|
|
return new InitSofortConverter($this->getComputopApiService(), $this->getConfig()); |
470
|
|
|
} |
471
|
|
|
|
472
|
|
|
/** |
473
|
|
|
* @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
474
|
|
|
*/ |
475
|
|
|
public function createInitIdealConverter(): ConverterInterface |
476
|
|
|
{ |
477
|
|
|
return new InitIdealConverter($this->getComputopApiService(), $this->getConfig()); |
478
|
|
|
} |
479
|
|
|
|
480
|
|
|
/** |
481
|
|
|
* @return \SprykerEco\Client\Computop\ComputopClientInterface |
482
|
|
|
*/ |
483
|
|
|
public function getComputopClient(): ComputopClientInterface |
484
|
|
|
{ |
485
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP); |
486
|
|
|
} |
487
|
|
|
|
488
|
|
|
/** |
489
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface |
490
|
|
|
*/ |
491
|
|
|
public function getStore(): ComputopToStoreInterface |
492
|
|
|
{ |
493
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::STORE); |
494
|
|
|
} |
495
|
|
|
|
496
|
|
|
/** |
497
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface |
498
|
|
|
*/ |
499
|
|
|
public function getCalculationClient(): ComputopToCalculationClientInterface |
500
|
|
|
{ |
501
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CALCULATION); |
502
|
|
|
} |
503
|
|
|
|
504
|
|
|
/** |
505
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface |
506
|
|
|
*/ |
507
|
|
|
public function getComputopApiClient(): ComputopToComputopApiClientInterface |
508
|
|
|
{ |
509
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP_API); |
510
|
|
|
} |
511
|
|
|
|
512
|
|
|
/** |
513
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
514
|
|
|
*/ |
515
|
|
|
public function createOrderCreditCardMapper(): MapperInterface |
516
|
|
|
{ |
517
|
|
|
return new CreditCardMapper( |
518
|
|
|
$this->getComputopApiService(), |
519
|
|
|
$this->getRouter(), |
520
|
|
|
$this->getStore(), |
521
|
|
|
$this->getConfig(), |
522
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
523
|
|
|
$this->getUtilEncodingService(), |
524
|
|
|
$this->getCountryClient() |
525
|
|
|
); |
526
|
|
|
} |
527
|
|
|
|
528
|
|
|
/** |
529
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
530
|
|
|
*/ |
531
|
|
|
public function createOrderPayNowMapper(): MapperInterface |
532
|
|
|
{ |
533
|
|
|
return new PayNowMapper( |
534
|
|
|
$this->getComputopApiService(), |
535
|
|
|
$this->getRouter(), |
536
|
|
|
$this->getStore(), |
537
|
|
|
$this->getConfig(), |
538
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
539
|
|
|
$this->getUtilEncodingService(), |
540
|
|
|
$this->getCountryClient() |
541
|
|
|
); |
542
|
|
|
} |
543
|
|
|
|
544
|
|
|
/** |
545
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
546
|
|
|
*/ |
547
|
|
|
public function createOrderPayPalMapper(): MapperInterface |
548
|
|
|
{ |
549
|
|
|
return new PayPalMapper( |
550
|
|
|
$this->getComputopApiService(), |
551
|
|
|
$this->getRouter(), |
552
|
|
|
$this->getStore(), |
553
|
|
|
$this->getConfig(), |
554
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
555
|
|
|
$this->getUtilEncodingService(), |
556
|
|
|
$this->getCountryClient() |
557
|
|
|
); |
558
|
|
|
} |
559
|
|
|
|
560
|
|
|
/** |
561
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
562
|
|
|
*/ |
563
|
|
|
public function createPayPalExpressMapper(): MapperInterface |
564
|
|
|
{ |
565
|
|
|
return new PayPalExpressMapper( |
566
|
|
|
$this->getComputopApiService(), |
567
|
|
|
$this->getRouter(), |
568
|
|
|
$this->getStore(), |
569
|
|
|
$this->getConfig(), |
570
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
571
|
|
|
$this->getUtilEncodingService(), |
572
|
|
|
$this->getCountryClient() |
573
|
|
|
); |
574
|
|
|
} |
575
|
|
|
|
576
|
|
|
/** |
577
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
578
|
|
|
*/ |
579
|
|
|
public function createOrderDirectDebitMapper(): MapperInterface |
580
|
|
|
{ |
581
|
|
|
return new DirectDebitMapper( |
582
|
|
|
$this->getComputopApiService(), |
583
|
|
|
$this->getRouter(), |
584
|
|
|
$this->getStore(), |
585
|
|
|
$this->getConfig(), |
586
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
587
|
|
|
$this->getUtilEncodingService(), |
588
|
|
|
$this->getCountryClient() |
589
|
|
|
); |
590
|
|
|
} |
591
|
|
|
|
592
|
|
|
/** |
593
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
594
|
|
|
*/ |
595
|
|
|
public function createOrderSofortMapper(): MapperInterface |
596
|
|
|
{ |
597
|
|
|
return new SofortMapper( |
598
|
|
|
$this->getComputopApiService(), |
599
|
|
|
$this->getRouter(), |
600
|
|
|
$this->getStore(), |
601
|
|
|
$this->getConfig(), |
602
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
603
|
|
|
$this->getUtilEncodingService(), |
604
|
|
|
$this->getCountryClient() |
605
|
|
|
); |
606
|
|
|
} |
607
|
|
|
|
608
|
|
|
/** |
609
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
610
|
|
|
*/ |
611
|
|
|
public function createOrderPaydirektMapper(): MapperInterface |
612
|
|
|
{ |
613
|
|
|
return new PaydirektMapper( |
614
|
|
|
$this->getComputopApiService(), |
615
|
|
|
$this->getRouter(), |
616
|
|
|
$this->getStore(), |
617
|
|
|
$this->getConfig(), |
618
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
619
|
|
|
$this->getUtilEncodingService(), |
620
|
|
|
$this->getCountryClient() |
621
|
|
|
); |
622
|
|
|
} |
623
|
|
|
|
624
|
|
|
/** |
625
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
626
|
|
|
*/ |
627
|
|
|
public function createOrderIdealMapper(): MapperInterface |
628
|
|
|
{ |
629
|
|
|
return new IdealMapper( |
630
|
|
|
$this->getComputopApiService(), |
631
|
|
|
$this->getRouter(), |
632
|
|
|
$this->getStore(), |
633
|
|
|
$this->getConfig(), |
634
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
635
|
|
|
$this->getUtilEncodingService(), |
636
|
|
|
$this->getCountryClient() |
637
|
|
|
); |
638
|
|
|
} |
639
|
|
|
|
640
|
|
|
/** |
641
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
642
|
|
|
*/ |
643
|
|
|
public function createOrderEasyCreditMapper(): MapperInterface |
644
|
|
|
{ |
645
|
|
|
return new EasyCreditMapper( |
646
|
|
|
$this->getComputopApiService(), |
647
|
|
|
$this->getRouter(), |
648
|
|
|
$this->getStore(), |
649
|
|
|
$this->getConfig(), |
650
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
651
|
|
|
$this->getUtilEncodingService(), |
652
|
|
|
$this->getCountryClient() |
653
|
|
|
); |
654
|
|
|
} |
655
|
|
|
|
656
|
|
|
/** |
657
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayuCeeSingleMapper |
658
|
|
|
*/ |
659
|
|
|
public function createOrderPayuCeeSingleMapper(): MapperInterface |
660
|
|
|
{ |
661
|
|
|
return new PayuCeeSingleMapper( |
662
|
|
|
$this->getComputopApiService(), |
663
|
|
|
$this->getRouter(), |
664
|
|
|
$this->getStore(), |
665
|
|
|
$this->getConfig(), |
666
|
|
|
$this->getRequestStack()->getCurrentRequest(), |
|
|
|
|
667
|
|
|
$this->getUtilEncodingService(), |
668
|
|
|
$this->getCountryClient() |
669
|
|
|
); |
670
|
|
|
} |
671
|
|
|
|
672
|
|
|
/** |
673
|
|
|
* @return \Spryker\Yves\Router\Router\RouterInterface |
674
|
|
|
*/ |
675
|
|
|
public function getRouter(): RouterInterface |
676
|
|
|
{ |
677
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_ROUTER); |
678
|
|
|
} |
679
|
|
|
|
680
|
|
|
/** |
681
|
|
|
* @return \Symfony\Component\HttpFoundation\RequestStack |
682
|
|
|
*/ |
683
|
|
|
public function getRequestStack(): RequestStack |
684
|
|
|
{ |
685
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_REQUEST_STACK); |
686
|
|
|
} |
687
|
|
|
|
688
|
|
|
/** |
689
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface |
690
|
|
|
*/ |
691
|
|
|
public function getUtilEncodingService(): ComputopToUtilEncodingServiceInterface |
692
|
|
|
{ |
693
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_UTIL_ENCODING); |
694
|
|
|
} |
695
|
|
|
|
696
|
|
|
/** |
697
|
|
|
* @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface |
698
|
|
|
*/ |
699
|
|
|
public function getCountryClient(): ComputopToCountryClientInterface |
700
|
|
|
{ |
701
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COUNTRY); |
702
|
|
|
} |
703
|
|
|
|
704
|
|
|
/** |
705
|
|
|
* @return \SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapperInterface |
706
|
|
|
*/ |
707
|
|
|
public function createPayPalExpressToQuoteMapper(): PayPalExpressToQuoteMapperInterface |
708
|
|
|
{ |
709
|
|
|
return new PayPalExpressToQuoteMapper(); |
710
|
|
|
} |
711
|
|
|
|
712
|
|
|
/** |
713
|
|
|
* @return array<\SprykerEco\Yves\ComputopExtension\Dependency\Plugin\PayPalExpressInitQuoteExpanderPluginInterface> |
714
|
|
|
*/ |
715
|
|
|
public function getPayPalExpressInitQuoteExpanderPlugins(): array |
716
|
|
|
{ |
717
|
|
|
return $this->getProvidedDependency(ComputopDependencyProvider::PLUGINS_PAYPAL_EXPRESS_INIT_QUOTE_EXPANDER); |
718
|
|
|
} |
719
|
|
|
} |
720
|
|
|
|