@@ -13,24 +13,45 @@ class Etransactions
1313 /**
1414 * Primary server.
1515 */
16- public const MAIN_SERVER = "tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi " ;
16+ const MAIN_SERVER = "tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi " ;
1717
1818 /**
1919 * Backup server.
2020 */
21- public const BACKUP_SERVER = "tpeweb1.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi " ;
21+ const BACKUP_SERVER = "tpeweb1.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi " ;
2222
2323 /**
2424 * Sandbox server.
2525 */
26- public const SANDBOX_SERVER = "preprod-tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi " ;
26+ const SANDBOX_SERVER = "preprod-tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi " ;
2727
2828 /**
29+ * @var HttpClientInterface
30+ */
31+ protected $ client ;
32+
33+ /**
34+ * @var MessageFactory
35+ */
36+ protected $ messageFactory ;
37+
38+ /**
39+ * @var array
40+ */
41+ protected $ options = [];
42+
43+ /**
44+ * @param array $options
45+ * @param HttpClientInterface $client
46+ * @param MessageFactory $messageFactory
2947 *
3048 * @throws \Payum\Core\Exception\InvalidArgumentException if an option is invalid
3149 */
32- public function __construct (protected array $ options , protected HttpClientInterface $ client , protected MessageFactory $ messageFactory )
50+ public function __construct (array $ options , HttpClientInterface $ client , MessageFactory $ messageFactory )
3351 {
52+ $ this ->options = $ options ;
53+ $ this ->client = $ client ;
54+ $ this ->messageFactory = $ messageFactory ;
3455 }
3556
3657
@@ -50,6 +71,8 @@ public function doPayment(array $fields)
5071 }
5172
5273 /**
74+ * @param array $fields
75+ *
5376 * @return array
5477 */
5578 protected function doRequest ($ method , array $ fields )
@@ -74,11 +97,11 @@ protected function doRequest($method, array $fields)
7497 */
7598 protected function getApiEndpoint ()
7699 {
77- $ servers = [] ;
100+ $ servers = array () ;
78101 if ($ this ->options ['sandbox ' ]) {
79102 $ servers [] = self ::SANDBOX_SERVER ;
80103 } else {
81- $ servers = [ self ::MAIN_SERVER , self ::BACKUP_SERVER ] ;
104+ $ servers = array ( self ::MAIN_SERVER , self ::BACKUP_SERVER ) ;
82105 }
83106
84107 foreach ($ servers as $ server ) {
@@ -122,12 +145,13 @@ protected function computeHmac($hmac, $fields)
122145 /**
123146 * Makes an array of parameters become a querystring like string.
124147 *
148+ * @param array $array
125149 *
126150 * @return string
127151 */
128152 static public function stringify (array $ array )
129153 {
130- $ result = [] ;
154+ $ result = array () ;
131155 foreach ($ array as $ key => $ value ) {
132156 $ result [] = sprintf ('%s=%s ' , $ key , $ value );
133157 }
0 commit comments