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)); } }
/** * Core credit card form which gateways can used if needed. Deprecated - inheirt WC_Payment_Gateway_CC instead. * @param array $args * @param array $fields */ public function credit_card_form($args = array(), $fields = array()) { _deprecated_function('credit_card_form', '2.6', 'WC_Payment_Gateway_CC->form'); $cc_form = new WC_Payment_Gateway_CC(); $cc_form->id = $this->id; $cc_form->supports = $this->supports; $cc_form->form(); }