/**
  * Constructor
  */
 public function __construct()
 {
     include_once 'includes/class-wc-amazon-payments-advanced-api.php';
     $this->settings = WC_Amazon_Payments_Advanced_API::get_settings();
     $this->reference_id = WC_Amazon_Payments_Advanced_API::get_reference_id();
     $this->access_token = WC_Amazon_Payments_Advanced_API::get_access_token();
     add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_links'));
     add_action('init', array($this, 'init_gateway'));
     add_action('wp_loaded', array($this, 'init_handlers'), 11);
     add_action('wp_footer', array($this, 'maybe_hide_standard_checkout_button'));
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     $this->method_title = 'Amazon Payments Advanced';
     $this->id = 'amazon_payments_advanced';
     $this->icon = apply_filters('woocommerce_amazon_pa_logo', plugins_url('assets/images/amazon-payments.gif', plugin_dir_path(__FILE__)));
     $this->debug = 'yes' === $this->get_option('debug');
     // Load the form fields
     $this->init_form_fields();
     // Load the settings
     $this->init_settings();
     // Load salved settings
     $this->load_settings();
     // Get Order Refererence ID and/or Access Token
     $this->reference_id = WC_Amazon_Payments_Advanced_API::get_reference_id();
     $this->access_token = WC_Amazon_Payments_Advanced_API::get_access_token();
     // Handling for the review page of the German Market Plugin
     if (empty($this->reference_id)) {
         if (isset($_SESSION['first_checkout_post_array']['amazon_reference_id'])) {
             $this->reference_id = $_SESSION['first_checkout_post_array']['amazon_reference_id'];
         }
     }
     add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
     add_action('woocommerce_checkout_update_order_review', array($this, 'store_shipping_info_in_session'));
 }