/**
  * Can't store credit card info in the database,
  * pass it from page to page in a hidden form field.
  * Making it all more important to have SSL.
  *
  * @param array   $panes
  * @param SI_Checkouts/string $checkout
  * @return array
  */
 public function credit_card_cache($checkout = '')
 {
     if ($this->cc_cache && $checkout->get_current_page() != SI_Checkouts::PAYMENT_PAGE) {
         $data = array('type' => 'hidden', 'value' => esc_attr(serialize($this->cc_cache)));
         sa_form_field('cc_cache', $data, 'credit');
     }
 }
Esempio n. 2
0
    /**
     * Loop through the fields set for the form and build the markup.
     * @param  array $fields  
     * @param  string $context 
     * @return string          
     */
    function sa_form_fields($fields, $context = 'contact', $wrap_class = '')
    {
        foreach ($fields as $key => $data) {
            ?>
			<?php 
            if ($data['type'] == 'heading') {
                ?>
				<legend class="legend form-heading" ><?php 
                echo esc_html($data['label']);
                ?>
</legend>
			<?php 
            } elseif ($data['type'] != 'checkbox') {
                ?>
				<div class="sa-control-group<?php 
                echo ' ' . $wrap_class;
                ?>
">
					<span class="label_wrap"><?php 
                sa_form_label($key, $data, $context);
                ?>
</span>
					<span class="input_wrap"><?php 
                sa_form_field($key, $data, $context);
                ?>
</span>
				</div>
			<?php 
            } else {
                ?>
				<div class="sa-controls input_wrap<?php 
                echo ' ' . $wrap_class;
                ?>
">
					<label for="si_<?php 
                echo esc_attr($context);
                ?>
_<?php 
                echo esc_attr($key);
                ?>
" class="sa-checkbox">
						<?php 
                // add class by modifying the attributes.
                $data['attributes']['class'] = 'checkbox';
                ?>
						<?php 
                sa_form_field($key, $data, $context);
                ?>
 <?php 
                echo esc_html($data['label']);
                ?>
					</label>
				</div>
			<?php 
            }
            ?>
	<?php 
        }
    }