Skip to content

Commit

Permalink
Fix for Notification message, in_array expects array as 2nd arg
Browse files Browse the repository at this point in the history
  • Loading branch information
jspetrak committed Aug 8, 2020
1 parent 90d8bf6 commit 7c098d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Messages/Notification.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace Omnipay\PayU\Messages;


use Guzzle\Http\Client;
use Guzzle\Http\ClientInterface;
use Omnipay\Common\Exception\InvalidRequestException;
Expand Down Expand Up @@ -77,6 +75,7 @@ public function __construct($httpRequest, $httpClient, $secondKey)
* Gateway Reference
*
* @return string A reference provided by the gateway to represent this transaction
* @throws InvalidRequestException
*/
public function getTransactionReference()
{
Expand Down Expand Up @@ -139,22 +138,26 @@ public function getTransactionStatus()
$status = $this->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");
}
}

/**
* Response Message
*
* @return string A response message from the payment gateway
* @throws InvalidRequestException
*/
public function getMessage()
{
return $this->getData();
}

}

0 comments on commit 7c098d9

Please sign in to comment.