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)); } }
/** * Payment form on checkout page. */ public function payment_fields() { $description = $this->get_description(); if ('yes' == $this->sandbox) { $description .= ' ' . sprintf(__('TEST MODE ENABLED. Use a test card: %s', 'woocommerce'), '<a href="https://www.simplify.com/commerce/docs/tutorial/index#testing">https://www.simplify.com/commerce/docs/tutorial/index#testing</a>'); } if ($description) { echo wpautop(wptexturize(trim($description))); } if ('standard' == $this->mode) { parent::payment_fields(); } }
/** * 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(); }