Skip to content

Commit e954e51

Browse files
Annotations for optional methods on GatewayInterface
This should help IDE's with code completion and suggestions on the gateway methods and return values (which doesn't work very well at the moment). I understand that these methods are optional - so this may not be the right way to address this issue. My personal opinion is that documenting the method as optional in the annotation is better than not documenting it all. There are also lots of methods in the AbstractGateway that I think should be included in the GatewayInterface (supportsAuthorize, supportsCompleteAuthorize, supportsCapture, etc...). I wanted to know peoples thoughts on this before I spent the time on a PR.
1 parent 0cd3186 commit e954e51

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Omnipay/Common/GatewayInterface.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
* Omnipay gateway needs to define.
1313
*
1414
* @see AbstractGateway
15+
*
16+
* @method \Omnipay\Common\Message\ResponseInterface authorize(array $options = array()) (Optional method) Authorize an amount on the customers card
17+
* @method \Omnipay\Common\Message\ResponseInterface completeAuthorize(array $options = array()) (Optional method) Handle return from off-site gateways after authorization
18+
* @method \Omnipay\Common\Message\ResponseInterface capture(array $options = array()) (Optional method) Capture an amount you have previously authorized
19+
* @method \Omnipay\Common\Message\ResponseInterface purchase(array $options = array()) (Optional method) Authorize and immediately capture an amount on the customers card
20+
* @method \Omnipay\Common\Message\ResponseInterface completePurchase(array $options = array()) (Optional method) Handle return from off-site gateways after purchase
21+
* @method \Omnipay\Common\Message\ResponseInterface refund(array $options = array()) (Optional method) Refund an already processed transaction
22+
* @method \Omnipay\Common\Message\ResponseInterface void(array $options = array()) (Optional method) Generally can only be called up to 24 hours after submitting a transaction
23+
* @method \Omnipay\Common\Message\ResponseInterface createCard(array $options = array()) (Optional method) The returned response object includes a cardReference, which can be used for future transactions
24+
* @method \Omnipay\Common\Message\ResponseInterface updateCard(array $options = array()) (Optional method) Update a stored card
25+
* @method \Omnipay\Common\Message\ResponseInterface deleteCard(array $options = array()) (Optional method) Delete a stored card
1526
*/
1627
interface GatewayInterface
1728
{

0 commit comments

Comments
 (0)