Skip to content

Commit 8b9f038

Browse files
Nico Oelgartbarryvdh
authored andcommitted
Add supportsFetchTransaction, fetchTransaction, and acceptNotification methods (#190)
* Add optional acceptNotification and fetchTransaction methods * Add supportsFetchTransaction method
1 parent cfc526d commit 8b9f038

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

src/Common/AbstractGateway.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ public function supportsCompletePurchase()
195195
return method_exists($this, 'completePurchase');
196196
}
197197

198+
/**
199+
* Supports Fetch Transaction
200+
*
201+
* @return boolean True if this gateway supports the fetchTransaction() method
202+
*/
203+
public function supportsFetchTransaction()
204+
{
205+
return method_exists($this, 'fetchTransaction');
206+
}
207+
198208
/**
199209
* Supports Refund
200210
*

src/Common/GatewayInterface.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,31 @@
1313
*
1414
* @see AbstractGateway
1515
*
16-
* @method \Omnipay\Common\Message\RequestInterface authorize(array $options = array()) (Optional method)
16+
* @method \Omnipay\Common\Message\NotificationInterface acceptNotification(array $options = array()) (Optional method)
17+
* Receive and handle an instant payment notification (IPN)
18+
* @method \Omnipay\Common\Message\RequestInterface authorize(array $options = array()) (Optional method)
1719
* Authorize an amount on the customers card
18-
* @method \Omnipay\Common\Message\RequestInterface completeAuthorize(array $options = array()) (Optional method)
20+
* @method \Omnipay\Common\Message\RequestInterface completeAuthorize(array $options = array()) (Optional method)
1921
* Handle return from off-site gateways after authorization
20-
* @method \Omnipay\Common\Message\RequestInterface capture(array $options = array()) (Optional method)
22+
* @method \Omnipay\Common\Message\RequestInterface capture(array $options = array()) (Optional method)
2123
* Capture an amount you have previously authorized
22-
* @method \Omnipay\Common\Message\RequestInterface purchase(array $options = array()) (Optional method)
24+
* @method \Omnipay\Common\Message\RequestInterface purchase(array $options = array()) (Optional method)
2325
* Authorize and immediately capture an amount on the customers card
24-
* @method \Omnipay\Common\Message\RequestInterface completePurchase(array $options = array()) (Optional method)
26+
* @method \Omnipay\Common\Message\RequestInterface completePurchase(array $options = array()) (Optional method)
2527
* Handle return from off-site gateways after purchase
26-
* @method \Omnipay\Common\Message\RequestInterface refund(array $options = array()) (Optional method)
28+
* @method \Omnipay\Common\Message\RequestInterface refund(array $options = array()) (Optional method)
2729
* Refund an already processed transaction
28-
* @method \Omnipay\Common\Message\RequestInterface void(array $options = array()) (Optional method)
30+
* @method \Omnipay\Common\Message\RequestInterface fetchTransaction(array $options = []) (Optional method)
31+
* Fetches transaction information
32+
* @method \Omnipay\Common\Message\RequestInterface void(array $options = array()) (Optional method)
2933
* Generally can only be called up to 24 hours after submitting a transaction
30-
* @method \Omnipay\Common\Message\RequestInterface createCard(array $options = array()) (Optional method)
34+
* @method \Omnipay\Common\Message\RequestInterface createCard(array $options = array()) (Optional method)
3135
* The returned response object includes a cardReference, which can be used for future transactions
32-
* @method \Omnipay\Common\Message\RequestInterface updateCard(array $options = array()) (Optional method)
36+
* @method \Omnipay\Common\Message\RequestInterface updateCard(array $options = array()) (Optional method)
3337
* Update a stored card
34-
* @method \Omnipay\Common\Message\RequestInterface deleteCard(array $options = array()) (Optional method)
38+
* @method \Omnipay\Common\Message\RequestInterface deleteCard(array $options = array()) (Optional method)
3539
* Delete a stored card
36-
*/
40+
*/
3741
interface GatewayInterface
3842
{
3943
/**

tests/Omnipay/Common/AbstractGatewayTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ public function testSupportsCompletePurchase()
109109
$this->assertFalse($this->gateway->supportsCompletePurchase());
110110
}
111111

112+
public function testSupportsFetchTransaction()
113+
{
114+
$this->assertFalse($this->gateway->supportsFetchTransaction());
115+
}
116+
112117
public function testSupportsRefund()
113118
{
114119
$this->assertFalse($this->gateway->supportsRefund());

0 commit comments

Comments
 (0)