From a90163fd7fdd636af34ec89fe58078be1e701506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergej=20Ko=C5=A1=C4=8Dejev?= Date: Sun, 30 Aug 2015 17:49:17 +0200 Subject: [PATCH 1/2] Add interfaces for incoming notifications --- src/Omnipay/Common/AbstractGateway.php | 10 ++++++ .../Common/Message/NotificationInterface.php | 34 +++++++++++++++++++ tests/Omnipay/Common/AbstractGatewayTest.php | 5 +++ 3 files changed, 49 insertions(+) mode change 100644 => 100755 src/Omnipay/Common/AbstractGateway.php create mode 100644 src/Omnipay/Common/Message/NotificationInterface.php mode change 100644 => 100755 tests/Omnipay/Common/AbstractGatewayTest.php diff --git a/src/Omnipay/Common/AbstractGateway.php b/src/Omnipay/Common/AbstractGateway.php old mode 100644 new mode 100755 index 4e13e725..97014a0f --- a/src/Omnipay/Common/AbstractGateway.php +++ b/src/Omnipay/Common/AbstractGateway.php @@ -247,6 +247,16 @@ public function supportsVoid() return method_exists($this, 'void'); } + /** + * Supports AcceptNotification + * + * @return boolean True if this gateway supports the acceptNotification() method + */ + public function supportsAcceptNotification() + { + return method_exists($this, 'acceptNotification'); + } + /** * Supports CreateCard * diff --git a/src/Omnipay/Common/Message/NotificationInterface.php b/src/Omnipay/Common/Message/NotificationInterface.php new file mode 100644 index 00000000..ea7637fa --- /dev/null +++ b/src/Omnipay/Common/Message/NotificationInterface.php @@ -0,0 +1,34 @@ +assertFalse($this->gateway->supportsUpdateCard()); } + public function testSupportsAcceptNotification() + { + $this->assertFalse($this->gateway->supportsAcceptNotification()); + } + public function testCreateRequest() { $this->gateway = new AbstractGatewayTest_MockAbstractGateway; From 0b72bb12ce33ccac052095c7934a5f46bb6dca1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergej=20Ko=C5=A1=C4=8Dejev?= Date: Wed, 2 Sep 2015 14:55:19 +0200 Subject: [PATCH 2/2] Split a long line --- src/Omnipay/Common/Message/NotificationInterface.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/Omnipay/Common/Message/NotificationInterface.php diff --git a/src/Omnipay/Common/Message/NotificationInterface.php b/src/Omnipay/Common/Message/NotificationInterface.php old mode 100644 new mode 100755 index ea7637fa..14d53a90 --- a/src/Omnipay/Common/Message/NotificationInterface.php +++ b/src/Omnipay/Common/Message/NotificationInterface.php @@ -21,7 +21,8 @@ public function getTransactionReference(); /** * Was the transaction successful? * - * @return string Transaction status, one of {@see STATUS_COMPLETED}, {@see #STATUS_PENDING}, or {@see #STATUS_FAILED}. + * @return string Transaction status, one of {@see STATUS_COMPLETED}, {@see #STATUS_PENDING}, + * or {@see #STATUS_FAILED}. */ public function getTransactionStatus();