# paykeeper/2.2.4/class-block.php

PayKeeper Payment Gateway for WooCommerce, version 2.2.4. 89 lines.

- Page: https://pluginprobe.com/plugins/paykeeper/2.2.4/code/class-block.php
- Raw: https://pluginprobe.com/plugins/paykeeper/2.2.4/raw/class-block.php
- Modified: 2026-01-14T11:41:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/paykeeper/2.2.4/code/class-block.php#L10-L20`.

```php
<?php

if (!defined('ABSPATH')) {
    exit;
}

use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType;

/**
 * Paykeeper Payments Blocks integration
 *
 * @since 2.0.0
 */
final class WC_Paykeeper_Blocks extends AbstractPaymentMethodType {

    /**
     * The gateway instance.
     *
     * @var WC_PK_Gateway
     */
    private $gateway;

    /**
     * Payment method name/id/slug.
     *
     * @var string
     */
    protected $name = 'paykeeper';

    /**
     * Initializes the payment method type.
     */
    public function initialize() {
        $this->settings = get_option( 'woocommerce_' . $this->name . '_settings', [] );
        $gateways       = WC()->payment_gateways->payment_gateways();
        $this->gateway  = $gateways[$this->name];
    }

    /**
     * Returns if this payment method should be active. If false, the scripts will not be enqueued.
     *
     * @return boolean
     */
    public function is_active() {
        return $this->gateway->is_available();
    }

    /**
     * Returns an array of scripts/handles to be registered for this payment method.
     *
     * @return array
     */
    public function get_payment_method_script_handles() {

        wp_register_script(
            'paykeeper-blocks-integration',
            plugin_dir_url(__FILE__) . 'checkout.js',
            [
                'wc-blocks-registry',
                'wc-settings',
                'wp-element',
                'wp-html-entities',
                'wp-i18n',
            ],
            null,
            true
        );
        if( function_exists( 'wp_set_script_translations' ) ) {
            wp_set_script_translations( 'paykeeper-blocks-integration');

        }
        return [ 'paykeeper-blocks-integration' ];
    }

    /**
     * Returns an array of key=>value pairs of data made available to the payment methods script.
     *
     * @return array
     */
    public function get_payment_method_data() {
        return [
            'title' => $this->gateway->title,
            'description' => $this->gateway->description,
            'supports'    => array_filter( $this->gateway->supports, [ $this->gateway, 'supports' ] )
        ];
    }

}
?>
```
