|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Apache OSL-2 |
|
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\AmazonPay\Communication; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Zed\Kernel\Communication\AbstractCommunicationFactory; |
|
11
|
|
|
use SprykerEco\Zed\AmazonPay\AmazonPayDependencyProvider; |
|
12
|
|
|
use SprykerEco\Zed\AmazonPay\Business\Converter\AmazonPayEntityToTransferConverter; |
|
13
|
|
|
use SprykerEco\Zed\AmazonPay\Business\Payment\RequestAmountCalculator; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @method \SprykerEco\Shared\AmazonPay\AmazonPayConfig getConfig() |
|
17
|
|
|
* @method \SprykerEco\Zed\AmazonPay\Persistence\AmazonPayQueryContainerInterface getQueryContainer() |
|
18
|
|
|
* @method \SprykerEco\Zed\AmazonPay\Business\AmazonPayFacadeInterface getFacade() |
|
19
|
|
|
*/ |
|
20
|
|
|
class AmazonPayCommunicationFactory extends AbstractCommunicationFactory |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* @return \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToSalesInterface |
|
24
|
|
|
*/ |
|
25
|
|
|
public function getSalesFacade() |
|
26
|
|
|
{ |
|
27
|
|
|
return $this->getProvidedDependency(AmazonPayDependencyProvider::FACADE_SALES); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @return \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToOmsInterface |
|
32
|
|
|
*/ |
|
33
|
|
|
public function getOmsFacade() |
|
34
|
|
|
{ |
|
35
|
|
|
return $this->getProvidedDependency(AmazonPayDependencyProvider::FACADE_OMS); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @return \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToRefundInterface |
|
40
|
|
|
*/ |
|
41
|
|
|
public function getRefundFacade() |
|
42
|
|
|
{ |
|
43
|
|
|
return $this->getProvidedDependency(AmazonPayDependencyProvider::FACADE_REFUND); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @return \SprykerEco\Zed\AmazonPay\Business\Payment\RequestAmountCalculatorInterface |
|
48
|
|
|
*/ |
|
49
|
|
|
public function createRequestAmountCalculator() |
|
50
|
|
|
{ |
|
51
|
|
|
return new RequestAmountCalculator($this->getOmsFacade()); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* @return \SprykerEco\Zed\AmazonPay\Business\Converter\AmazonPayEntityToTransferConverterInterface |
|
56
|
|
|
*/ |
|
57
|
|
|
public function createPaymentAmazonpayConverter() |
|
58
|
|
|
{ |
|
59
|
|
|
return new AmazonPayEntityToTransferConverter(); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|