<?php

/**
 * Free Showcase EDD Integration Class
 */

namespace Simple_Giveaways;

if ( ! defined( 'ABSPATH' ) ) {
	return;
}

if ( ! class_exists( '\Simple_Giveaways\SG_EDD_Dummy' ) ) {
	class SG_EDD_Dummy extends GA_Integration {

		/**
		 * Get Categories
		 *
		 * @return string[]
		 */
		public function get_categories() {
			return [
				'ecommerce',
			];
		}

		/**
		 * Setting initial params
		 */
		public function __construct() {

			$this->title       = __( 'Easy Digital Downloads', 'giveasap' );
			$this->settings_id = 'sg_edd';
			$this->image       = untrailingslashit( GASAP_URI ) . '/includes/integrations/assets/edd.svg';
			$this->desc        = __( 'Award users for purchasing your products. Increase sales of your downloads.', 'giveasap' );
		}

		public function buttons( $integrations ) {
			echo '<a href="' . esc_url( giv_fs()->get_upgrade_url() ) . '" class="button button-primary">' . esc_html__( 'Upgrade to Business', 'giveasap' ) . '</a>';
		}

	}
}

add_filter( 'giveasap_integrations', '\Simple_Giveaways\sg_edd_integration' );

/**
 * Registering mailchimp
 *
 * @return array
 */
function sg_edd_integration( $integrations ) {

	$integrations['sg_edd'] = '\Simple_Giveaways\SG_EDD_Dummy';

	return $integrations;
}
