/**
  * Append Omise Settings panel to My Account page
  */
 public function init_panel()
 {
     if (!empty($this->omise_customer_id)) {
         $cards = Omise::get_customer_cards($this->private_key, $this->omise_customer_id);
         $viewData["existingCards"] = $cards;
         Omise_Util::render_view('includes/templates/omise-myaccount-panel.php', $viewData);
         $this->register_omise_my_account_scripts();
     }
 }
 /**
  * Payment fields which will be rendered on checkout page
  * @see WC_Payment_Gateway::payment_fields()
  */
 function payment_fields()
 {
     if (is_user_logged_in()) {
         $viewData["user_logged_in"] = true;
         $current_user = wp_get_current_user();
         $omise_customer_id = $this->sandbox ? $current_user->test_omise_customer_id : $current_user->live_omise_customer_id;
         if (!empty($omise_customer_id)) {
             $cards = Omise::get_customer_cards($this->private_key, $omise_customer_id);
             $viewData["existingCards"] = $cards;
         }
     }
     Omise_Util::render_view('includes/templates/omise-payment-form.php', $viewData);
 }