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\Zed\Ratepay\Business\Order; |
9
|
|
|
|
10
|
|
|
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory; |
11
|
|
|
use SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\Elv as ElvMapper; |
12
|
|
|
use SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\Installment as InstallmentMapper; |
13
|
|
|
use SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\Invoice as InvoiceMapper; |
14
|
|
|
use SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\Prepayment as PrepaymentMapper; |
15
|
|
|
use SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\Transaction\Transaction; |
16
|
|
|
|
17
|
|
|
class MethodMapperFactory extends AbstractBusinessFactory implements MethodMapperFactoryInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @return \SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\Transaction\TransactionInterface |
21
|
|
|
*/ |
22
|
|
|
public function createPaymentTransactionHandler() |
23
|
|
|
{ |
24
|
|
|
$paymentTransactionHandler = new Transaction(); |
25
|
|
|
$paymentTransactionHandler->registerMethodMapper($this->createElvMethodMapper()); |
26
|
|
|
$paymentTransactionHandler->registerMethodMapper($this->createInstallmentMethodMapper()); |
27
|
|
|
$paymentTransactionHandler->registerMethodMapper($this->createInvoiceMethodMapper()); |
28
|
|
|
$paymentTransactionHandler->registerMethodMapper($this->createPrepaymentMethodMapper()); |
29
|
|
|
|
30
|
|
|
return $paymentTransactionHandler; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @return \SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\PaymentMethodMapperInterface |
35
|
|
|
*/ |
36
|
|
|
protected function createElvMethodMapper() |
37
|
|
|
{ |
38
|
|
|
return new ElvMapper(); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @return \SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\PaymentMethodMapperInterface |
43
|
|
|
*/ |
44
|
|
|
protected function createInvoiceMethodMapper() |
45
|
|
|
{ |
46
|
|
|
return new InvoiceMapper(); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @return \SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\PaymentMethodMapperInterface |
51
|
|
|
*/ |
52
|
|
|
protected function createPrepaymentMethodMapper() |
53
|
|
|
{ |
54
|
|
|
return new PrepaymentMapper(); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @return \SprykerEco\Zed\Ratepay\Business\Order\MethodMapper\PaymentMethodMapperInterface |
59
|
|
|
*/ |
60
|
|
|
protected function createInstallmentMethodMapper() |
61
|
|
|
{ |
62
|
|
|
return new InstallmentMapper(); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|