| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | $configuration = new Configuration(); | 
| 23 | 23 | $config = $this->processConfiguration($configuration, $configs); | 
| 24 | 24 | |
| 25 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | |
| 25 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); | |
| 26 | 26 |          $loader->load('services.yml'); | 
| 27 | 27 | } | 
| 28 | 28 | } | 
| @@ -36,7 +36,7 @@ | ||
| 36 | 36 | Logger $logger, | 
| 37 | 37 | UserTranslator $userTranslator | 
| 38 | 38 |      ) { | 
| 39 | - parent::__construct($clientId, $clientPassword, $baseUrl,$mangoPayApi, $logger); | |
| 39 | + parent::__construct($clientId, $clientPassword, $baseUrl, $mangoPayApi, $logger); | |
| 40 | 40 | $this->userTranslator = $userTranslator; | 
| 41 | 41 | } | 
| 42 | 42 | |
| @@ -51,7 +51,7 @@ | ||
| 51 | 51 | |
| 52 | 52 | /** | 
| 53 | 53 | * @param KycDocumentPage $kycDocumentPage | 
| 54 | - * @return KycDocumentPage|PartFireException | |
| 54 | + * @return PartFireException|null | |
| 55 | 55 | */ | 
| 56 | 56 | public function create(KycDocumentPage $kycDocumentPage) | 
| 57 | 57 |      { | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | KycDocumentPageTranslator $kycDocumentPageTranslator | 
| 47 | 47 |      ) { | 
| 48 | 48 | $this->kycDocumentPageTranslator = $kycDocumentPageTranslator; | 
| 49 | - parent::__construct($clientId, $clientPassword, $baseUrl,$mangoPayApi, $logger); | |
| 49 | + parent::__construct($clientId, $clientPassword, $baseUrl, $mangoPayApi, $logger); | |
| 50 | 50 | } | 
| 51 | 51 | |
| 52 | 52 | /** | 
| @@ -58,10 +58,10 @@ discard block | ||
| 58 | 58 |          try { | 
| 59 | 59 | $kycDocumentPage = $this->mangoPayApi->Users->CreateKycPageFromFile($kycDocumentPage->getOwnerId(), $kycDocumentPage->getKycDocumentId(), $kycDocumentPage->getFilePath()); | 
| 60 | 60 | |
| 61 | -        } catch(ResponseException $e) { | |
| 61 | +        } catch (ResponseException $e) { | |
| 62 | 62 | $this->logger->addCritical($e->getMessage(), ['code' => $e->getCode(), 'details' => $e->GetErrorDetails()]); | 
| 63 | 63 | return new PartFireException($e->getMessage(), $e->getCode()); | 
| 64 | -        } catch(Exception $e) { | |
| 64 | +        } catch (Exception $e) { | |
| 65 | 65 | $this->logger->addError($e->getMessage()); | 
| 66 | 66 | return new PartFireException($e->getMessage(), $e->getCode()); | 
| 67 | 67 | } | 
| @@ -55,10 +55,10 @@ | ||
| 55 | 55 | return $this->payOutTranslator->translateMangoToPayOutDto($createdPayout); | 
| 56 | 56 | } | 
| 57 | 57 | $this->logger->addCritical( | 
| 58 | - "Pay-Out has been created with status: ".$createdPayout->Status . ' (result code: ' . $createdPayout->ResultCode . ')' | |
| 58 | + "Pay-Out has been created with status: " . $createdPayout->Status . ' (result code: ' . $createdPayout->ResultCode . ')' | |
| 59 | 59 | ); | 
| 60 | 60 | throw new PartFireException( | 
| 61 | - "Pay-Out has been created with status: ".$createdPayout->Status . ' (result code: ' . $createdPayout->ResultCode . ')' | |
| 61 | + "Pay-Out has been created with status: " . $createdPayout->Status . ' (result code: ' . $createdPayout->ResultCode . ')' | |
| 62 | 62 | ); | 
| 63 | 63 | } | 
| 64 | 64 |              $this->logger->addCritical("Failed to create PayOut"); | 
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | Logger $logger | 
| 33 | 33 | |
| 34 | 34 |      ) { | 
| 35 | - parent::__construct($clientId, $clientPassword, $baseUrl,$mangoPayApi, $logger); | |
| 35 | + parent::__construct($clientId, $clientPassword, $baseUrl, $mangoPayApi, $logger); | |
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 | public function list() | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | Logger $logger, | 
| 46 | 46 | WalletTranslator $walletTranslator | 
| 47 | 47 |      ) { | 
| 48 | - parent::__construct($clientId, $clientPassword, $baseUrl,$mangoPayApi, $logger); | |
| 48 | + parent::__construct($clientId, $clientPassword, $baseUrl, $mangoPayApi, $logger); | |
| 49 | 49 | $this->walletTranslator = $walletTranslator; | 
| 50 | 50 | } | 
| 51 | 51 | |
| @@ -54,10 +54,10 @@ discard block | ||
| 54 | 54 | $mangoWallet = $this->walletTranslator->convertDTOToMangoPayWallet($walletDto); | 
| 55 | 55 |          try { | 
| 56 | 56 | $mangoWallet = $this->mangoPayApi->Wallets->Create($mangoWallet); | 
| 57 | -        } catch(ResponseException $e) { | |
| 57 | +        } catch (ResponseException $e) { | |
| 58 | 58 | $this->logger->addCritical($e->getMessage(), ['code' => $e->getCode(), 'details' => $e->GetErrorDetails()]); | 
| 59 | 59 | throw new PartFireException($e->getMessage(), $e->getCode()); | 
| 60 | -        } catch(Exception $e) { | |
| 60 | +        } catch (Exception $e) { | |
| 61 | 61 | $this->logger->addError($e->getMessage()); | 
| 62 | 62 | throw new PartFireException($e->getMessage(), $e->getCode()); | 
| 63 | 63 | } | 
| @@ -74,7 +74,7 @@ | ||
| 74 | 74 | // Hook Variables | 
| 75 | 75 | // https://docs.mangopay.com/endpoints/v2.01/hooks#e246_the-hook-object | 
| 76 | 76 | const HOOK_EVENT_TYPE = "EventType"; | 
| 77 | - const HOOK_RESOURCE_ID = "RessourceId"; // Known spelling mistake in MangoPay Api | |
| 77 | + const HOOK_RESOURCE_ID = "RessourceId"; // Known spelling mistake in MangoPay Api | |
| 78 | 78 | const HOOK_DATE = "Date"; | 
| 79 | 79 | |
| 80 | 80 | // Event types | 
| @@ -329,6 +329,9 @@ | ||
| 329 | 329 |          return self::isEventType("PREAUTHORIZATION_", $eventType); | 
| 330 | 330 | } | 
| 331 | 331 | |
| 332 | + /** | |
| 333 | + * @param string $compareToEvent | |
| 334 | + */ | |
| 332 | 335 | private static function isEventType($compareToEvent, $eventName) | 
| 333 | 336 |      { | 
| 334 | 337 | $compareToEventLength = strlen($compareToEvent); | 
| @@ -55,7 +55,7 @@ | ||
| 55 | 55 | $responses = []; | 
| 56 | 56 | |
| 57 | 57 | $hookItems = $this->getHookService()->list(); | 
| 58 | -        foreach($hookItems as $hook) { | |
| 58 | +        foreach ($hookItems as $hook) { | |
| 59 | 59 | $hookId = $hook->Id; | 
| 60 | 60 |              $this->output->infoid("Updating Hook ID " . $hookId . " with " . $url); | 
| 61 | 61 |              try { | 
| @@ -30,7 +30,7 @@ | ||
| 30 | 30 | public function __construct($clientId, $clientPassword, $baseUrl, MangoPayApi $mangoPayApi, Logger $logger) | 
| 31 | 31 |      { | 
| 32 | 32 | $this->logger = $logger; | 
| 33 | - $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR. '..' . DIRECTORY_SEPARATOR. '..' . DIRECTORY_SEPARATOR. '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR. 'var/logs/mangopay.log'; | |
| 33 | + $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'var/logs/mangopay.log'; | |
| 34 | 34 | $this->logger->pushHandler(new StreamHandler($path, Logger::DEBUG)); | 
| 35 | 35 | |
| 36 | 36 | $this->mangoPayApi = $mangoPayApi; |