| 1 |
<?php $showExistingCards = $viewData['user_logged_in'] && isset( $viewData['existingCards']['data'] ) && sizeof( $viewData['existingCards']['data'] ) > 0; ?> |
| 2 |
|
| 3 |
<div id="omise_cc_form"> |
| 4 |
<?php if ( $showExistingCards ) : ?> |
| 5 |
<h3><?php _e( 'Use an existing card', 'omise' ); ?></h3> |
| 6 |
<ul class="omise-customer-card-list"> |
| 7 |
<?php foreach ( $viewData['existingCards']['data'] as $row => $card ) : ?> |
| 8 |
<li class="item"> |
| 9 |
<input <?php echo $row === 0 ? 'checked=checked' : ''; ?> id="card-<?php echo $card['id']; ?>" type="radio" name="card_id" value="<?php echo $card['id']; ?>" /> |
| 10 |
<label for="card-<?php echo $card['id']; ?>"> |
| 11 |
<?php echo '<strong>' . $card['brand'] . '</strong> xxxx' . $card['last_digits']; ?> |
| 12 |
</label> |
| 13 |
</li> |
| 14 |
<?php endforeach; ?> |
| 15 |
</ul> |
| 16 |
<?php endif; ?> |
| 17 |
|
| 18 |
<div> |
| 19 |
<?php if ( $showExistingCards ) : ?> |
| 20 |
<input id="new_card_info" type="radio" name="card_id" value="" /> |
| 21 |
<label id="label-new_card_info" for="new_card_info"> |
| 22 |
<h3><?php _e( 'Create a charge using new card', 'omise' ); ?></h3> |
| 23 |
</label> |
| 24 |
<?php endif; ?> |
| 25 |
|
| 26 |
<fieldset id="new_card_form" class="<?php echo $showExistingCards ? 'card-exists' : ''; ?>"> |
| 27 |
|
| 28 |
<?php require_once( 'form-creditcard.php' ); ?> |
| 29 |
|
| 30 |
<div class="clear"></div> |
| 31 |
|
| 32 |
<?php if ( $viewData['user_logged_in'] ) : ?> |
| 33 |
<p class="omise-remember-card"> |
| 34 |
<input type="checkbox" name="omise_save_customer_card" id="omise_save_customer_card" /> |
| 35 |
<label for="omise_save_customer_card" class="inline"> |
| 36 |
<?php _e( 'Remember this card', 'omise' ); ?> |
| 37 |
</label> |
| 38 |
</p> |
| 39 |
<?php endif; ?> |
| 40 |
|
| 41 |
<div class="clear"></div> |
| 42 |
</fieldset> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
|