@@ -87,7 +87,7 @@ |
||
| 87 | 87 | $sXml = $this->configExport->generateConfigExportXml(); |
| 88 | 88 | if ($sXml !== false) { |
| 89 | 89 | $oResultRaw->setHeader("Content-Type", "text/xml; charset=\"utf8\"", true); |
| 90 | - $oResultRaw->setHeader("Content-Disposition", "attachment; filename=\"payone_config_export" . date('Y-m-d H-i-s') . "_" . md5($sXml) . ".xml\"", true); |
|
| 90 | + $oResultRaw->setHeader("Content-Disposition", "attachment; filename=\"payone_config_export".date('Y-m-d H-i-s')."_".md5($sXml).".xml\"", true); |
|
| 91 | 91 | $oResultRaw->setContents($sXml); |
| 92 | 92 | } |
| 93 | 93 | } catch (\Exception $e) { |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | { |
| 222 | 222 | if (fmod(floatval($dItemAmount), 1.0) > 0) { // input does not represent an integer |
| 223 | 223 | $sErrorMessage = "Unable to use floating point values for item amounts! Parameter was: "; |
| 224 | - throw new \InvalidArgumentException($sErrorMessage . strval($dItemAmount), 1); |
|
| 224 | + throw new \InvalidArgumentException($sErrorMessage.strval($dItemAmount), 1); |
|
| 225 | 225 | } else { // return the integer value |
| 226 | 226 | return intval($dItemAmount); |
| 227 | 227 | } |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $sErrorMessage = false; |
| 137 | 137 | if (isset($aResponsePreCheck['status']) && $aResponsePreCheck['status'] == 'ERROR') { |
| 138 | - $sErrorMessage = __($aResponsePreCheck['errorcode'] . ' - ' . $aResponsePreCheck['customermessage']); |
|
| 138 | + $sErrorMessage = __($aResponsePreCheck['errorcode'].' - '.$aResponsePreCheck['customermessage']); |
|
| 139 | 139 | } elseif (isset($aResponseCalculation['status']) && $aResponseCalculation['status'] == 'ERROR') { |
| 140 | - $sErrorMessage = __($aResponseCalculation['errorcode'] . ' - ' . $aResponseCalculation['customermessage']); |
|
| 140 | + $sErrorMessage = __($aResponseCalculation['errorcode'].' - '.$aResponseCalculation['customermessage']); |
|
| 141 | 141 | } elseif (!$aResponsePreCheck || (isset($aResponsePreCheck['status']) && $aResponsePreCheck['status'] == 'OK' && !$aResponseCalculation)) { |
| 142 | 142 | $sErrorMessage = __('An unknown error occurred'); |
| 143 | 143 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | public function getPayDataArray($aResponse) |
| 190 | 190 | { |
| 191 | 191 | $aPayData = array(); |
| 192 | - foreach($aResponse as $sKey => $sValue) { |
|
| 192 | + foreach ($aResponse as $sKey => $sValue) { |
|
| 193 | 193 | $sCorrectedKey = str_ireplace('add_paydata[', '', $sKey); |
| 194 | 194 | $sCorrectedKey = rtrim($sCorrectedKey, ']'); |
| 195 | 195 | $sCorrectedKey = strtolower($sCorrectedKey); |
@@ -214,18 +214,18 @@ discard block |
||
| 214 | 214 | $aPayData = $this->getPayDataArray($aResponse); |
| 215 | 215 | foreach ($aPayData as $sKey => $sValue) { |
| 216 | 216 | $aSplit = explode('_', $sKey); |
| 217 | - for($i = count($aSplit); $i > 0; $i--) { |
|
| 218 | - if($i == count($aSplit)) { |
|
| 219 | - $aTmp = array($aSplit[$i-1] => $sValue); |
|
| 217 | + for ($i = count($aSplit); $i > 0; $i--) { |
|
| 218 | + if ($i == count($aSplit)) { |
|
| 219 | + $aTmp = array($aSplit[$i - 1] => $sValue); |
|
| 220 | 220 | } else { |
| 221 | - $aTmp = array($aSplit[$i-1] => $aTmp); |
|
| 221 | + $aTmp = array($aSplit[$i - 1] => $aTmp); |
|
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $aInstallmentData = array_replace_recursive($aInstallmentData, $aTmp); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - if(isset($aInstallmentData['paymentdetails']) && count($aInstallmentData['paymentdetails']) > 0) { |
|
| 228 | + if (isset($aInstallmentData['paymentdetails']) && count($aInstallmentData['paymentdetails']) > 0) { |
|
| 229 | 229 | return $aInstallmentData['paymentdetails']; |
| 230 | 230 | } |
| 231 | 231 | |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | // preauthorization-orders and advance payment should not create an invoice |
| 126 | - if ($oOrder->getPayoneAuthmode() != 'authorization' || $oOrder->getPayment()->getMethodInstance()->getCode() == PayoneConfig::METHOD_ADVANCE_PAYMENT){ |
|
| 126 | + if ($oOrder->getPayoneAuthmode() != 'authorization' || $oOrder->getPayment()->getMethodInstance()->getCode() == PayoneConfig::METHOD_ADVANCE_PAYMENT) { |
|
| 127 | 127 | return; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | ) { |
| 78 | 78 | try { |
| 79 | 79 | $return = $proceed($creditmemo, $offlineRequested); |
| 80 | - } catch(\Exception $ex) { |
|
| 80 | + } catch (\Exception $ex) { |
|
| 81 | 81 | $aRequest = $this->checkoutSession->getPayoneDebitRequest(); |
| 82 | 82 | if (is_array($aRequest) && !empty($aRequest)) { |
| 83 | 83 | $aResponse = $this->checkoutSession->getPayoneDebitResponse(); |
@@ -115,14 +115,14 @@ |
||
| 115 | 115 | $this->addParameter('language', $this->shopHelper->getLocale()); |
| 116 | 116 | |
| 117 | 117 | $this->addAddress($oAddress); |
| 118 | - if ($this->addressesChecked->wasAddressCheckedBefore($oAddress, $sType,true) === false) { |
|
| 118 | + if ($this->addressesChecked->wasAddressCheckedBefore($oAddress, $sType, true) === false) { |
|
| 119 | 119 | $aResponse = $this->send(); |
| 120 | 120 | if (isset($aResponse['score']) && $aResponse['score'] === 'U') { |
| 121 | 121 | $unknownDefault = $this->shopHelper->getConfigParam('unknown_value', 'creditrating', 'payone_protect'); |
| 122 | 122 | $aResponse['score'] = empty($unknownDefault) ? 'G' : $unknownDefault; |
| 123 | 123 | } |
| 124 | 124 | if ($aResponse['status'] == 'VALID') { |
| 125 | - $this->addressesChecked->addCheckedAddress($oAddress, $aResponse, $sType,true); |
|
| 125 | + $this->addressesChecked->addCheckedAddress($oAddress, $aResponse, $sType, true); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | return $aResponse; |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | $this->resultRawFactory = $resultRawFactory; |
| 106 | 106 | |
| 107 | 107 | // Fix for Magento 2.3 CsrfValidator and backwards-compatibility to prior Magento 2 versions |
| 108 | - if(interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) { |
|
| 108 | + if (interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) { |
|
| 109 | 109 | $request = $this->getRequest(); |
| 110 | 110 | if ($request instanceof Http && $request->isPost()) { |
| 111 | 111 | $request->setParam('ajax', true); |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | try { |
| 110 | 110 | $this->curl->post($sUrl, $aPostArray); |
| 111 | 111 | $this->log($sUrl.' Response: '.$this->curl->getBody(), $aPostArray); |
| 112 | - } catch(\Exception $exc) { |
|
| 112 | + } catch (\Exception $exc) { |
|
| 113 | 113 | $this->log($sUrl.' Exception: '.$exc->getMessage(), $aPostArray); |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | protected function removeBannedPaymentMethods($aPaymentMethods, Quote $oQuote) |
| 206 | 206 | { |
| 207 | 207 | $aBannedMethos = $this->getBannedPaymentMethods($oQuote); |
| 208 | - for($i = 0; $i < count($aPaymentMethods); $i++) { |
|
| 208 | + for ($i = 0; $i < count($aPaymentMethods); $i++) { |
|
| 209 | 209 | $sCode = $aPaymentMethods[$i]->getCode(); |
| 210 | 210 | if (array_key_exists($sCode, $aBannedMethos) !== false) { |
| 211 | 211 | $iBannedUntil = strtotime($aBannedMethos[$sCode]); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function removeAmazonPay($aPaymentMethods) |
| 227 | 227 | { |
| 228 | - for($i = 0; $i < count($aPaymentMethods); $i++) { |
|
| 228 | + for ($i = 0; $i < count($aPaymentMethods); $i++) { |
|
| 229 | 229 | if (isset($aPaymentMethods[$i]) && $aPaymentMethods[$i]->getCode() == PayoneConfig::METHOD_AMAZONPAY) { |
| 230 | 230 | unset($aPaymentMethods[$i]); |
| 231 | 231 | } |