title: Custom WooCommerce payment gateway not showing up
body: <p>I created a custom WooCommerce 3.0 payment gateway to process credit cards:</p>
  
  <pre><code>add_action('plugins_loaded', 'wc_custom_gateway_init');
  
  function wc_custom_gateway_init()
  {
      /**
       * custom Payment Gateway
       *
       * @class WC_Gateway_custom
       * @extends WC_Payment_Gateway
       * @version 1.0.0
       * @package WooCommerce/Classes/Payment
       */
      class WC_Gateway_custom extends WC_Payment_Gateway
      {
          public function __construct()
          {
              $this-&gt;id = 'custom';
              $this-&gt;icon = null;
              $this-&gt;has_fields = true;
              $this-&gt;method_title = 'custom';
              $this-&gt;method_description = 'custom payment gateway';
  
              $this-&gt;init_form_fields();
              $this-&gt;init_settings();
          }
  
          /**
           * Initialize Gateway Settings Form Fields
           */
          public function init_form_fields()
          {
              $this-&gt;form_fields = [
                  'enabled'      =&gt; [
                      'title'   =&gt; __('Enable/Disable', 'wc-gateway-custom'),
                      'type'    =&gt; 'checkbox',
                      'label'   =&gt; __('Enable custom Payment', 'wc-gateway-custom'),
                      'default' =&gt; 'yes'
                  ],
                  // This controls the title for the payment method the customer sees during checkout.
                  'title'        =&gt; [
                      'title'       =&gt; __('Title', 'wc-gateway-custom'),
                      'type'        =&gt; 'text',
                      'description' =&gt; __('Credit Card', 'wc-gateway-custom'),
                      'default'     =&gt; __('Credit Card', 'wc-gateway-custom'),
                      'desc_tip'    =&gt; true,
                  ],
                  // Payment method description that the customer will see on your checkout.
                  'description'  =&gt; [
                      'title'       =&gt; __('Description', 'wc-gateway-custom'),
                      'type'        =&gt; 'textarea',
                      'description' =&gt; __('Credit Card', 'wc-gateway-custom'),
                      'default'     =&gt; __('Credit Card', 'wc-gateway-custom'),
                      'desc_tip'    =&gt; true,
                  ],
                  // Instructions that will be added to the thank you page and emails.
                  'instructions' =&gt; [
                      'title'       =&gt; __('Instructions', 'wc-gateway-custom'),
                      'type'        =&gt; 'textarea',
                      'description' =&gt; __('', 'wc-gateway-custom'),
                      'default'     =&gt; '',
                      'desc_tip'    =&gt; true,
                  ],
              ];
          }
  
          /**
           * @param int $order_id
           *
           * @return array|null
           */
          public function process_payment($order_id)
          {
              $order = wc_get_order($order_id);
  
              // ... API call and various validation logic...
  
              // Remove cart
              WC()-&gt;cart-&gt;empty_cart();
  
              return [
                  'result'   =&gt; 'success',
                  'redirect' =&gt; $this-&gt;get_return_url($order)
              ];
          }
      }
  
      /**
       * Add the gateway to the WC list.
       *
       * @param array $gateways
       *
       * @return array
       */
      function wc_custom_add_to_gateways($gateways)
      {
          $gateways[] = 'WC_Gateway_custom';
  
          return $gateways;
      }
  
      add_filter('woocommerce_payment_gateways', 'wc_custom_add_to_gateways');
  }
  </code></pre>
  
  <p>However, the custom gateway never shows up in the list of gateways on the WC settings page.</p>
  
  <p><a href="https://i.stack.imgur.com/YlzhF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YlzhF.png" alt="enter image description here"></a></p>
  
  <p>What step am I missing here?</p>