<?php
/**
 * Plugin Name: Easy Digital Downloads - Check Payment Gateway
 * Plugin URL: https://easydigitaldownloads.com/downloads/check-payment-gateway/
 * Description: Adds a payment gateway for accepting manual payments through hand-written checks.
 * Version: 1.3.5
 * Requires at least: 5.4
 * Requires PHP: 7.1
 * Author: Easy Digital Downloads
 * Author URI: https://easydigitaldownloads.com
 * Text Domain: eddcg
 * Domain Path: languages
*/

if ( ! defined( 'EDDCG_PLUGIN_DIR' ) ) {
	define( 'EDDCG_PLUGIN_DIR', __DIR__ );
}

/**
 * Load the gateway functions.
 *
 * @since 1.3.5
 * @return void
 */
function edd_checks_gateway_load() {
	require_once EDDCG_PLUGIN_DIR . '/includes/functions.php';
	if ( is_admin() ) {
		require_once EDDCG_PLUGIN_DIR . '/includes/functions-admin.php';
	}

	add_action( 'init', 'edd_textdomain' );

	add_action(
		'edd_extension_license_init',
		function ( \EDD\Extensions\ExtensionRegistry $registry ) {
			$registry->addExtension( __FILE__, 'Check Payment Gateway', 1873, '1.3.5' );
		}
	);

	if ( class_exists( '\\EDD\\Emails\\Email' ) ) {
		new \EDD\ChecksGateway\Emails\Registry();
	}
}

/**
 * Internationalization
 *
 * @access      public
 * @since       1.2
 * @return      void
 */
function edd_textdomain() {
	load_plugin_textdomain( 'eddcg', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}

require_once __DIR__ . '/vendor/autoload.php';
\EDD\ExtensionUtils\v1\ExtensionLoader::loadOrQuit(
	__FILE__,
	'edd_checks_gateway_load',
	array(
		'php'                    => '7.1',
		'wp'                     => '5.4',
		'easy-digital-downloads' => '3.1.5',
	)
);
