Skip to content

Commit

Permalink
Merge pull request #216 from Amsterdam/dpsecure
Browse files Browse the repository at this point in the history
Update 2020-10-19
  • Loading branch information
maartendekeizer authored Oct 19, 2020
2 parents 2cd7877 + 875c34b commit 832cc21
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ services:
public: false
bind:
$allegroEndpoint: '%env(ALLEGRO_ENDPOINT)%'
$allegroOnbekendeSchuldeiser: '%env(ALLEGRO_ONBEKENDE_SCHULDEISER)%'


GemeenteAmsterdam\FixxxSchuldhulp\:
Expand Down
2 changes: 2 additions & 0 deletions src/EventListener/MailNotitificationSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ protected function mail($from, $to, $template, $data)
$message->setBody($html, 'text/html');
$message->addPart($txt, 'text/plain');

$this->logger->info(sprintf('Mail from: %s, to: %s, subject: %s', $from, $to, $subject), ['mail']);

$this->mailer->send($message);
}

Expand Down
14 changes: 9 additions & 5 deletions src/Service/AllegroService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class AllegroService
'Vrouw' => 'V',
];

const ONBEKENDE_SCHULDEISER = '2450232';

/**
* Burgerlijke staat:
* varchar(1), Null allowed, waarden(@, A = Onbekend, B = Alleenstaand, C = Samenwonend, D = Geregistreerd partnerschap, E = Gehuwd, F = Gescheiden, G = Weduwnaar, Null)
Expand Down Expand Up @@ -104,23 +102,29 @@ class AllegroService
*/
private $security;

/**
* @var string
*/
private $onbekendeSchuldeiser;


public function __construct(
string $allegroEndpoint,
EntityManagerInterface $em,
SchuldHulpService $altService,
LoggerInterface $logger,
EventDispatcherInterface $eventDispatcher,
Security $security
Security $security,
$allegroOnbekendeSchuldeiser
) {
$this->loginWsdl = sprintf('%s?service=LoginService', $allegroEndpoint);
$this->schuldHulpWsdl = sprintf('%s?service=SchuldHulpService', $allegroEndpoint);
$this->altService = $altService;
$this->logger = $logger;
$this->eventDispatcher = $eventDispatcher;
$this->security = $security;

$this->em = $em;
$this->onbekendeSchuldeiser = (string)$allegroOnbekendeSchuldeiser;
}

/**
Expand Down Expand Up @@ -394,7 +398,7 @@ private function mapSchulden(Dossier $dossier): SchuldArray
continue;
}

$codeEiser = null === $item->getSchuldeiser()->getAllegroCode() ? self::ONBEKENDE_SCHULDEISER : $item->getSchuldeiser()->getAllegroCode();
$codeEiser = null === $item->getSchuldeiser()->getAllegroCode() ? $this->onbekendeSchuldeiser : $item->getSchuldeiser()->getAllegroCode();

$schuld = new TSchuld($item->getSchuldeiser()->getBedrijfsnaam(), 1, $item->getBedrag(), $codeEiser);

Expand Down

0 comments on commit 832cc21

Please sign in to comment.