|
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\Payone\Plugin\Provider; |
|
9
|
|
|
|
|
10
|
|
|
use Silex\Application; |
|
11
|
|
|
use Spryker\Yves\Application\Plugin\Provider\YvesControllerProvider; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* @deprecated Use `\SprykerEco\Yves\Payone\Plugin\Router\PayoneRouteProviderPlugin` instead. |
|
15
|
|
|
*/ |
|
16
|
|
|
class PayoneControllerProvider extends YvesControllerProvider |
|
|
|
|
|
|
17
|
|
|
{ |
|
18
|
|
|
public const ROUTE_LOGIN = 'login'; |
|
19
|
|
|
public const CHECKOUT_PAYMENT = 'checkout-payment'; |
|
20
|
|
|
public const EXPRESS_CHECKOUT_BUTTON = 'payone-checkout-with-paypal-button'; |
|
21
|
|
|
public const EXPRESS_CHECKOUT_INIT = 'payone-paypal-express-checkout-init'; |
|
22
|
|
|
public const EXPRESS_CHECKOUT_FAILURE = 'payone-paypal-express-checkout-failure'; |
|
23
|
|
|
public const EXPRESS_CHECKOUT_BACK = 'payone-paypal-express-checkout-back'; |
|
24
|
|
|
public const EXPRESS_CHECKOUT_LOAD_DETAILS = 'payone-paypal-express-checkout-load-details'; |
|
25
|
|
|
|
|
26
|
|
|
public const EXPRESS_CHECKOUT_BUTTON_PATH = '/payone/checkout-with-paypal-button'; |
|
27
|
|
|
public const EXPRESS_CHECKOUT_INIT_PATH = '/payone/paypal-express-checkout-init'; |
|
28
|
|
|
public const EXPRESS_CHECKOUT_FAILURE_PATH = '/payone/expresscheckout/failure'; |
|
29
|
|
|
public const EXPRESS_CHECKOUT_BACK_PATH = '/payone/expresscheckout/back'; |
|
30
|
|
|
public const EXPRESS_CHECKOUT_LOAD_DETAILS_PATH = '/payone/expresscheckout/load-details'; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @param \Silex\Application $app |
|
34
|
|
|
* |
|
35
|
|
|
* @return void |
|
36
|
|
|
*/ |
|
37
|
|
|
protected function defineControllers(Application $app) |
|
38
|
|
|
{ |
|
39
|
|
|
$this->createController('/payone', 'payone-index', 'Payone', 'index', 'index')->method('POST'); |
|
40
|
|
|
$this->createController('/payone/getfile', 'payone-getfile', 'payone', 'index', 'getFile')->method('GET|POST'); |
|
41
|
|
|
$this->createController('/payone/regular-redirect-payment-cancellation', 'payone-cancel-redirect', 'Payone', 'index', 'cancelRedirect')->method('GET'); |
|
42
|
|
|
$this->createController('/payone/getinvoice', 'payone-getinvoice', 'Payone', 'index', 'getInvoice')->method('GET'); |
|
43
|
|
|
$this->createController( |
|
44
|
|
|
static::EXPRESS_CHECKOUT_BUTTON_PATH, |
|
45
|
|
|
static::EXPRESS_CHECKOUT_BUTTON, |
|
46
|
|
|
'payone', |
|
47
|
|
|
'expressCheckout', |
|
48
|
|
|
'checkoutWithPaypalButton' |
|
49
|
|
|
)->method('GET'); |
|
50
|
|
|
|
|
51
|
|
|
$this->createController( |
|
52
|
|
|
static::EXPRESS_CHECKOUT_INIT_PATH, |
|
53
|
|
|
static::EXPRESS_CHECKOUT_INIT, |
|
54
|
|
|
'payone', |
|
55
|
|
|
'expressCheckout', |
|
56
|
|
|
'initPaypalExpressCheckout' |
|
57
|
|
|
)->method('GET'); |
|
58
|
|
|
|
|
59
|
|
|
$this->createController( |
|
60
|
|
|
static::EXPRESS_CHECKOUT_LOAD_DETAILS_PATH, |
|
61
|
|
|
static::EXPRESS_CHECKOUT_LOAD_DETAILS, |
|
62
|
|
|
'payone', |
|
63
|
|
|
'expressCheckout', |
|
64
|
|
|
'loadPaypalExpressCheckoutDetails' |
|
65
|
|
|
)->method('GET'); |
|
66
|
|
|
|
|
67
|
|
|
$this->createController( |
|
68
|
|
|
static::EXPRESS_CHECKOUT_FAILURE_PATH, |
|
69
|
|
|
static::EXPRESS_CHECKOUT_FAILURE, |
|
70
|
|
|
'payone', |
|
71
|
|
|
'expressCheckout', |
|
72
|
|
|
'failure' |
|
73
|
|
|
)->method('GET'); |
|
74
|
|
|
|
|
75
|
|
|
$this->createController( |
|
76
|
|
|
static::EXPRESS_CHECKOUT_BACK_PATH, |
|
77
|
|
|
static::EXPRESS_CHECKOUT_BACK, |
|
78
|
|
|
'payone', |
|
79
|
|
|
'expressCheckout', |
|
80
|
|
|
'back' |
|
81
|
|
|
)->method('GET'); |
|
82
|
|
|
} |
|
83
|
|
|
} |
|
84
|
|
|
|