2018-04-03 16:09:09 +00:00
|
|
|
<?php
|
2019-12-04 18:52:20 +00:00
|
|
|
/**
|
|
|
|
* Class WC_Mock_Payment_Gateway
|
|
|
|
*
|
|
|
|
* @package WooCommerce\Tests\Framework
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class WC_Mock_Payment_Gateway
|
|
|
|
*/
|
2018-04-03 16:09:09 +00:00
|
|
|
class WC_Mock_Payment_Gateway extends WC_Payment_Gateway {
|
|
|
|
/**
|
|
|
|
* Constructor for the gateway.
|
|
|
|
*/
|
|
|
|
public function __construct() {
|
2019-11-07 20:23:19 +00:00
|
|
|
$this->enabled = 'yes';
|
2018-04-03 16:09:09 +00:00
|
|
|
$this->id = 'mock';
|
|
|
|
$this->has_fields = false;
|
|
|
|
$this->order_button_text = __( 'Proceed to PayPal', 'woocommerce' );
|
|
|
|
$this->method_title = 'Mock Gateway';
|
|
|
|
$this->method_description = 'Mock Gateway for unit tests';
|
2019-11-07 20:23:19 +00:00
|
|
|
$this->pay_button_id = 'mock-pay-button';
|
2018-04-03 16:09:09 +00:00
|
|
|
$this->supports = array(
|
|
|
|
'products',
|
2019-11-07 20:23:19 +00:00
|
|
|
'pay_button',
|
2018-04-03 16:09:09 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// Load the settings.
|
|
|
|
$this->init_form_fields();
|
|
|
|
$this->init_settings();
|
|
|
|
}
|
2019-11-07 20:23:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialise Gateway Settings Form Fields.
|
|
|
|
*/
|
|
|
|
public function init_form_fields() {
|
|
|
|
$this->form_fields = array(
|
|
|
|
'enabled' => array(
|
|
|
|
'title' => '',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'label' => '',
|
|
|
|
'default' => 'yes',
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2018-04-03 16:09:09 +00:00
|
|
|
}
|
|
|
|
|