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\Computop\Plugin\Router; |
9
|
|
|
|
10
|
|
|
use Spryker\Yves\Router\Plugin\RouteProvider\AbstractRouteProviderPlugin; |
11
|
|
|
use Spryker\Yves\Router\Route\RouteCollection; |
12
|
|
|
|
13
|
|
|
class ComputopRouteProviderPlugin extends AbstractRouteProviderPlugin |
14
|
|
|
{ |
15
|
|
|
public const CREDIT_CARD_SUCCESS = 'computop-credit-card-success'; |
16
|
|
|
public const DIRECT_DEBIT_SUCCESS = 'computop-direct-debit-success'; |
17
|
|
|
public const EASY_CREDIT_SUCCESS = 'computop-easy-credit-success'; |
18
|
|
|
public const IDEAL_SUCCESS = 'computop-ideal-success'; |
19
|
|
|
public const PAYDIREKT_SUCCESS = 'computop-paydirekt-success'; |
20
|
|
|
public const PAY_NOW_SUCCESS = 'computop-paynow-success'; |
21
|
|
|
public const PAY_PAL_SUCCESS = 'computop-pay-pal-success'; |
22
|
|
|
public const SOFORT_SUCCESS = 'computop-sofort-success'; |
23
|
|
|
|
24
|
|
|
public const FAILURE_PATH_NAME = 'computop-failure'; |
25
|
|
|
public const NOTIFY_PATH_NAME = 'computop-notify'; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Specification: |
29
|
|
|
* - Adds Routes to the RouteCollection. |
30
|
|
|
* |
31
|
|
|
* @api |
32
|
|
|
* |
33
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
34
|
|
|
* |
35
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
36
|
|
|
*/ |
37
|
|
|
public function addRoutes(RouteCollection $routeCollection): RouteCollection |
38
|
|
|
{ |
39
|
|
|
$routeCollection = $this->addCreditCardSuccessRoute($routeCollection); |
40
|
|
|
$routeCollection = $this->addDirectDebitSuccessRoute($routeCollection); |
41
|
|
|
$routeCollection = $this->addEasyCreditSuccessRoute($routeCollection); |
42
|
|
|
$routeCollection = $this->addIdealSuccessRoute($routeCollection); |
43
|
|
|
$routeCollection = $this->addPaydirectSuccessRoute($routeCollection); |
44
|
|
|
$routeCollection = $this->addPayNowSuccessRoute($routeCollection); |
45
|
|
|
$routeCollection = $this->addPayPalSuccessRoute($routeCollection); |
46
|
|
|
$routeCollection = $this->addSofortSuccessRoute($routeCollection); |
47
|
|
|
$routeCollection = $this->addFailureRoute($routeCollection); |
48
|
|
|
$routeCollection = $this->addNotifyRoute($routeCollection); |
49
|
|
|
|
50
|
|
|
return $routeCollection; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
55
|
|
|
* |
56
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
57
|
|
|
*/ |
58
|
|
|
protected function addCreditCardSuccessRoute(RouteCollection $routeCollection): RouteCollection |
59
|
|
|
{ |
60
|
|
|
$route = $this->buildRoute( |
61
|
|
|
'/computop/credit-card-success', |
62
|
|
|
'Computop', |
63
|
|
|
'Callback', |
64
|
|
|
'successCreditCardAction' |
65
|
|
|
); |
66
|
|
|
$routeCollection->add(static::CREDIT_CARD_SUCCESS, $route); |
67
|
|
|
|
68
|
|
|
return $routeCollection; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
73
|
|
|
* |
74
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
75
|
|
|
*/ |
76
|
|
|
protected function addDirectDebitSuccessRoute(RouteCollection $routeCollection): RouteCollection |
77
|
|
|
{ |
78
|
|
|
$route = $this->buildRoute( |
79
|
|
|
'/computop/direct-debit-success', |
80
|
|
|
'Computop', |
81
|
|
|
'Callback', |
82
|
|
|
'successDirectDebitAction' |
83
|
|
|
); |
84
|
|
|
$routeCollection->add(static::DIRECT_DEBIT_SUCCESS, $route); |
85
|
|
|
|
86
|
|
|
return $routeCollection; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
91
|
|
|
* |
92
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
93
|
|
|
*/ |
94
|
|
|
protected function addEasyCreditSuccessRoute(RouteCollection $routeCollection): RouteCollection |
95
|
|
|
{ |
96
|
|
|
$route = $this->buildRoute( |
97
|
|
|
'/computop/easy-credit-success', |
98
|
|
|
'Computop', |
99
|
|
|
'Callback', |
100
|
|
|
'successEasyCreditAction' |
101
|
|
|
); |
102
|
|
|
$routeCollection->add(static::EASY_CREDIT_SUCCESS, $route); |
103
|
|
|
|
104
|
|
|
return $routeCollection; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
109
|
|
|
* |
110
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
111
|
|
|
*/ |
112
|
|
|
protected function addIdealSuccessRoute(RouteCollection $routeCollection): RouteCollection |
113
|
|
|
{ |
114
|
|
|
$route = $this->buildRoute( |
115
|
|
|
'/computop/ideal-success', |
116
|
|
|
'Computop', |
117
|
|
|
'Callback', |
118
|
|
|
'successIdealAction' |
119
|
|
|
); |
120
|
|
|
$routeCollection->add(static::IDEAL_SUCCESS, $route); |
121
|
|
|
|
122
|
|
|
return $routeCollection; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
127
|
|
|
* |
128
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
129
|
|
|
*/ |
130
|
|
|
protected function addPaydirectSuccessRoute(RouteCollection $routeCollection): RouteCollection |
131
|
|
|
{ |
132
|
|
|
$route = $this->buildRoute( |
133
|
|
|
'/computop/paydirekt-success', |
134
|
|
|
'Computop', |
135
|
|
|
'Callback', |
136
|
|
|
'successPaydirektAction' |
137
|
|
|
); |
138
|
|
|
$routeCollection->add(static::PAYDIREKT_SUCCESS, $route); |
139
|
|
|
|
140
|
|
|
return $routeCollection; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
145
|
|
|
* |
146
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
147
|
|
|
*/ |
148
|
|
|
protected function addPayNowSuccessRoute(RouteCollection $routeCollection): RouteCollection |
149
|
|
|
{ |
150
|
|
|
$route = $this->buildRoute( |
151
|
|
|
'/computop/paynow-success', |
152
|
|
|
'Computop', |
153
|
|
|
'Callback', |
154
|
|
|
'successPayNowAction' |
155
|
|
|
); |
156
|
|
|
$routeCollection->add(static::PAY_NOW_SUCCESS, $route); |
157
|
|
|
|
158
|
|
|
return $routeCollection; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
163
|
|
|
* |
164
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
165
|
|
|
*/ |
166
|
|
|
protected function addPayPalSuccessRoute(RouteCollection $routeCollection): RouteCollection |
167
|
|
|
{ |
168
|
|
|
$route = $this->buildRoute( |
169
|
|
|
'/computop/pay-pal-success', |
170
|
|
|
'Computop', |
171
|
|
|
'Callback', |
172
|
|
|
'successPayPalAction' |
173
|
|
|
); |
174
|
|
|
$routeCollection->add(static::PAY_PAL_SUCCESS, $route); |
175
|
|
|
|
176
|
|
|
return $routeCollection; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
181
|
|
|
* |
182
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
183
|
|
|
*/ |
184
|
|
|
protected function addSofortSuccessRoute(RouteCollection $routeCollection): RouteCollection |
185
|
|
|
{ |
186
|
|
|
$route = $this->buildRoute( |
187
|
|
|
'/computop/sofort-success', |
188
|
|
|
'Computop', |
189
|
|
|
'Callback', |
190
|
|
|
'successSofortAction' |
191
|
|
|
); |
192
|
|
|
$routeCollection->add(static::SOFORT_SUCCESS, $route); |
193
|
|
|
|
194
|
|
|
return $routeCollection; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
199
|
|
|
* |
200
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
201
|
|
|
*/ |
202
|
|
|
protected function addFailureRoute(RouteCollection $routeCollection): RouteCollection |
203
|
|
|
{ |
204
|
|
|
$route = $this->buildRoute( |
205
|
|
|
'/computop/failure', |
206
|
|
|
'Computop', |
207
|
|
|
'Callback', |
208
|
|
|
'failureAction' |
209
|
|
|
); |
210
|
|
|
$routeCollection->add(static::FAILURE_PATH_NAME, $route); |
211
|
|
|
|
212
|
|
|
return $routeCollection; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection |
217
|
|
|
* |
218
|
|
|
* @return \Spryker\Yves\Router\Route\RouteCollection |
219
|
|
|
*/ |
220
|
|
|
protected function addNotifyRoute(RouteCollection $routeCollection): RouteCollection |
221
|
|
|
{ |
222
|
|
|
$route = $this->buildRoute( |
223
|
|
|
'/computop/notify', |
224
|
|
|
'Computop', |
225
|
|
|
'Callback', |
226
|
|
|
'notifyAction' |
227
|
|
|
); |
228
|
|
|
$routeCollection->add(static::NOTIFY_PATH_NAME, $route); |
229
|
|
|
|
230
|
|
|
return $routeCollection; |
231
|
|
|
} |
232
|
|
|
} |
233
|
|
|
|