|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* MIT License |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Yves\AfterPay; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Yves\Kernel\AbstractFactory; |
|
11
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface; |
|
12
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface; |
|
13
|
|
|
use SprykerEco\Yves\AfterPay\Expander\AfterPayPaymentExpander; |
|
14
|
|
|
use SprykerEco\Yves\AfterPay\Expander\AfterPayPaymentExpanderInterface; |
|
15
|
|
|
use SprykerEco\Yves\AfterPay\Form\DataProvider\InvoiceDataProvider; |
|
16
|
|
|
use SprykerEco\Yves\AfterPay\Form\InvoiceSubForm; |
|
17
|
|
|
use SprykerEco\Yves\AfterPay\Handler\AfterPayAvailablePaymentMethodsPluginHandler; |
|
18
|
|
|
use SprykerEco\Yves\AfterPay\Handler\AfterPayAvailablePaymentMethodsPluginHandlerInterface; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @method \SprykerEco\Yves\AfterPay\AfterPayConfig getConfig() |
|
22
|
|
|
* @method \SprykerEco\Client\AfterPay\AfterPayClientInterface getClient() |
|
23
|
|
|
*/ |
|
24
|
|
|
class AfterPayFactory extends AbstractFactory |
|
25
|
|
|
{ |
|
26
|
|
|
/** |
|
27
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
|
28
|
|
|
*/ |
|
29
|
|
|
public function createInvoiceForm(): SubFormInterface |
|
30
|
|
|
{ |
|
31
|
|
|
return new InvoiceSubForm(); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
|
36
|
|
|
*/ |
|
37
|
|
|
public function createInvoiceFormDataProvider(): StepEngineFormDataProviderInterface |
|
38
|
|
|
{ |
|
39
|
|
|
return new InvoiceDataProvider(); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @return \SprykerEco\Yves\AfterPay\Expander\AfterPayPaymentExpanderInterface |
|
44
|
|
|
*/ |
|
45
|
|
|
public function createPaymentExpander(): AfterPayPaymentExpanderInterface |
|
46
|
|
|
{ |
|
47
|
|
|
return new AfterPayPaymentExpander(); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @return \SprykerEco\Yves\AfterPay\Handler\AfterPayAvailablePaymentMethodsPluginHandlerInterface |
|
52
|
|
|
*/ |
|
53
|
|
|
public function createAfterPayAvailablePaymentMethodsPluginHandler(): AfterPayAvailablePaymentMethodsPluginHandlerInterface |
|
54
|
|
|
{ |
|
55
|
|
|
return new AfterPayAvailablePaymentMethodsPluginHandler( |
|
56
|
|
|
$this->getClient() |
|
57
|
|
|
); |
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
|