woothemes/woocommerce — pull request #1069 by thenbrent (2012-05-22 01:12:25+00:00)
Title: Adding Support Check Function to WC_Payment_Gateway

The `WC_Payment_Gateway::is_supported()` function makes it possible for gateways to register support for certain features that other extensions may require.

For backward compatibility, gateways support 'products' by default, but nothing else. The only other feature I've tested for in core is `'subscriptions'`. Gateways extending the `WC_Payment_Gateway` can add other features as required.

An example of the extended version of this function for a gateway that supports more advanced subscription features, as well as product feature would be:

```php
function is_supported( $feature ) {
switch ( $feature ) {
case 'subscriptions' :
$is_supported = true;
break;
case 'subscription_cancellation' :
$is_supported = true;
break;
default :
$is_supported = parent::is_supported( $feature );
break;
}

return $is_supported;
}
````