Skip to content

Commit

Permalink
PAYOSWXP-120: Addresses ECS issues and reverts the changes made in PA…
Browse files Browse the repository at this point in the history
…YOSWXP-121 (I created a separate branch for this).
  • Loading branch information
amirinterlutions committed Jan 28, 2024
1 parent 3b5f4b8 commit 31fa198
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NotificationForwardHandler implements MessageSubscriberInterface
{
public function __construct(
private readonly EntityRepository $notificationForwardRepository,
private readonly Logger $logger
private readonly Logger $logger
) {
}

Expand Down Expand Up @@ -81,10 +81,10 @@ private function getNotificationForwards(array $ids, Context $context): EntitySe
}

private function updateResponses(
\CurlMultiHandle $multiHandle,
\CurlMultiHandle $multiHandle,
EntitySearchResult $notificationForwards,
array $forwardRequests,
Context $context
array $forwardRequests,
Context $context
): void {
$data = [];

Expand Down Expand Up @@ -120,16 +120,14 @@ private function getForwardRequests(\CurlMultiHandle $multiHandle, EntitySearchR

$forwardRequests[$id] = curl_init();

$content = unserialize($forward->getContent(), []);
$serialize = unserialize($forward->getContent(), []);
/** @var array<int, string>|string|false $content */
$content = mb_convert_encoding($serialize, 'ISO-8859-1', 'UTF-8');

if (!\is_array($content)) {
continue;
}

foreach ($content as $key => $value) {
$content[$key] = mb_convert_encoding($value, 'ISO-8859-1', 'UTF-8');
}

curl_setopt($forwardRequests[$id], \CURLOPT_URL, $target->getUrl());
curl_setopt($forwardRequests[$id], \CURLOPT_HEADER, false);
curl_setopt($forwardRequests[$id], \CURLOPT_POST, true);
Expand All @@ -148,7 +146,7 @@ private function getForwardRequests(\CurlMultiHandle $multiHandle, EntitySearchR

private function buildHeaders(
PayonePaymentNotificationForwardEntity $forward,
PayonePaymentNotificationTargetEntity $target
PayonePaymentNotificationTargetEntity $target
): array {
$headers = [
'X-Forwarded-For: ' . $forward->getIp(),
Expand Down

0 comments on commit 31fa198

Please sign in to comment.