We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 731bbdbc authored by acampos1916's avatar acampos1916

Fix for code smells

parent 1dc9d21c
...@@ -133,11 +133,15 @@ class VaultDetailsHandler implements HandlerInterface ...@@ -133,11 +133,15 @@ class VaultDetailsHandler implements HandlerInterface
*/ */
private function getVaultPaymentToken(array $response, $payment) private function getVaultPaymentToken(array $response, $payment)
{ {
$paymentToken = null;
if (!empty($response['additionalData'])) { if (empty($response['additionalData'])) {
return null;
}
$additionalData = $response['additionalData']; $additionalData = $response['additionalData'];
$paymentToken = null;
foreach (self::ADDITIONAL_DATA_ERRORS as $key => $errorMsg) { foreach (self::ADDITIONAL_DATA_ERRORS as $key => $errorMsg) {
if (empty($additionalData[$key])) { if (empty($additionalData[$key])) {
$this->adyenLogger->error($errorMsg); $this->adyenLogger->error($errorMsg);
...@@ -188,7 +192,6 @@ class VaultDetailsHandler implements HandlerInterface ...@@ -188,7 +192,6 @@ class VaultDetailsHandler implements HandlerInterface
} catch (\Exception $e) { } catch (\Exception $e) {
$this->adyenLogger->error(print_r($e, true)); $this->adyenLogger->error(print_r($e, true));
} }
}
return $paymentToken; return $paymentToken;
} }
...@@ -198,8 +201,10 @@ class VaultDetailsHandler implements HandlerInterface ...@@ -198,8 +201,10 @@ class VaultDetailsHandler implements HandlerInterface
* @return string * @return string
* @throws \Exception * @throws \Exception
*/ */
private function getExpirationDate($expirationDate) private
{ function getExpirationDate(
$expirationDate
) {
$expirationDate = explode('/', $expirationDate); $expirationDate = explode('/', $expirationDate);
//add leading zero to month //add leading zero to month
...@@ -226,8 +231,10 @@ class VaultDetailsHandler implements HandlerInterface ...@@ -226,8 +231,10 @@ class VaultDetailsHandler implements HandlerInterface
* @param InfoInterface $payment * @param InfoInterface $payment
* @return OrderPaymentExtensionInterface * @return OrderPaymentExtensionInterface
*/ */
private function getExtensionAttributes(InfoInterface $payment) private
{ function getExtensionAttributes(
InfoInterface $payment
) {
$extensionAttributes = $payment->getExtensionAttributes(); $extensionAttributes = $payment->getExtensionAttributes();
if (null === $extensionAttributes) { if (null === $extensionAttributes) {
$extensionAttributes = $this->paymentExtensionFactory->create(); $extensionAttributes = $this->paymentExtensionFactory->create();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment