Completed
Pull Request — master (#20)
by Florian
02:20
created
Helper/ConfigExport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,6 +177,6 @@
 block discarded – undo
177 177
         if ($this->getPaymentConfig('allowspecific', $sPaymentCode, $sStoreCode, true) == '1') {
178 178
             return $this->getPaymentConfig('specificcountry', $sPaymentCode, $sStoreCode, true);
179 179
         }
180
-        return '';// empty return value if all countries are available
180
+        return ''; // empty return value if all countries are available
181 181
     }
182 182
 }
Please login to merge, or discard this patch.
Helper/Database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -188,6 +188,6 @@
 block discarded – undo
188 188
         if ($iCount === null) {
189 189
             return 0;
190 190
         }
191
-        return $iCount+1;
191
+        return $iCount + 1;
192 192
     }
193 193
 }
Please login to merge, or discard this patch.
Helper/Order.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,8 +129,8 @@
 block discarded – undo
129 129
         }
130 130
 
131 131
         if (!empty($aRates)) {// more than one shipping method existing?
132
-            ksort($aRates);// sort by price ascending
133
-            return array_shift($aRates);// return the cheapest shipping-method
132
+            ksort($aRates); // sort by price ascending
133
+            return array_shift($aRates); // return the cheapest shipping-method
134 134
         }
135 135
         return false;
136 136
     }
Please login to merge, or discard this patch.
Helper/HostedIframe.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -156,15 +156,15 @@
 block discarded – undo
156 156
      */
157 157
     public function getHostedFieldConfig()
158 158
     {
159
-        $aHostedParams = $this->getHostedParams();// get hosted params from config
159
+        $aHostedParams = $this->getHostedParams(); // get hosted params from config
160 160
 
161 161
         $aFieldConfig = [];
162 162
         if (!empty($aHostedParams)) {
163
-            $aFieldConfig['fields'] = $this->getFieldConfig();// generate config for all field types
163
+            $aFieldConfig['fields'] = $this->getFieldConfig(); // generate config for all field types
164 164
             $aFieldConfig['defaultStyle'] = $this->getDefaultStyles($aHostedParams);
165 165
             if ($aHostedParams['Errors_active'] == "true") {
166
-                $aFieldConfig['error'] = 'errorOutput';// area to display error-messages (optional)
167
-                $aFieldConfig['language'] = $aHostedParams['Errors_lang'];// has to be defined in javascript
166
+                $aFieldConfig['error'] = 'errorOutput'; // area to display error-messages (optional)
167
+                $aFieldConfig['language'] = $aHostedParams['Errors_lang']; // has to be defined in javascript
168 168
             }
169 169
         }
170 170
         return $aFieldConfig;
Please login to merge, or discard this patch.
Helper/Toolkit.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         if (!empty($sText)) {
136 136
             $sText = str_replace(array_keys($aSubstitutionArray), array_values($aSubstitutionArray), $sText);
137 137
             if ($iMaxLength !== false && strlen($sText) > $iMaxLength) {
138
-                $sText = substr($sText, 0, $iMaxLength);// shorten text if too long
138
+                $sText = substr($sText, 0, $iMaxLength); // shorten text if too long
139 139
             }
140 140
             return $sText;
141 141
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function getInvoiceAppendix(SalesOrder $oOrder)
152 152
     {
153
-        $sText = $this->getConfigParam('invoice_appendix', 'invoicing');// get invoice appendix from config
153
+        $sText = $this->getConfigParam('invoice_appendix', 'invoicing'); // get invoice appendix from config
154 154
         $aSubstitutionArray = [
155 155
             '{{order_increment_id}}' => $oOrder->getIncrementId(),
156 156
             '{{customer_id}}' => $oOrder->getCustomerId(),
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function getNarrativeText(SalesOrder $oOrder, PayoneMethod $oPayment)
170 170
     {
171
-        $sText = $this->getConfigParam($oPayment->getCode(), 'text');// get narrative text for payment from config
171
+        $sText = $this->getConfigParam($oPayment->getCode(), 'text'); // get narrative text for payment from config
172 172
         $aSubstitutionArray = [
173 173
             '{{order_increment_id}}' => $oOrder->getIncrementId(),
174 174
         ];
Please login to merge, or discard this patch.
Model/Methods/BaseMethod.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      */
236 236
     public function getInstructions()
237 237
     {
238
-        return trim($this->getConfigData('instructions'));// return description text
238
+        return trim($this->getConfigData('instructions')); // return description text
239 239
     }
240 240
 
241 241
     /**
@@ -247,9 +247,9 @@  discard block
 block discarded – undo
247 247
     {
248 248
         $sRequestType = $this->getAuthorizationMode();
249 249
         if ($sRequestType == PayoneConfig::REQUEST_TYPE_PREAUTHORIZATION) {
250
-            return AbstractMethod::ACTION_AUTHORIZE;// only create order
250
+            return AbstractMethod::ACTION_AUTHORIZE; // only create order
251 251
         } elseif ($sRequestType == PayoneConfig::REQUEST_TYPE_AUTHORIZATION) {
252
-            return AbstractMethod::ACTION_AUTHORIZE_CAPTURE;// create order and capture
252
+            return AbstractMethod::ACTION_AUTHORIZE_CAPTURE; // create order and capture
253 253
         }
254 254
     }
255 255
 
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function authorize(InfoInterface $payment, $amount)
264 264
     {
265
-        $oReturn = parent::authorize($payment, $amount);// execute Magento parent authorization
266
-        $this->sendPayoneAuthorization($payment, $amount);// send auth request to PAYONE
267
-        return $oReturn;// return magento parent auth value
265
+        $oReturn = parent::authorize($payment, $amount); // execute Magento parent authorization
266
+        $this->sendPayoneAuthorization($payment, $amount); // send auth request to PAYONE
267
+        return $oReturn; // return magento parent auth value
268 268
     }
269 269
 
270 270
     /**
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
      */
277 277
     public function refund(InfoInterface $payment, $amount)
278 278
     {
279
-        $oReturn = parent::refund($payment, $amount);// execute Magento parent refund
280
-        $this->sendPayoneDebit($payment, $amount);// send debit request to PAYONE
281
-        return $oReturn;// return magento parent refund value
279
+        $oReturn = parent::refund($payment, $amount); // execute Magento parent refund
280
+        $this->sendPayoneDebit($payment, $amount); // send debit request to PAYONE
281
+        return $oReturn; // return magento parent refund value
282 282
     }
283 283
 
284 284
     /**
@@ -290,13 +290,13 @@  discard block
 block discarded – undo
290 290
      */
291 291
     public function capture(InfoInterface $payment, $amount)
292 292
     {
293
-        $oReturn = parent::capture($payment, $amount);// execute Magento parent capture
293
+        $oReturn = parent::capture($payment, $amount); // execute Magento parent capture
294 294
         if ($payment->getParentTransactionId()) {// does the order already have a transaction?
295
-            $this->sendPayoneCapture($payment, $amount);// is probably admin invoice capture
295
+            $this->sendPayoneCapture($payment, $amount); // is probably admin invoice capture
296 296
         } else {
297
-            $this->sendPayoneAuthorization($payment, $amount);// is probably frontend checkout capture
297
+            $this->sendPayoneAuthorization($payment, $amount); // is probably frontend checkout capture
298 298
         }
299
-        return $oReturn;// return magento parent capture value
299
+        return $oReturn; // return magento parent capture value
300 300
     }
301 301
 
302 302
     /**
@@ -311,12 +311,12 @@  discard block
 block discarded – undo
311 311
         $iAllowSpecific = $this->shopHelper->getConfigParam('allowspecific');
312 312
         $aAvailableCountries = explode(',', $this->shopHelper->getConfigParam('specificcountry'));
313 313
         if ($this->hasCustomConfig()) {// check for non-global configuration
314
-            $iAllowSpecific = $this->getCustomConfigParam('allowspecific');// only specific countries allowed?
315
-            $aAvailableCountries = explode(',', $this->getCustomConfigParam('specificcountry'));// get allowed countries
314
+            $iAllowSpecific = $this->getCustomConfigParam('allowspecific'); // only specific countries allowed?
315
+            $aAvailableCountries = explode(',', $this->getCustomConfigParam('specificcountry')); // get allowed countries
316 316
         }
317 317
         if ($iAllowSpecific == 1 && !in_array($country, $aAvailableCountries)) {// only specific but not included
318
-            return false;// cant use for given country
318
+            return false; // cant use for given country
319 319
         }
320
-        return true;// can use for given country
320
+        return true; // can use for given country
321 321
     }
322 322
 }
Please login to merge, or discard this patch.
Model/Methods/PayoneMethod.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     protected function sendPayoneAuthorization(InfoInterface $payment, $amount)
112 112
     {
113 113
         $oOrder = $payment->getOrder();
114
-        $this->checkoutSession->unsPayoneRedirectUrl();// remove redirect url from session
114
+        $this->checkoutSession->unsPayoneRedirectUrl(); // remove redirect url from session
115 115
         $aResponse = $this->authorizationRequest->sendRequest($this, $oOrder, $amount);
116 116
         $this->handleResponse($aResponse);
117 117
         if ($aResponse['status'] == 'ERROR') {// request returned an error
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function getPaymentSpecificParameters(Order $oOrder)
156 156
     {
157
-        return [];// filled in child classes
157
+        return []; // filled in child classes
158 158
     }
159 159
 
160 160
     /**
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public function getSubTypeSpecificParameters(Order $oOrder)
274 274
     {
275
-        return [];// filled in child classes
275
+        return []; // filled in child classes
276 276
     }
277 277
 
278 278
     /**
Please login to merge, or discard this patch.
Model/ChecksumCheck.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,9 +113,9 @@
 block discarded – undo
113 113
         }
114 114
         if ($this->blGotModuleInfo === true) {// was composer.json readable?
115 115
             $sRequestUrl = $this->sVersionCheckUrl.'?module='.$this->sModuleId.'&version='.$this->sModuleVersion;
116
-            $sResponse = file_get_contents($sRequestUrl);// request info from fatchip checksum server
116
+            $sResponse = file_get_contents($sRequestUrl); // request info from fatchip checksum server
117 117
             if (!empty($sResponse)) {// Did the server answer?
118
-                $aFiles = json_decode($sResponse);// Decode the json encoded answer from the server
118
+                $aFiles = json_decode($sResponse); // Decode the json encoded answer from the server
119 119
             }
120 120
         }
121 121
         return $aFiles;
Please login to merge, or discard this patch.
Model/Api/Request/Debit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,19 +86,19 @@
 block discarded – undo
86 86
         $oOrder = $oPaymentInfo->getOrder();
87 87
         $iTxid = $oPaymentInfo->getParentTransactionId();
88 88
         if (strpos($iTxid, '-') !== false) {
89
-            $iTxid = substr($iTxid, 0, strpos($iTxid, '-'));// clean the txid from the magento-suffixes
89
+            $iTxid = substr($iTxid, 0, strpos($iTxid, '-')); // clean the txid from the magento-suffixes
90 90
         }
91 91
 
92 92
         $this->setOrderId($oOrder->getRealOrderId());
93 93
 
94 94
         $this->addParameter('request', 'debit'); // Request method
95
-        $this->addParameter('mode', $oPayment->getOperationMode());// PayOne Portal Operation Mode (live or test)
95
+        $this->addParameter('mode', $oPayment->getOperationMode()); // PayOne Portal Operation Mode (live or test)
96 96
         $this->addParameter('txid', $iTxid); // PayOne Transaction ID
97 97
         $this->addParameter('sequencenumber', $this->databaseHelper->getSequenceNumber($iTxid));
98 98
 
99 99
         // Total order sum in smallest currency unit
100
-        $this->addParameter('amount', number_format((-1 * $dAmount), 2, '.', '')*100);
101
-        $this->addParameter('currency', $oOrder->getOrderCurrencyCode());// Currency
100
+        $this->addParameter('amount', number_format((-1 * $dAmount), 2, '.', '') * 100);
101
+        $this->addParameter('currency', $oOrder->getOrderCurrencyCode()); // Currency
102 102
         $this->addParameter('transactiontype', 'GT');
103 103
 
104 104
         $sRefundAppendix = $this->getRefundAppendix($oOrder, $oPayment);
Please login to merge, or discard this patch.