<?php
use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType;

final class WC_Cybersource_Hosted_Blocks extends AbstractPaymentMethodType {

    private $gateway;
    protected $name = 'cybsawm';// your payment gateway name

    public function initialize() {
        $this->settings = get_option( 'woocommerce_cybsawm_settings', [] );
        $this->gateway = new WC_Cybersource_Hosted_Blocks();
    }

    public function is_active() {
        return ! empty( $this->settings[ 'enabled' ] ) && 'yes' === $this->settings[ 'enabled' ];        
    }

    public function get_payment_method_script_handles() {

        wp_register_script(
            'wc-cybersource-blocks-integration',
            plugin_dir_url(__FILE__) . 'block/checkout.js',
            [
                'wc-blocks-registry',
                'wc-settings',
                'wp-element',
                'wp-html-entities',
                'wp-i18n',
            ],
            null,
            true
        );
       
        return [ 'wc-cybersource-blocks-integration' ];
    }

    public function get_payment_method_data() {
        return [
            'title' => $this->get_setting( 'title' ),
            'description' => $this->get_setting( 'description' ),
        ];
    }

}