/** * Get Gateway List * * HTML to display radio button list of payment gateways. * * @return string Payment gateways HTML. * * @uses apply_filters() Calls 'wpsc_gateway_image'. * @uses wpsc_have_gateways() Are there any gateways? * @uses wpsc_the_gateway() Setup gateway data. * @uses wpsc_gateway_name() Gateway display name. * @uses wpsc_gateway_internal_name() Gateway internal name. * @uses wpsc_gateway_is_checked() Gateway radio button checked attribute. * @uses wpsc_show_gateway_image() Show gateway image? * @uses wpsc_gateway_image_url() Gateway image URL * @uses wpsc_gateway_form_field_style() Adds class to show/hide fields based on selected gateway. * @uses wpsc_gateway_form_fields() Addition fields for the gateway. */ function _wpsc_filter_merchant_v2_get_gateway_list() { ob_start(); while (wpsc_have_gateways()) { wpsc_the_gateway(); $gateway_name = wpsc_gateway_name(); ?> <div class="custom_gateway <?php echo sanitize_html_class(wpsc_gateway_internal_name()); ?> "> <label><input type="radio" value="<?php echo wpsc_gateway_internal_name(); ?> " <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway" /> <?php if (!empty($gateway_name)) { ?> <span class="custom_gateway_name"><?php echo $gateway_name; ?> </span> <?php } ?> <?php if (wpsc_show_gateway_image()) { $gateway_image = '<img src="' . esc_url(wpsc_gateway_image_url()) . '" alt="' . esc_attr($gateway_name) . '" class="custom_gateway_image" />'; echo apply_filters('wpsc_gateway_image', $gateway_image, wpsc_gateway_internal_name()); } ?> </label> <?php if (wpsc_gateway_form_fields()) { ?> <table class="wpsc_checkout_table <?php echo wpsc_gateway_form_field_style(); ?> "> <?php echo wpsc_gateway_form_fields(); ?> </table> <?php } ?> </div> <?php } return ob_get_clean(); }
?> " <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name(); ?> </label> <?php } else { ?> <label><input type="radio" value="<?php echo wpsc_gateway_internal_name(); ?> " <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name(); ?> </label> <?php } ?> <?php if (wpsc_gateway_form_fields()) { ?> <table class='<?php
</td> </tr> <?php endif; ?> <tr> <td colspan='2'> <?php //this HTML displays activated payment gateways?> <?php if(wpsc_gateway_count() > 1): // if we have more than one gateway enabled, offer the user a choice ?> <h3><?php echo __('Select a payment gateway', 'wpsc');?></h3> <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> <div class="custom_gateway"> <?php if(wpsc_gateway_internal_name() == 'noca'){ ?> <label><input type="radio" id='noca_gateway' value="<?php echo wpsc_gateway_internal_name();?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name();?></label> <?php }else{ ?> <label><input type="radio" value="<?php echo wpsc_gateway_internal_name();?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name();?></label> <?php } ?> <?php if(wpsc_gateway_form_fields()): ?> <table class='<?php echo wpsc_gateway_form_field_style();?>'> <?php echo wpsc_gateway_form_fields();?> </table> <?php endif; ?> </div> <?php endwhile; ?> <?php else: // otherwise, there is no choice, stick in a hidden form ?> <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> <input name='custom_gateway' value='<?php echo wpsc_gateway_internal_name();?>' type='hidden' /> <?php if(wpsc_gateway_form_fields()): ?>