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\Payone; |
9
|
|
|
|
10
|
|
|
use Spryker\Yves\Kernel\AbstractFactory; |
11
|
|
|
use SprykerEco\Yves\Payone\Form\CreditCardSubForm; |
12
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\CreditCardDataProvider; |
13
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\DirectDebitDataProvider; |
14
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\EpsOnlineTransferDataProvider; |
15
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\EWalletDataProvider; |
16
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\GiropayOnlineTransferDataProvider; |
17
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\IdealOnlineTransferDataProvider; |
18
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\InstantOnlineTransferDataProvider; |
19
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\InvoiceDataProvider; |
20
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\PostfinanceCardOnlineTransferDataProvider; |
21
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\PostfinanceEfinanceOnlineTransferDataProvider; |
22
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\PrePaymentDataProvider; |
23
|
|
|
use SprykerEco\Yves\Payone\Form\DataProvider\Przelewy24OnlineTransferDataProvider; |
24
|
|
|
use SprykerEco\Yves\Payone\Form\DirectDebitSubForm; |
25
|
|
|
use SprykerEco\Yves\Payone\Form\EpsOnlineTransferSubForm; |
26
|
|
|
use SprykerEco\Yves\Payone\Form\EWalletSubForm; |
27
|
|
|
use SprykerEco\Yves\Payone\Form\GiropayOnlineTransferSubForm; |
28
|
|
|
use SprykerEco\Yves\Payone\Form\IdealOnlineTransferSubForm; |
29
|
|
|
use SprykerEco\Yves\Payone\Form\InstantOnlineTransferSubForm; |
30
|
|
|
use SprykerEco\Yves\Payone\Form\InvoiceSubForm; |
31
|
|
|
use SprykerEco\Yves\Payone\Form\PostfinanceCardOnlineTransferSubForm; |
32
|
|
|
use SprykerEco\Yves\Payone\Form\PostfinanceEfinanceOnlineTransferSubForm; |
33
|
|
|
use SprykerEco\Yves\Payone\Form\PrePaymentForm; |
34
|
|
|
use SprykerEco\Yves\Payone\Form\Przelewy24OnlineTransferSubForm; |
35
|
|
|
use SprykerEco\Yves\Payone\Handler\ExpressCheckout\QuoteHydrator; |
36
|
|
|
use SprykerEco\Yves\Payone\Handler\ExpressCheckoutHandler; |
37
|
|
|
use SprykerEco\Yves\Payone\Handler\PayoneHandler; |
38
|
|
|
use SprykerEco\Yves\Payone\Plugin\PayoneCreditCardSubFormPlugin; |
39
|
|
|
use SprykerEco\Yves\Payone\Plugin\PayonePrePaymentSubFormPlugin; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @method \SprykerEco\Yves\Payone\PayoneConfig getConfig() |
43
|
|
|
*/ |
44
|
|
|
class PayoneFactory extends AbstractFactory |
45
|
|
|
{ |
46
|
|
|
/** |
47
|
|
|
* @return \SprykerEco\Yves\Payone\Form\PrePaymentForm |
48
|
|
|
*/ |
49
|
|
|
public function createPrePaymentForm() |
50
|
|
|
{ |
51
|
|
|
return new PrePaymentForm(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\PrePaymentDataProvider |
56
|
|
|
*/ |
57
|
|
|
public function createPrePaymentFormDataProvider() |
58
|
|
|
{ |
59
|
|
|
return new PrePaymentDataProvider(); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return \SprykerEco\Yves\Payone\Form\InvoiceSubForm |
64
|
|
|
*/ |
65
|
|
|
public function createInvoiceSubForm() |
66
|
|
|
{ |
67
|
|
|
return new InvoiceSubForm(); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\InvoiceDataProvider |
72
|
|
|
*/ |
73
|
|
|
public function createInvoiceSubFormDataProvider() |
74
|
|
|
{ |
75
|
|
|
return new InvoiceDataProvider(); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return \SprykerEco\Yves\Payone\Handler\PayoneHandler |
80
|
|
|
*/ |
81
|
|
|
public function createPayoneHandler() |
82
|
|
|
{ |
83
|
|
|
return new PayoneHandler(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return \SprykerEco\Yves\Payone\Handler\ExpressCheckoutHandler |
88
|
|
|
*/ |
89
|
|
|
public function createExpressCheckoutHandler() |
90
|
|
|
{ |
91
|
|
|
return new ExpressCheckoutHandler( |
92
|
|
|
$this->getPayoneClient(), |
93
|
|
|
$this->getCartClient(), |
94
|
|
|
$this->createQuoteHydrator(), |
95
|
|
|
$this->getConfig() |
96
|
|
|
); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @return \SprykerEco\Yves\Payone\Plugin\PayonePrePaymentSubFormPlugin |
101
|
|
|
*/ |
102
|
|
|
public function createPrePaymentSubFormPlugin() |
103
|
|
|
{ |
104
|
|
|
return new PayonePrePaymentSubFormPlugin(); |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return \SprykerEco\Yves\Payone\Plugin\PayoneCreditCardSubFormPlugin |
109
|
|
|
*/ |
110
|
|
|
public function createCreditCardSubFormPlugin() |
111
|
|
|
{ |
112
|
|
|
return new PayoneCreditCardSubFormPlugin(); |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @return \SprykerEco\Yves\Payone\Form\CreditCardSubForm |
117
|
|
|
*/ |
118
|
|
|
public function createCreditCardSubForm() |
119
|
|
|
{ |
120
|
|
|
return new CreditCardSubForm(); |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\CreditCardDataProvider |
125
|
|
|
*/ |
126
|
|
|
public function createCreditCardSubFormDataProvider() |
127
|
|
|
{ |
128
|
|
|
return new CreditCardDataProvider(); |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @return \SprykerEco\Yves\Payone\Form\EWalletSubForm |
133
|
|
|
*/ |
134
|
|
|
public function createEWalletSubForm() |
135
|
|
|
{ |
136
|
|
|
return new EWalletSubForm(); |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\EWalletDataProvider |
141
|
|
|
*/ |
142
|
|
|
public function createEWalletSubFormDataProvider() |
143
|
|
|
{ |
144
|
|
|
return new EWalletDataProvider(); |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DirectDebitSubForm |
149
|
|
|
*/ |
150
|
|
|
public function createDirectDebitSubForm() |
151
|
|
|
{ |
152
|
|
|
return new DirectDebitSubForm(); |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\DirectDebitDataProvider |
157
|
|
|
*/ |
158
|
|
|
public function createDirectDebitSubFormDataProvider() |
159
|
|
|
{ |
160
|
|
|
return new DirectDebitDataProvider(); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @return \SprykerEco\Yves\Payone\Form\EpsOnlineTransferSubForm |
165
|
|
|
*/ |
166
|
|
|
public function createEpsOnlineTransferSubForm() |
167
|
|
|
{ |
168
|
|
|
return new EpsOnlineTransferSubForm(); |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\EpsOnlineTransferDataProvider |
173
|
|
|
*/ |
174
|
|
|
public function createEpsOnlineTransferSubFormDataProvider() |
175
|
|
|
{ |
176
|
|
|
return new EpsOnlineTransferDataProvider(); |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @return \SprykerEco\Yves\Payone\Form\GiropayOnlineTransferSubForm |
181
|
|
|
*/ |
182
|
|
|
public function createGiropayOnlineTransferSubForm() |
183
|
|
|
{ |
184
|
|
|
return new GiropayOnlineTransferSubForm(); |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\GiropayOnlineTransferDataProvider |
189
|
|
|
*/ |
190
|
|
|
public function createGiropayOnlineTransferSubFormDataProvider() |
191
|
|
|
{ |
192
|
|
|
return new GiropayOnlineTransferDataProvider(); |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* @return \SprykerEco\Yves\Payone\Form\InstantOnlineTransferSubForm |
197
|
|
|
*/ |
198
|
|
|
public function createInstantOnlineTransferSubForm() |
199
|
|
|
{ |
200
|
|
|
return new InstantOnlineTransferSubForm(); |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\InstantOnlineTransferDataProvider |
205
|
|
|
*/ |
206
|
|
|
public function createInstantOnlineTransferSubFormDataProvider() |
207
|
|
|
{ |
208
|
|
|
return new InstantOnlineTransferDataProvider(); |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* @return \SprykerEco\Yves\Payone\Form\IdealOnlineTransferSubForm |
213
|
|
|
*/ |
214
|
|
|
public function createIdealOnlineTransferSubForm() |
215
|
|
|
{ |
216
|
|
|
return new IdealOnlineTransferSubForm(); |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\IdealOnlineTransferDataProvider |
221
|
|
|
*/ |
222
|
|
|
public function createIdealOnlineTransferSubFormDataProvider() |
223
|
|
|
{ |
224
|
|
|
return new IdealOnlineTransferDataProvider(); |
225
|
|
|
} |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @return \SprykerEco\Yves\Payone\Form\PostfinanceEfinanceOnlineTransferSubForm |
229
|
|
|
*/ |
230
|
|
|
public function createPostfinanceEfinanceOnlineTransferSubForm() |
231
|
|
|
{ |
232
|
|
|
return new PostfinanceEfinanceOnlineTransferSubForm(); |
233
|
|
|
} |
234
|
|
|
|
235
|
|
|
/** |
236
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\PostfinanceEfinanceOnlineTransferDataProvider |
237
|
|
|
*/ |
238
|
|
|
public function createPostfinanceEfinanceOnlineTransferSubFormDataProvider() |
239
|
|
|
{ |
240
|
|
|
return new PostfinanceEfinanceOnlineTransferDataProvider(); |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @return \SprykerEco\Yves\Payone\Form\PostfinanceCardOnlineTransferSubForm |
245
|
|
|
*/ |
246
|
|
|
public function createPostfinanceCardOnlineTransferSubForm() |
247
|
|
|
{ |
248
|
|
|
return new PostfinanceCardOnlineTransferSubForm(); |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\PostfinanceCardOnlineTransferDataProvider |
253
|
|
|
*/ |
254
|
|
|
public function createPostfinanceCardOnlineTransferSubFormDataProvider() |
255
|
|
|
{ |
256
|
|
|
return new PostfinanceCardOnlineTransferDataProvider(); |
257
|
|
|
} |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* @return \SprykerEco\Yves\Payone\Form\PostfinanceCardOnlineTransferSubForm |
261
|
|
|
*/ |
262
|
|
|
public function createPrzelewy24OnlineTransferSubForm() |
263
|
|
|
{ |
264
|
|
|
return new Przelewy24OnlineTransferSubForm(); |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* @return \SprykerEco\Yves\Payone\Form\DataProvider\PostfinanceCardOnlineTransferDataProvider |
269
|
|
|
*/ |
270
|
|
|
public function createPrzelewy24OnlineTransferSubFormDataProvider() |
271
|
|
|
{ |
272
|
|
|
return new Przelewy24OnlineTransferDataProvider(); |
273
|
|
|
} |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* @return \SprykerEco\Client\Payone\PayoneClientInterface |
277
|
|
|
*/ |
278
|
|
|
public function getPayoneClient() |
279
|
|
|
{ |
280
|
|
|
return $this->getProvidedDependency(PayoneDependencyProvider::CLIENT_PAYONE); |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* @return \SprykerEco\Yves\Payone\Dependency\Client\PayoneToCartInterface |
285
|
|
|
*/ |
286
|
|
|
public function getCartClient() |
287
|
|
|
{ |
288
|
|
|
return $this->getProvidedDependency(PayoneDependencyProvider::CLIENT_CART); |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
/** |
292
|
|
|
* @return \SprykerEco\Yves\Payone\Dependency\Client\PayoneToCustomerInterface |
293
|
|
|
*/ |
294
|
|
|
public function getCustomerClient() |
295
|
|
|
{ |
296
|
|
|
return $this->getProvidedDependency(PayoneDependencyProvider::CLIENT_CUSTOMER); |
297
|
|
|
} |
298
|
|
|
|
299
|
|
|
/** |
300
|
|
|
* @return \SprykerEco\Yves\Payone\Dependency\Client\PayoneToShipmentInterface |
301
|
|
|
*/ |
302
|
|
|
public function getShipmentClient() |
303
|
|
|
{ |
304
|
|
|
return $this->getProvidedDependency(PayoneDependencyProvider::CLIENT_SHIPMENT); |
305
|
|
|
} |
306
|
|
|
|
307
|
|
|
/** |
308
|
|
|
* @return \SprykerEco\Yves\Payone\Dependency\Client\PayoneToCalculationInterface |
309
|
|
|
*/ |
310
|
|
|
public function getCalculationClient() |
311
|
|
|
{ |
312
|
|
|
return $this->getProvidedDependency(PayoneDependencyProvider::CLIENT_CALCULATION); |
313
|
|
|
} |
314
|
|
|
|
315
|
|
|
/** |
316
|
|
|
* @return \SprykerEco\Yves\Payone\Handler\ExpressCheckout\QuoteHydrator |
317
|
|
|
*/ |
318
|
|
|
public function createQuoteHydrator() |
319
|
|
|
{ |
320
|
|
|
return new QuoteHydrator( |
321
|
|
|
$this->getShipmentClient(), |
322
|
|
|
$this->getCustomerClient(), |
323
|
|
|
$this->getCalculationClient() |
324
|
|
|
); |
325
|
|
|
} |
326
|
|
|
} |
327
|
|
|
|