<?php

/**
 * Free Showcase MailChimp Integration Class
 */

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

if( ! class_exists( 'GA_MailChimp_Dummy' ) ) {
    class GA_MailChimp_Dummy extends GA_Integration {

        /**
         * Active Indicator
         * @var boolean
         */
        public $active = false;

        /**
         * Integration Image
         * @var string
         */
        public $image = '';

        /**
         * Integration Title
         * @var string
         */
        public $title = '';

        /**
         * Integration Description
         * @var string
         */
        public $desc = '';

        /**
         * API URL
         * @var string
         */
        private $api_url = 'https://<dc>.api.mailchimp.com/3.0';

        /**
         * API Key
         * @var string
         */
        private $api_key = '';

        /**
         * Request URL
         * @var string
         */
        private $request_url = '';

        /**
         * Request Arguments
         * @var array
         */
        private $request_args = array(); 

        /**
         * Metabox
         * @var boolean
         */
        private $metabox = false;

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

            $this->title = __( 'MailChimp', 'giveasap' );
            $this->settings_id = 'ga_mailchimp';
            $this->image = untrailingslashit( GASAP_URI ) . '/includes/integrations/assets/mailchimp.svg';
            $this->desc = __( 'Sends users to your list and grow your email list', 'giveasap' );
        }
        
        public function buttons( $integrations ) {
            echo '<a href="' . giv_fs()->get_upgrade_url() . '" class="button button-primary">' . __( 'Upgrade to PRO', 'giveasap' ) . '</a>';
        }
        
    }

    add_filter( 'giveasap_integrations', 'giveasap_mailchimp' );

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

        $integrations['ga_mailchimp'] = 'GA_MailChimp_Dummy';

        return $integrations;
    }
}