settings = get_option('twentybytes_payment_gateway_settings', []); $this->gateway = new TWENTYBYTES_Payment_Gateway(); } public function is_active() { return $this->gateway->is_available(); } public function get_payment_method_script_handles() { $script_path = plugins_url('../assets/js/checkout.js', __FILE__); $script_asset_path = dirname(__FILE__) . '/../assets/js/checkout.php'; $script_asset = file_exists($script_asset_path) ? require($script_asset_path) : array('dependencies' => array(), 'version' => filemtime($script_path)); wp_register_script( 'twentybytes-payment-gateway-blocks-integration', $script_path, array_merge($script_asset['dependencies'], [ 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n', ]), $script_asset['version'], true ); if (function_exists('wp_set_script_translations')) { wp_set_script_translations( 'twentybytes-payment-gateway-blocks-integration', '20bytes-payment' ); } return ['twentybytes-payment-gateway-blocks-integration']; } public function get_payment_method_data() { return [ 'name' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, 'plugin_url' => plugin_dir_url(dirname(__FILE__)), 'supports' => $this->gateway->supports, 'icon' => plugin_dir_url(dirname(__FILE__)) . 'assets/images/Icon_20bytes.png' ]; } }