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