mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Implement AXO settings
This commit is contained in:
parent
91b2df246f
commit
e71c34913f
3 changed files with 30 additions and 3 deletions
|
@ -36,8 +36,12 @@ class AxoModule implements ModuleInterface {
|
||||||
|
|
||||||
add_filter(
|
add_filter(
|
||||||
'woocommerce_payment_gateways',
|
'woocommerce_payment_gateways',
|
||||||
function ( $methods ): array {
|
function ( $methods ) use ( $c ): array {
|
||||||
$methods[] = new AxoGateway();
|
$settings = $c->get( 'wcgateway.settings' );
|
||||||
|
|
||||||
|
$methods[] = new AxoGateway(
|
||||||
|
$settings
|
||||||
|
);
|
||||||
return $methods;
|
return $methods;
|
||||||
},
|
},
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
||||||
namespace WooCommerce\PayPalCommerce\Axo\Gateway;
|
namespace WooCommerce\PayPalCommerce\Axo\Gateway;
|
||||||
|
|
||||||
use WC_Payment_Gateway;
|
use WC_Payment_Gateway;
|
||||||
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AXOGateway.
|
* Class AXOGateway.
|
||||||
|
@ -18,11 +19,23 @@ class AxoGateway extends WC_Payment_Gateway {
|
||||||
|
|
||||||
const ID = 'ppcp-axo-gateway';
|
const ID = 'ppcp-axo-gateway';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The settings.
|
||||||
|
*
|
||||||
|
* @var ContainerInterface
|
||||||
|
*/
|
||||||
|
protected $config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AXOGateway constructor.
|
* AXOGateway constructor.
|
||||||
|
*
|
||||||
|
* @param ContainerInterface $config The settings.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
ContainerInterface $config
|
||||||
) {
|
) {
|
||||||
|
$this->config = $config;
|
||||||
|
|
||||||
$this->id = self::ID;
|
$this->id = self::ID;
|
||||||
|
|
||||||
$this->method_title = __( 'Fastlane Debit & Credit Cards', 'woocommerce-paypal-payments' );
|
$this->method_title = __( 'Fastlane Debit & Credit Cards', 'woocommerce-paypal-payments' );
|
||||||
|
@ -51,7 +64,8 @@ class AxoGateway extends WC_Payment_Gateway {
|
||||||
// $this->icon = esc_url( $this->module_url ) . 'assets/images/axo.svg'; // TODO
|
// $this->icon = esc_url( $this->module_url ) . 'assets/images/axo.svg'; // TODO
|
||||||
// $this->environment = $environment;
|
// $this->environment = $environment;
|
||||||
|
|
||||||
$this->update_option( 'enabled', 'yes' ); // TODO : depend on settings
|
$is_axo_enabled = $this->config->has( 'axo_enabled' ) && $this->config->get( 'axo_enabled' );
|
||||||
|
$this->update_option( 'enabled', $is_axo_enabled ? 'yes' : 'no' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -39,3 +39,12 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ppcp-field-indent {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border: 1px solid #c3c4c7;
|
||||||
|
|
||||||
|
& + .ppcp-field-indent {
|
||||||
|
border-top: 2px solid transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue