| @@ -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) { | 
| @@ -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 | |
| @@ -268,7 +268,6 @@ | ||
| 268 | 268 | |
| 269 | 269 | /** | 
| 270 | 270 | * Send the previously prepared request, log request and response into the database and return the response | 
| 271 | - | |
| 272 | 271 | * @param PayoneMethod $oPayment | 
| 273 | 272 | * @return array | 
| 274 | 273 | */ | 
| @@ -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(); | 
| @@ -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 | } | 
| @@ -123,12 +123,12 @@ | ||
| 123 | 123 | */ | 
| 124 | 124 | public function forwardAsyncRequest($aPostArray, $sUrl) | 
| 125 | 125 |      { | 
| 126 | - // Increased timeout to 5500ms | |
| 127 | - // See payone-gmbh/magento-2 issue #316 | |
| 126 | + // Increased timeout to 5500ms | |
| 127 | + // See payone-gmbh/magento-2 issue #316 | |
| 128 | 128 | $this->curl->setOption(CURLOPT_TIMEOUT_MS, 5500); | 
| 129 | 129 | $this->curl->setOption(CURLOPT_SSL_VERIFYPEER, false); | 
| 130 | 130 | $this->curl->setOption(CURLOPT_SSL_VERIFYHOST, false); | 
| 131 | - $this->curl->setOption(CURLOPT_FOLLOWLOCATION, true); | |
| 131 | + $this->curl->setOption(CURLOPT_FOLLOWLOCATION, true); | |
| 132 | 132 |          try { | 
| 133 | 133 | $this->curl->post($sUrl, $aPostArray); | 
| 134 | 134 |          } catch (\Exception $exc) { | 
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | parent::__construct($context); | 
| 47 | 47 | |
| 48 | 48 | // Fix for Magento 2.3 CsrfValidator and backwards-compatibility to prior Magento 2 versions | 
| 49 | -        if(interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) { | |
| 49 | +        if (interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) { | |
| 50 | 50 | $request = $this->getRequest(); | 
| 51 | 51 |              if ($request instanceof Http && $request->isPost()) { | 
| 52 | 52 |                  $request->setParam('ajax', true); | 
| @@ -185,7 +185,7 @@ | ||
| 185 | 185 | |
| 186 | 186 |          if ($autoCcDetection) { | 
| 187 | 187 | // Get a flat CC type array like (e.g. ["V", "M", "J", "U", "P"]). | 
| 188 | -            $availableCcTypes = array_map(function ($type) { return $type['id']; }, $this->paymentHelper->getAvailableCreditcardTypes()); | |
| 188 | +            $availableCcTypes = array_map(function($type) { return $type['id']; }, $this->paymentHelper->getAvailableCreditcardTypes()); | |
| 189 | 189 | |
| 190 | 190 | // Return the auto cardtype detection config with enabled CC types. | 
| 191 | 191 | return [ | 
| @@ -278,7 +278,7 @@ | ||
| 278 | 278 | public function getOldAddressStatus(AddressInterface $oAddress, $blIsCreditrating = true) | 
| 279 | 279 |      { | 
| 280 | 280 | $sStatus = $this->getStatusFromPreviousQuoteAddress($oAddress, $blIsCreditrating); | 
| 281 | -        if(empty($sStatus) && $blIsCreditrating === true && $this->getConfigParam('integration_event', 'creditrating', 'payone_protect') == 'after_payment') { | |
| 281 | +        if (empty($sStatus) && $blIsCreditrating === true && $this->getConfigParam('integration_event', 'creditrating', 'payone_protect') == 'after_payment') { | |
| 282 | 282 | $sStatus = $this->getScoreFromCheckedAddresses($oAddress); | 
| 283 | 283 | } | 
| 284 | 284 | return $sStatus; | 
| @@ -39,13 +39,13 @@ | ||
| 39 | 39 | * @var array | 
| 40 | 40 | */ | 
| 41 | 41 | protected static $aTypes = [ | 
| 42 | -        'visa'              => array('name' => 'Visa',                  'cardtype' => 'V', 'cvc_length' => 3), | |
| 43 | -        'mastercard'        => array('name' => 'Mastercard',            'cardtype' => 'M', 'cvc_length' => 3), | |
| 44 | -        'americanexpress'   => array('name' => 'American Express',      'cardtype' => 'A', 'cvc_length' => 4), | |
| 45 | -        'dinersclub'        => array('name' => 'Diners Club',           'cardtype' => 'D', 'cvc_length' => 3), | |
| 46 | -        'jcb'               => array('name' => 'JCB',                   'cardtype' => 'J', 'cvc_length' => 3), | |
| 42 | +        'visa'              => array('name' => 'Visa', 'cardtype' => 'V', 'cvc_length' => 3), | |
| 43 | +        'mastercard'        => array('name' => 'Mastercard', 'cardtype' => 'M', 'cvc_length' => 3), | |
| 44 | +        'americanexpress'   => array('name' => 'American Express', 'cardtype' => 'A', 'cvc_length' => 4), | |
| 45 | +        'dinersclub'        => array('name' => 'Diners Club', 'cardtype' => 'D', 'cvc_length' => 3), | |
| 46 | +        'jcb'               => array('name' => 'JCB', 'cardtype' => 'J', 'cvc_length' => 3), | |
| 47 | 47 |          'maestroint'        => array('name' => 'Maestro International', 'cardtype' => 'O', 'cvc_length' => 3), | 
| 48 | -        'cartebleue'        => array('name' => 'Carte Bleue',           'cardtype' => 'B', 'cvc_length' => 3), | |
| 48 | +        'cartebleue'        => array('name' => 'Carte Bleue', 'cardtype' => 'B', 'cvc_length' => 3), | |
| 49 | 49 | ]; | 
| 50 | 50 | |
| 51 | 51 | /** |