<% if (billingErrors) { %>
The billing system is temporarily unavailable. Please try again later.
<% } else { %>
 
Current Credit Cards
<% if (billingAccounts.size() != 0) { %> Add Credit Card <% } else { %>
 
<% } %>
 
 
Add Credit Card
<%= addCreditCardForm.render(); %>
<% if (billingAccounts.size() != 0) { %> Cancel or <% } %>
<% billingAccounts.each(function(account) { %>
 
<%= account.value.name.escapeHTML(); %>
<% if (account.value.hasExpired) { %>
This card is about to or has expired!
<% } %>
Card Details
Card Number: <%= account.value.number.escapeHTML(); %>
Card Expiration: <%= account.value.expiry.escapeHTML(); %>
Billing Address:
<%= account.value.address1.escapeHTML(); %> <%= (account.value.address2 != '' || account.value.address2 != null) ? '
' + account.value.address2.escapeHTML() : ''; %>
<%= account.value.city.escapeHTML() + ', ' + account.value.state.escapeHTML() + ' ' + account.value.zipcode.escapeHTML() + ' ' + account.value.country.escapeHTML(); %>
<% if(account.value.sites.length > 0) { %>
Associated Site<% if(account.value.sites.length != 1) { %>s<% } %>
<% account.value.sites.each(function(site) { %> <% if (!Portal.Data.siteList.sites.get(site.site_id)) { return; } %> <%= Portal.Data.siteList.sites.get(site.site_id).domain.truncate(40); %>
<% }); %>  
<% } else { %>
You do not have any sites associated with this credit card. It may be safely removed.
<% } %>
<% }); %> <% } %>