Skip to content

Commit

Permalink
Release 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Leszczak committed Feb 24, 2022
1 parent 1406d04 commit 852bc9b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Controller/Payment/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ public function execute()
);
$this->getResponse()->setHttpResponseCode(400);
} catch (OrderHasBeenAlreadyPaidException $exception) {
$this->logger->info($exception->getMessage() . ' Skip processing the notification.');
$this->logger->info(
$exception->getMessage() . ' Skip processing the notification.',
$notificationData
);
$this->getResponse()->setHttpResponseCode(200);
}
}
Expand Down
12 changes: 8 additions & 4 deletions Helper/NotificationProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ public function process($paymentId, $status, $externalId)

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

if ($finalPaymentStatus) {
Expand Down Expand Up @@ -212,7 +215,7 @@ private function paymentRejected()
$this->order->addCommentToStatusHistory($message);
}

$this->order->getPayment()->setIsClosed(true);
$this->order->getPayment()->setIsClosed(true);
}

/**
Expand Down Expand Up @@ -250,6 +253,7 @@ private function isCorrectStatus($previousStatus, $nextStatus): bool
{
$paymentStatusFlow = [
Status::STATUS_NEW => [
Status::STATUS_NEW,
Status::STATUS_PENDING,
Status::STATUS_ERROR,
Status::STATUS_EXPIRED,
Expand Down
2 changes: 1 addition & 1 deletion Model/Exception/OrderHasBeenAlreadyPaidException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class OrderHasBeenAlreadyPaidException extends Exception
{
const EXCEPTION_MESSAGE = 'Order %s has been already paid in %s.';
const EXCEPTION_MESSAGE = 'An order %s has been already paid in %s.';

public function __construct($orderId, $paymentId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function testHandle()
PaymentField::PAYMENT_ID_FIELD_NAME => 'testPaymentId',
PaymentField::STATUS_FIELD_NAME => 'NEW',
PaymentField::REDIRECT_URL_FIELD_NAME => 'testRedirectUrl',
PaymentField::EXTERNAL_ID_FIELD_NAME => 'testExternalId',
];

$paymentDO->expects(static::atLeastOnce())
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pay-now/paynow-magento2",
"description": "Module for Paynow payments",
"type": "magento2-module",
"version": "1.1.1",
"version": "1.1.2",
"license": "MIT",
"keywords": [
"paynow",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Paynow_PaymentGateway" setup_version="1.1.1">
<module name="Paynow_PaymentGateway" setup_version="1.1.2">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down

0 comments on commit 852bc9b

Please sign in to comment.