diff --git a/src/Messages/Notification.php b/src/Messages/Notification.php index 9cfaaab..be93f27 100644 --- a/src/Messages/Notification.php +++ b/src/Messages/Notification.php @@ -1,9 +1,7 @@ getData()->order->status; if (in_array($status, ['COMPLETED'], true)) { return self::STATUS_COMPLETED; - } elseif (in_array($status, 'PENDING')) { + } elseif (in_array($status, ['PENDING'])) { return self::STATUS_PENDING; } elseif (in_array($status, ['CANCELLED', 'REJECTED'])) { return self::STATUS_FAILED; } throw new InvalidRequestException('We have received unknown status "' . $status . '"'); + } else { + throw new InvalidRequestException("PayU data is missing"); } } @@ -152,9 +153,11 @@ public function getTransactionStatus() * Response Message * * @return string A response message from the payment gateway + * @throws InvalidRequestException */ public function getMessage() { return $this->getData(); } + }