function mini_cart_button()
        {
            global $pp_settings, $pp_pro, $pp_payflow;
            if (@$pp_settings['enabled'] == 'yes' && (empty($pp_settings['show_on_cart']) || $pp_settings['show_on_cart'] == 'yes') && WC()->cart->cart_contents_count > 0) {
                echo '<div class="paypal_box_button" style="position: relative;">';
                if (empty($pp_settings['checkout_with_pp_button_type'])) {
                    $pp_settings['checkout_with_pp_button_type'] = 'paypalimage';
                }
                switch ($pp_settings['checkout_with_pp_button_type']) {
                    case "textbutton":
                        if (!empty($pp_settings['pp_button_type_text_button'])) {
                            $button_text = $pp_settings['pp_button_type_text_button'];
                        } else {
                            $button_text = __('Proceed to Checkout', 'woocommerce');
                        }
                        echo '<a class="paypal_checkout_button button alt" href="' . esc_url(add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/')))) . '">' . $button_text . '</a>';
                        break;
                    case "paypalimage":
                        echo '<div id="paypal_ec_button">';
                        echo '<a class="paypal_checkout_button" href="' . esc_url(add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/')))) . '">';
                        echo "<img src='https://www.paypal.com/" . WC_Gateway_PayPal_Express_AngellEYE::get_button_locale_code() . "/i/btn/btn_xpressCheckout.gif' border='0' alt='" . __('Pay with PayPal', 'paypal-for-woocommerce') . "'/>";
                        echo "</a>";
                        echo '</div>';
                        break;
                    case "customimage":
                        $button_img = $pp_settings['pp_button_type_my_custom'];
                        echo '<div id="paypal_ec_button">';
                        echo '<a class="paypal_checkout_button" href="' . esc_url(add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/')))) . '">';
                        echo "<img src='{$button_img}' width='150' border='0' alt='" . __('Pay with PayPal', 'paypal-for-woocommerce') . "'/>";
                        echo "</a>";
                        echo '</div>';
                        break;
                }
                /**
                 * Displays the PayPal Credit checkout button if enabled in EC settings.
                 */
                if (isset($pp_settings['show_paypal_credit']) && $pp_settings['show_paypal_credit'] == 'yes') {
                    // PayPal Credit button
                    $paypal_credit_button_markup = '<div id="paypal_ec_paypal_credit_button">';
                    $paypal_credit_button_markup .= '<a class="paypal_checkout_button" href="' . esc_url(add_query_arg('use_paypal_credit', 'true', add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/'))))) . '" >';
                    $paypal_credit_button_markup .= "<img src='https://www.paypalobjects.com/webstatic/en_US/i/buttons/ppcredit-logo-small.png' alt='Check out with PayPal Credit'/>";
                    $paypal_credit_button_markup .= '</a>';
                    $paypal_credit_button_markup .= '</div>';
                    echo $paypal_credit_button_markup;
                }
                ?>
                <div class="blockUI blockOverlay angelleyeOverlay" style="display:none;z-index: 1000; border: none; margin: 0px; padding: 0px; width: 100%; height: 100%; top: 0px; left: 0px; opacity: 0.6; cursor: default; position: absolute; background: url(<?php 
                echo WC()->plugin_url();
                ?>
/assets/images/ajax-loader@2x.gif) 50% 50% / 16px 16px no-repeat rgb(255, 255, 255);"></div>
                <script type="text/javascript">
                    jQuery(document).ready(function($){
                        $(".paypal_checkout_button").click(function(){
                            $(".angelleyeOverlay").show();
                            return true;
                        });
                    });
                </script>
                <?php 
                echo "<div class='clear'></div></div>";
            }
        }
    /**
     * Checkout Button
     *
     * Triggered from the 'woocommerce_proceed_to_checkout' action.
     * Displays the PayPal Express button.
     */
    static function woocommerce_paypal_express_checkout_button_angelleye()
    {
        global $pp_settings, $pp_pro, $pp_payflow;
        $payment_gateways = WC()->payment_gateways->get_available_payment_gateways();
        // Pay with Credit Card
        unset($payment_gateways['paypal_pro']);
        unset($payment_gateways['paypal_pro_payflow']);
        echo '<div class="clear"></div>';
        /**
         * Show the paypal express checkout button in cart page when express checkout is enabled and cart total > 0
         * If show_on_cart is empty so it's value default to yes
         */
        if (@$pp_settings['enabled'] == 'yes' && (empty($pp_settings['show_on_cart']) || $pp_settings['show_on_cart'] == 'yes') && 0 < WC()->cart->total) {
            echo '<div class="paypal_box_button" style="position: relative;">';
            if (empty($pp_settings['checkout_with_pp_button_type'])) {
                $pp_settings['checkout_with_pp_button_type'] = 'paypalimage';
            }
            $angelleyeOverlay = '<div class="blockUI blockOverlay angelleyeOverlay" style="display:none;z-index: 1000; border: none; margin: 0px; padding: 0px; width: 100%; height: 100%; top: 0px; left: 0px; opacity: 0.6; cursor: default; position: absolute; background: url(' . WC()->plugin_url() . '/assets/images/select2-spinner.gif) 50% 50% / 16px 16px no-repeat rgb(255, 255, 255);"></div>';
            switch ($pp_settings['checkout_with_pp_button_type']) {
                case "textbutton":
                    if (!empty($pp_settings['pp_button_type_text_button'])) {
                        $button_text = $pp_settings['pp_button_type_text_button'];
                    } else {
                        $button_text = __('Proceed to Checkout', 'woocommerce');
                    }
                    echo '<div class="paypal_ec_textbutton">';
                    echo '<a class="paypal_checkout_button button alt" href="' . esc_url(add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/')))) . '">' . $button_text . '</a>';
                    echo $angelleyeOverlay;
                    echo '</div>';
                    break;
                case "paypalimage":
                    echo '<div id="paypal_ec_button">';
                    echo '<a class="paypal_checkout_button" href="' . esc_url(add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/')))) . '">';
                    echo "<img src='https://www.paypal.com/" . WC_Gateway_PayPal_Express_AngellEYE::get_button_locale_code() . "/i/btn/btn_xpressCheckout.gif' border='0' alt='" . __('Pay with PayPal', 'paypal-for-woocommerce') . "'/>";
                    echo "</a>";
                    echo $angelleyeOverlay;
                    echo '</div>';
                    break;
                case "customimage":
                    $button_img = $pp_settings['pp_button_type_my_custom'];
                    echo '<div id="paypal_ec_button">';
                    echo '<a class="paypal_checkout_button" href="' . esc_url(add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/')))) . '">';
                    echo "<img src='{$button_img}' width='150' border='0' alt='" . __('Pay with PayPal', 'paypal-for-woocommerce') . "'/>";
                    echo "</a>";
                    echo $angelleyeOverlay;
                    echo '</div>';
                    break;
            }
            /**
             * Displays the PayPal Credit checkout button if enabled in EC settings.
             */
            if (isset($pp_settings['show_paypal_credit']) && $pp_settings['show_paypal_credit'] == 'yes') {
                // PayPal Credit button
                $paypal_credit_button_markup = '<div id="paypal_ec_paypal_credit_button">';
                $paypal_credit_button_markup .= '<a class="paypal_checkout_button" href="' . esc_url(add_query_arg('use_paypal_credit', 'true', add_query_arg('pp_action', 'expresscheckout', add_query_arg('wc-api', 'WC_Gateway_PayPal_Express_AngellEYE', home_url('/'))))) . '" >';
                $paypal_credit_button_markup .= "<img src='https://www.paypalobjects.com/webstatic/en_US/i/buttons/ppcredit-logo-small.png' alt='Check out with PayPal Credit'/>";
                $paypal_credit_button_markup .= '</a>';
                $paypal_credit_button_markup .= $angelleyeOverlay;
                $paypal_credit_button_markup .= '</div>';
                echo $paypal_credit_button_markup;
            }
            ?>
            <!--<div class="blockUI blockOverlay angelleyeOverlay" style="display:none;z-index: 1000; border: none; margin: 0px; padding: 0px; width: 100%; height: 100%; top: 0px; left: 0px; opacity: 0.6; cursor: default; position: absolute; background: url(<?php 
            /*echo WC()->plugin_url(); */
            ?>
/assets/images/select2-spinner.gif) 50% 50% / 16px 16px no-repeat rgb(255, 255, 255);"></div>-->
            <?php 
            echo "<div class='clear'></div></div>";
        }
    }
 /**
  * Review page for PayPal Express Checkout
  */
 function woocommerce_paypal_express_review_order_page_angelleye()
 {
     if (!empty($_GET['pp_action']) && $_GET['pp_action'] == 'revieworder') {
         $woocommerce_ppe = new WC_Gateway_PayPal_Express_AngellEYE();
         $woocommerce_ppe->paypal_express_checkout();
     }
 }