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\Yves\AmazonPay; |
9
|
|
|
|
10
|
|
|
use Spryker\Yves\Kernel\AbstractBundleDependencyProvider; |
11
|
|
|
use Spryker\Yves\Kernel\Container; |
12
|
|
|
use SprykerEco\Yves\AmazonPay\Dependency\Client\AmazonPayToCalculationBridge; |
13
|
|
|
use SprykerEco\Yves\AmazonPay\Dependency\Client\AmazonPayToCartBridge; |
14
|
|
|
use SprykerEco\Yves\AmazonPay\Dependency\Client\AmazonPayToCheckoutBridge; |
15
|
|
|
use SprykerEco\Yves\AmazonPay\Dependency\Client\AmazonPayToCustomerBridge; |
16
|
|
|
use SprykerEco\Yves\AmazonPay\Dependency\Client\AmazonPayToGlossaryStorageBridge; |
17
|
|
|
use SprykerEco\Yves\AmazonPay\Dependency\Client\AmazonPayToQuoteBridge; |
18
|
|
|
use SprykerEco\Yves\AmazonPay\Dependency\Client\AmazonPayToShipmentBridge; |
19
|
|
|
|
20
|
|
|
class AmazonPayDependencyProvider extends AbstractBundleDependencyProvider |
21
|
|
|
{ |
22
|
|
|
public const CLIENT_QUOTE = 'quote client'; |
23
|
|
|
public const CLIENT_CART = 'cart client'; |
24
|
|
|
public const CLIENT_SHIPMENT = 'shipment client'; |
25
|
|
|
public const CLIENT_CHECKOUT = 'checkout client'; |
26
|
|
|
public const CLIENT_CUSTOMER = 'customer client'; |
27
|
|
|
public const CLIENT_CALCULATION = 'calculation client'; |
28
|
|
|
public const CLIENT_GLOSSARY_STORAGE = 'glossary storage client'; |
29
|
|
|
public const PLUGIN_CHECKOUT_BREADCRUMB = 'plugin checkout breadcrumb'; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
33
|
|
|
* |
34
|
|
|
* @return \Spryker\Yves\Kernel\Container |
35
|
|
|
*/ |
36
|
|
|
public function provideDependencies(Container $container) |
37
|
|
|
{ |
38
|
|
|
$this->addQuoteClient($container); |
39
|
|
|
$this->addCartClient($container); |
40
|
|
|
$this->addShipmentClient($container); |
41
|
|
|
$this->addCheckoutClient($container); |
42
|
|
|
$this->addCalculationClient($container); |
43
|
|
|
$this->addCustomerClient($container); |
44
|
|
|
$this->addGlossaryStorageClient($container); |
45
|
|
|
|
46
|
|
|
return $container; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
51
|
|
|
* |
52
|
|
|
* @return void |
53
|
|
|
*/ |
54
|
|
|
protected function addQuoteClient(Container $container) |
55
|
|
|
{ |
56
|
|
|
$container[static::CLIENT_QUOTE] = function () use ($container) { |
57
|
|
|
return new AmazonPayToQuoteBridge($container->getLocator()->quote()->client()); |
58
|
|
|
}; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
63
|
|
|
* |
64
|
|
|
* @return void |
65
|
|
|
*/ |
66
|
|
|
protected function addCartClient(Container $container) |
67
|
|
|
{ |
68
|
|
|
$container[static::CLIENT_CART] = function () use ($container) { |
69
|
|
|
return new AmazonPayToCartBridge($container->getLocator()->cart()->client()); |
70
|
|
|
}; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
75
|
|
|
* |
76
|
|
|
* @return void |
77
|
|
|
*/ |
78
|
|
|
protected function addShipmentClient(Container $container) |
79
|
|
|
{ |
80
|
|
|
$container[static::CLIENT_SHIPMENT] = function () use ($container) { |
81
|
|
|
return new AmazonPayToShipmentBridge($container->getLocator()->shipment()->client()); |
82
|
|
|
}; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
87
|
|
|
* |
88
|
|
|
* @return void |
89
|
|
|
*/ |
90
|
|
|
protected function addCheckoutClient(Container $container) |
91
|
|
|
{ |
92
|
|
|
$container[static::CLIENT_CHECKOUT] = function () use ($container) { |
93
|
|
|
return new AmazonPayToCheckoutBridge($container->getLocator()->checkout()->client()); |
94
|
|
|
}; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
99
|
|
|
* |
100
|
|
|
* @return void |
101
|
|
|
*/ |
102
|
|
|
protected function addCalculationClient(Container $container) |
103
|
|
|
{ |
104
|
|
|
$container[static::CLIENT_CALCULATION] = function () use ($container) { |
105
|
|
|
return new AmazonPayToCalculationBridge($container->getLocator()->calculation()->client()); |
106
|
|
|
}; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
111
|
|
|
* |
112
|
|
|
* @return void |
113
|
|
|
*/ |
114
|
|
|
protected function addCustomerClient(Container $container) |
115
|
|
|
{ |
116
|
|
|
$container[static::CLIENT_CUSTOMER] = function () use ($container) { |
117
|
|
|
return new AmazonPayToCustomerBridge($container->getLocator()->customer()->client()); |
118
|
|
|
}; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @param \Spryker\Yves\Kernel\Container $container |
123
|
|
|
* |
124
|
|
|
* @return void |
125
|
|
|
*/ |
126
|
|
|
protected function addGlossaryStorageClient(Container $container) |
127
|
|
|
{ |
128
|
|
|
$container[static::CLIENT_GLOSSARY_STORAGE] = function () use ($container) { |
129
|
|
|
return new AmazonPayToGlossaryStorageBridge($container->getLocator()->glossaryStorage()->client()); |
130
|
|
|
}; |
131
|
|
|
} |
132
|
|
|
} |
133
|
|
|
|