diff --git a/src/Omnipay/WorldpayCGHosted/Message/Notification.php b/src/Omnipay/WorldpayCGHosted/Message/Notification.php index 492f939..bcc1689 100644 --- a/src/Omnipay/WorldpayCGHosted/Message/Notification.php +++ b/src/Omnipay/WorldpayCGHosted/Message/Notification.php @@ -155,10 +155,10 @@ private function originIsValid() return false; } - $expectedEnd = 'worldpay.com'; // todo fix me + $expectedEnd = '.worldpay.com'; $expectedPosition = strlen($hostname) - strlen($expectedEnd); - if (strpos($hostname, $expectedEnd) === $expectedPosition) { + if (strpos($hostname, $expectedEnd) === $expectedPosition || $hostname === 'worldpay.com') { return true; }