public function accountSavedCards()
 {
     if (!Securionpay4WC::allowSavedCards()) {
         return;
     }
     $customer = new SecurionpayCustomer(get_current_user_id());
     if (!$customer || !$customer->getCards()) {
         return;
     }
     $this->handleDeleteCard($customer);
     $data = array('cards' => $customer->getCards());
     Securionpay4WC::getTemplate('saved-cards.php', $data);
 }
 public function payment_fields()
 {
     $data = array('description' => $this->description, 'cards' => null, 'selectedCard' => null);
     if ($this->allowSavedCards()) {
         $customer = new SecurionpayCustomer(get_current_user_id());
         $data['cards'] = $customer->getCards();
         if (isset($_POST['securionpay4wc-card'])) {
             $data['selectedCard'] = $_POST['securionpay4wc-card'];
         } else {
             $data['selectedCard'] = $customer->getDefaultCardIndex();
         }
     }
     Securionpay4WC::getTemplate('payment-fields.php', $data);
     if (class_exists('WC_Payment_Gateway_CC')) {
         $cc_form = new WC_Payment_Gateway_CC();
         $cc_form->id = $this->id;
         $cc_form->supports = $this->supports;
         $cc_form->supports[] = 'tokenization';
         $cc_form->form();
     } else {
         $this->credit_card_form(array('fields_have_names' => false));
     }
 }