@@ -28,11 +28,10 @@ |
||
28 | 28 | |
29 | 29 | use Magento\Payment\Model\Method\AbstractMethod; |
30 | 30 | use Magento\Sales\Model\Order; |
31 | -use Payone\Core\Model\Methods\Paydirekt as ClassToTest; |
|
31 | +use Payone\Core\Model\Methods\Paydirekt; |
|
32 | 32 | use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; |
33 | 33 | use Payone\Core\Helper\Shop; |
34 | 34 | use Magento\Framework\App\Config\ScopeConfigInterface; |
35 | -use Payone\Core\Model\Methods\Paydirekt; |
|
36 | 35 | use Payone\Core\Model\PayoneConfig; |
37 | 36 | use Magento\Payment\Model\Info; |
38 | 37 | use Payone\Core\Model\Api\Request\Authorization; |
@@ -169,7 +169,7 @@ |
||
169 | 169 | * Get fallback template |
170 | 170 | * |
171 | 171 | * @param string $sCompany |
172 | - * @return mixed |
|
172 | + * @return string |
|
173 | 173 | */ |
174 | 174 | protected function getFallbackText($sCompany) |
175 | 175 | { |
@@ -26,8 +26,6 @@ |
||
26 | 26 | |
27 | 27 | namespace Payone\Core\Model\Api\Payolution; |
28 | 28 | |
29 | -use Locale; |
|
30 | - |
|
31 | 29 | /** |
32 | 30 | * Class for requesting the privacy declaration from payolution |
33 | 31 | */ |
@@ -170,7 +170,6 @@ |
||
170 | 170 | * Method to trigger the Payone genericpayment request pre-check |
171 | 171 | * |
172 | 172 | * @param float $dAmount |
173 | - * @param string|bool $sBirthday |
|
174 | 173 | * @return array |
175 | 174 | * @throws LocalizedException |
176 | 175 | */ |
@@ -28,7 +28,6 @@ |
||
28 | 28 | |
29 | 29 | use Payone\Core\Model\PayoneConfig; |
30 | 30 | use Magento\Sales\Model\Order; |
31 | -use Magento\Payment\Model\InfoInterface; |
|
32 | 31 | use Magento\Framework\Exception\LocalizedException; |
33 | 32 | use Payone\Core\Model\Methods\PayoneMethod; |
34 | 33 | use Magento\Framework\DataObject; |
@@ -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 | */ |
@@ -88,7 +88,7 @@ |
||
88 | 88 | |
89 | 89 | // order is not guaranteed to exist if using transaction status forwarding |
90 | 90 | // advance payment should not create an invoice |
91 | - if (null === $oOrder || $oOrder->getPayment()->getMethodInstance()->getCode() == PayoneConfig::METHOD_ADVANCE_PAYMENT){ |
|
91 | + if (null === $oOrder || $oOrder->getPayment()->getMethodInstance()->getCode() == PayoneConfig::METHOD_ADVANCE_PAYMENT) { |
|
92 | 92 | return; |
93 | 93 | } |
94 | 94 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | /** |
34 | 34 | * Class constructor |
35 | 35 | * |
36 | - * @param \PHPUnit_Framework_TestCase $testObject |
|
36 | + * @param \Payone\Core\Test\Unit\BaseTestCase $testObject |
|
37 | 37 | */ |
38 | 38 | public function __construct($testObject) |
39 | 39 | { |
@@ -36,7 +36,6 @@ |
||
36 | 36 | use Payone\Core\Helper\Environment; |
37 | 37 | use Payone\Core\Helper\Shop; |
38 | 38 | use Payone\Core\Model\PayoneConfig; |
39 | -use Locale; |
|
40 | 39 | use Payone\Core\Test\Unit\BaseTestCase; |
41 | 40 | use Payone\Core\Model\Test\PayoneObjectManager; |
42 | 41 |
@@ -27,13 +27,11 @@ |
||
27 | 27 | namespace Payone\Core\Test\Unit\Model\Api; |
28 | 28 | |
29 | 29 | use Payone\Core\Model\Api\Invoice as ClassToTest; |
30 | -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; |
|
31 | 30 | use Payone\Core\Helper\Toolkit; |
32 | 31 | use Payone\Core\Model\Api\Request\Authorization; |
33 | 32 | use Magento\Sales\Model\Order; |
34 | 33 | use Magento\Sales\Model\Order\Item; |
35 | 34 | use Payone\Core\Test\Unit\BaseTestCase; |
36 | -use Payone\Core\Model\Test\PayoneObjectManager; |
|
37 | 35 | |
38 | 36 | class InvoiceTest extends BaseTestCase |
39 | 37 | { |