public function to_html()
    {
        // let 3rd party themes/plugins use their own form
        if (!apply_filters('ms_gateway_authorize_view_form_to_html', true, $this)) {
            return;
        }
        $fields = $this->prepare_fields();
        ob_start();
        // Render tabbed interface.
        ?>
			<div class="ms-wrap">
				<?php 
        if ($this->data['auth_error']) {
            ?>
					<div class="ms-validation-error"><p><?php 
            echo '' . $this->data['auth_error'];
            ?>
</p></div>
				<?php 
        }
        ?>
				<form id="ms-authorize-extra-form" method="post" class="ms-form">
					<?php 
        foreach ($fields['hidden'] as $field) {
            ?>
						<?php 
            MS_Helper_Html::html_element($field);
            ?>
					<?php 
        }
        ?>

					<?php 
        $this->render_cim_profiles();
        ?>
					<div id="ms-authorize-card-wrapper">
						<?php 
        _e('Credit Card Information', MS_TEXT_DOMAIN);
        ?>
						<table class="form-table ms-form-table">
							<tbody>
								<tr>
									<td>
										<?php 
        MS_Helper_Html::html_element($fields['card']['card_num']);
        ?>
									</td>
								</tr>
								<tr>
									<td>
										<?php 
        MS_Helper_Html::html_element($fields['card']['card_code']);
        ?>
									</td>
								</tr>
								<tr>
									<td>
										<?php 
        MS_Helper_Html::html_element($fields['card']['exp_month']);
        ?>
										<?php 
        MS_Helper_Html::html_element($fields['card']['exp_year']);
        ?>
									</td>
								</tr>
							</tbody>
						</table>
						<?php 
        _e('Billing Information', MS_TEXT_DOMAIN);
        ?>
						<table class="form-table ms-form-table">
							<tbody>
								<?php 
        foreach ($fields['billing'] as $field) {
            ?>
									<tr>
										<td>
											<?php 
            MS_Helper_Html::html_element($field);
            ?>
										</td>
									</tr>
								<?php 
        }
        ?>
							</tbody>
						</table>
					</div>
					<?php 
        MS_Helper_Html::html_submit(array('value' => 'update_card' == $this->data['action'] ? __('Change card', MS_TEXT_DOMAIN) : __('Pay now', MS_TEXT_DOMAIN)));
        ?>
				</form>
				<div class="clear"></div>
			</div>
		<?php 
        $html = ob_get_clean();
        echo '' . $html;
    }