@@ -75,8 +75,7 @@ |
||
| 75 | 75 | $response = $this->getMapperResponse()->map($responseRaw); |
| 76 | 76 | |
| 77 | 77 | $this->protocol($request, $response); |
| 78 | - } |
|
| 79 | - catch (Exception $e) { |
|
| 78 | + } catch (Exception $e) { |
|
| 80 | 79 | $this->protocolException($e, $request); |
| 81 | 80 | throw $e; |
| 82 | 81 | } |
@@ -60,8 +60,7 @@ |
||
| 60 | 60 | { |
| 61 | 61 | if ($this->isError()) { |
| 62 | 62 | $result = parent::__toString(); |
| 63 | - } |
|
| 64 | - else { |
|
| 63 | + } else { |
|
| 65 | 64 | $stringArray = array('status=' . $this->getStatus(), 'data=PDF-Content'); |
| 66 | 65 | $result = implode('|', $stringArray); |
| 67 | 66 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | { |
| 41 | 41 | $constants = $this->getClassConstants('Payone_Enum_ClearingType'); |
| 42 | 42 | |
| 43 | - if($blFlipArray === true) { |
|
| 43 | + if ($blFlipArray === true) { |
|
| 44 | 44 | $constants = array_flip($constants); |
| 45 | 45 | } |
| 46 | 46 | return $constants; |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | |
| 100 | 100 | protected function _toString($aValue) |
| 101 | 101 | { |
| 102 | - if($this->applyFilters) { |
|
| 102 | + if ($this->applyFilters) { |
|
| 103 | 103 | $result = $this->applyFilters->apply($aValue); |
| 104 | 104 | } else { |
| 105 | 105 | $protocolFactory = new Payone_Protocol_Factory(); |
@@ -75,8 +75,7 @@ |
||
| 75 | 75 | foreach ($this as $key => $data) { |
| 76 | 76 | if ($data === null) { |
| 77 | 77 | continue; |
| 78 | - } |
|
| 79 | - elseif ($data instanceof Payone_Protocol_Service_ApplyFilters == false) { |
|
| 78 | + } elseif ($data instanceof Payone_Protocol_Service_ApplyFilters == false) { |
|
| 80 | 79 | $result[$key] = $data; |
| 81 | 80 | } |
| 82 | 81 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | foreach ($objectArray as $key => $value) { |
| 79 | 79 | |
| 80 | - if($value instanceof Payone_Api_Response_Parameter_Interface){ |
|
| 80 | + if ($value instanceof Payone_Api_Response_Parameter_Interface) { |
|
| 81 | 81 | $stringArray[] = $this->apply($value->toArray()); |
| 82 | 82 | } elseif ($value !== null) { |
| 83 | 83 | $filter = $this->getFilterConfig($key); |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if(is_array($value)) { |
|
| 90 | + if (is_array($value)) { |
|
| 91 | 91 | foreach ($value as $sArrayKey => $sArrayValue) { |
| 92 | - $stringArray[] = $key.'_'.$sArrayKey.'='.$sArrayValue; |
|
| 92 | + $stringArray[] = $key . '_' . $sArrayKey . '=' . $sArrayValue; |
|
| 93 | 93 | } |
| 94 | 94 | } else { |
| 95 | 95 | $stringArray[] = $key . '=' . $value; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | public function setFilters(array $filters) |
| 127 | 127 | { |
| 128 | 128 | $this->filters = array(); |
| 129 | - foreach($filters as $key => /** @var $value Payone_Protocol_Filter_Interface */ $value) |
|
| 129 | + foreach ($filters as $key => /** @var $value Payone_Protocol_Filter_Interface */ $value) |
|
| 130 | 130 | { |
| 131 | 131 | $this->addFilter($value); |
| 132 | 132 | } |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function getFilterConfig($key) |
| 161 | 161 | { |
| 162 | - foreach($this->filters_config as $filter => $config) { |
|
| 163 | - if(in_array($key, $config)) { |
|
| 162 | + foreach ($this->filters_config as $filter => $config) { |
|
| 163 | + if (in_array($key, $config)) { |
|
| 164 | 164 | return $this->getFilter($filter); |
| 165 | 165 | } |
| 166 | 166 | } |
@@ -12,7 +12,6 @@ discard block |
||
| 12 | 12 | * Do not edit or add to this file if you wish to upgrade Payone to newer |
| 13 | 13 | * versions in the future. If you wish to customize Payone for your |
| 14 | 14 | * needs please refer to http://www.payone.de for more information. |
| 15 | - |
|
| 16 | 15 | * @category Payone |
| 17 | 16 | * @package Payone_Api |
| 18 | 17 | * @subpackage Request |
@@ -236,7 +235,7 @@ discard block |
||
| 236 | 235 | * @return Payone_Api_Request_Parameter_Authorization_PaymentMethod_RatePay |
| 237 | 236 | */ |
| 238 | 237 | function getRatePay(){ |
| 239 | - return $this->ratePay; |
|
| 238 | + return $this->ratePay; |
|
| 240 | 239 | } |
| 241 | 240 | |
| 242 | 241 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function getPayDataArray() { |
| 91 | 91 | $aPayData = array(); |
| 92 | - foreach($this->getPayData()->getItems() as $item) { |
|
| 92 | + foreach ($this->getPayData()->getItems() as $item) { |
|
| 93 | 93 | $sCorrectedKey = strtolower($item->getKey()); |
| 94 | 94 | $sCorrectedKey = str_replace('-', '_', $sCorrectedKey); |
| 95 | 95 | $aPayData[$sCorrectedKey] = $item->getData(); |
@@ -105,17 +105,17 @@ discard block |
||
| 105 | 105 | $aPayData = $this->getPayDataArray(); |
| 106 | 106 | foreach ($aPayData as $sKey => $sValue) { |
| 107 | 107 | $aSplit = explode('_', $sKey); |
| 108 | - for($i = count($aSplit); $i > 0; $i--) { |
|
| 109 | - if($i == count($aSplit)) { |
|
| 110 | - $aTmp = array($aSplit[$i-1] => $sValue); |
|
| 108 | + for ($i = count($aSplit); $i > 0; $i--) { |
|
| 109 | + if ($i == count($aSplit)) { |
|
| 110 | + $aTmp = array($aSplit[$i - 1] => $sValue); |
|
| 111 | 111 | } else { |
| 112 | - $aTmp = array($aSplit[$i-1] => $aTmp); |
|
| 112 | + $aTmp = array($aSplit[$i - 1] => $aTmp); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | $aInstallmentData = array_replace_recursive($aInstallmentData, $aTmp); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - if(isset($aInstallmentData['paymentdetails']) && count($aInstallmentData['paymentdetails']) > 0) { |
|
| 118 | + if (isset($aInstallmentData['paymentdetails']) && count($aInstallmentData['paymentdetails']) > 0) { |
|
| 119 | 119 | return $aInstallmentData['paymentdetails']; |
| 120 | 120 | } |
| 121 | 121 | return false; |
@@ -91,17 +91,17 @@ discard block |
||
| 91 | 91 | public function __construct(array $data = array()) |
| 92 | 92 | { |
| 93 | 93 | if (empty($data)) { |
| 94 | - if($this->getApiConfig() === null) |
|
| 94 | + if ($this->getApiConfig() === null) |
|
| 95 | 95 | { |
| 96 | 96 | $this->apiConfig = new Payone_Api_Config(); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if($this->getTransactionStatusConfig() === null) |
|
| 99 | + if ($this->getTransactionStatusConfig() === null) |
|
| 100 | 100 | { |
| 101 | 101 | $this->transactionStatusConfig = new Payone_TransactionStatus_Config(); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if($this->getSessionStatusConfig() === null) |
|
| 104 | + if ($this->getSessionStatusConfig() === null) |
|
| 105 | 105 | { |
| 106 | 106 | $this->sessionStatusConfig = new Payone_SessionStatus_Config(); |
| 107 | 107 | } |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | $this->config = $this->getDefaultConfigData(); |
| 110 | 110 | } |
| 111 | 111 | else { |
| 112 | - if(array_key_exists('api', $data)) |
|
| 112 | + if (array_key_exists('api', $data)) |
|
| 113 | 113 | $this->setApiConfig($data['api']); |
| 114 | - if(array_key_exists('transaction_status', $data)) |
|
| 114 | + if (array_key_exists('transaction_status', $data)) |
|
| 115 | 115 | $this->setTransactionStatusConfig($data['transaction_status']); |
| 116 | - if(array_key_exists('session_status', $data)) |
|
| 116 | + if (array_key_exists('session_status', $data)) |
|
| 117 | 117 | $this->setSessionStatusConfig($data['session_status']); |
| 118 | 118 | $this->config = $data; |
| 119 | 119 | } |
@@ -107,14 +107,16 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $this->config = $this->getDefaultConfigData(); |
| 110 | - } |
|
| 111 | - else { |
|
| 112 | - if(array_key_exists('api', $data)) |
|
| 113 | - $this->setApiConfig($data['api']); |
|
| 114 | - if(array_key_exists('transaction_status', $data)) |
|
| 115 | - $this->setTransactionStatusConfig($data['transaction_status']); |
|
| 116 | - if(array_key_exists('session_status', $data)) |
|
| 117 | - $this->setSessionStatusConfig($data['session_status']); |
|
| 110 | + } else { |
|
| 111 | + if(array_key_exists('api', $data)) { |
|
| 112 | + $this->setApiConfig($data['api']); |
|
| 113 | + } |
|
| 114 | + if(array_key_exists('transaction_status', $data)) { |
|
| 115 | + $this->setTransactionStatusConfig($data['transaction_status']); |
|
| 116 | + } |
|
| 117 | + if(array_key_exists('session_status', $data)) { |
|
| 118 | + $this->setSessionStatusConfig($data['session_status']); |
|
| 119 | + } |
|
| 118 | 120 | $this->config = $data; |
| 119 | 121 | } |
| 120 | 122 | } |
@@ -173,8 +175,7 @@ discard block |
||
| 173 | 175 | $object = $tree[$currentKey]; |
| 174 | 176 | $object->setValue($newKey, $value); |
| 175 | 177 | return TRUE; |
| 176 | - } |
|
| 177 | - else { |
|
| 178 | + } else { |
|
| 178 | 179 | // Set value (can overwrite an existing value) |
| 179 | 180 | $tree[$key] = $value; |
| 180 | 181 | // Exit recursion, Success! |
@@ -208,11 +209,9 @@ discard block |
||
| 208 | 209 | /** @var $object Payone_Config_Abstract */ |
| 209 | 210 | $object = $tree[$currentKey]; |
| 210 | 211 | return $object->getValue($newKey); |
| 211 | - } |
|
| 212 | - elseif (is_array($tree) and array_key_exists($key, $tree)) { |
|
| 212 | + } elseif (is_array($tree) and array_key_exists($key, $tree)) { |
|
| 213 | 213 | return $tree[$key]; // Exit recursion, Success! |
| 214 | - } |
|
| 215 | - else { |
|
| 214 | + } else { |
|
| 216 | 215 | return NULL; // Exit recursion, unsuccessful |
| 217 | 216 | } |
| 218 | 217 | } |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | return FALSE; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - $sFullLogMessage = date('[Y-m-d H:i:s] ').strtoupper($level).' - '.$message.PHP_EOL; |
|
| 88 | + $sFullLogMessage = date('[Y-m-d H:i:s] ') . strtoupper($level) . ' - ' . $message . PHP_EOL; |
|
| 89 | 89 | error_log($sFullLogMessage, 3, $fileName); |
| 90 | 90 | |
| 91 | 91 | return true; |