Skip to content

Commit

Permalink
Add externalId to authorization context
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Leszczak committed Feb 24, 2022
1 parent f75960c commit 1406d04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gateway/Http/Client/PaymentAuthorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function placeRequest(TransferInterface $transferObject)
PaymentField::REDIRECT_URL_FIELD_NAME => $apiResponseObject->getRedirectUrl(),
PaymentField::STATUS_FIELD_NAME => $apiResponseObject->getStatus(),
PaymentField::PAYMENT_ID_FIELD_NAME => $apiResponseObject->getPaymentId(),
PaymentField::EXTERNAL_ID_FIELD_NAME => $transferObject->getBody()[PaymentField::EXTERNAL_ID_FIELD_NAME]
];
} catch (PaynowException $exception) {
$this->logger->error(
Expand Down
7 changes: 7 additions & 0 deletions Helper/NotificationProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ public function process($paymentId, $status, $externalId)
$orderPaymentStatus = $paymentAdditionalInformation[PaymentField::STATUS_FIELD_NAME];
$finalPaymentStatus = $orderPaymentStatus == Status::STATUS_CONFIRMED;

$this->logger->debug(
"Current order state",
array_merge($this->loggerContext, [
'currentStatus' => $orderPaymentStatus
])
);

if ($finalPaymentStatus) {
throw new OrderHasBeenAlreadyPaidException($externalId, $paymentId);
}
Expand Down

0 comments on commit 1406d04

Please sign in to comment.