claudiosmweb/woocommerce-mercadopago — pull request #2 by daigo75 (2013-11-03 11:08:40+00:00)
Title: Moved checks to ensure that gateway is valid for use to a later stage

Originally, checks were performed during class initialisation. This was premature, for two reasons:

- Original check was setting "enabled" to false if plugin was not configured correctly. However, "enabled" and "usable" are two different concepts. When a gateway is enabled, it's enabled even when it's misconfigured.
- WooCommerce checks if a gateway is usable by calling `WC_MercadoPago_Gateway::is_available()` method. That's when it's important to verify that settings are correct, for it means that the gateway could be used for payment. The extra checks have been moved to the such method.

**Note**: the modification will still ensure that the gateway cannot be used if it's not configured properly, it will just make the value of "enabled" independent from the settings.