This commit is contained in:
David Remer 2020-07-10 12:34:29 +03:00
parent cdfb405fe4
commit 563488e727
3 changed files with 8 additions and 7 deletions

View file

@ -72,7 +72,9 @@ class WcGateway extends \WC_Payment_Gateway
);
}
public function needs_setup() {
public function needs_setup()
{
return true;
}

View file

@ -58,14 +58,14 @@ class WcGatewayModule implements ModuleInterface
add_action(
'wp_ajax_woocommerce_toggle_gateway_enabled',
function() use ($container) {
static function () use ($container) {
if (
! current_user_can( 'manage_woocommerce' )
! current_user_can('manage_woocommerce')
|| ! check_ajax_referer(
'woocommerce-toggle-payment-gateway-enabled',
'security'
)
|| ! isset( $_POST['gateway_id'] )
|| ! isset($_POST['gateway_id'])
) {
return;
}
@ -85,11 +85,10 @@ class WcGatewayModule implements ModuleInterface
);
add_action(
'woocommerce-paypal-commerce-gateway.deactivate',
function() use ($container) {
static function () use ($container) {
delete_option(Settings::KEY);
}
);
}
private function registerPaymentGateWay(ContainerInterface $container)