<% /* Copyright 2009 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ %><% if (!cart.billingCountry) { cart.billingCountry = "US"; } helpers.includeJQuery(); helpers.includeJs("billing_shared.js"); helpers.includeJs("billing.js"); function classesPlusError(classes, id) { return (classes || []).concat(errorIfInvalid(id) || []).join(' '); } %> <% function textRow(id, label, classes, notBillingField) { var val = (cart[id] || ""); var maxlen=60; var border; if (id == "billingCCNumber") { if (billing.validateCcNumber(val)) { border = "greenborder"; } else if (billing.validateCcLength(val)) { border = "redborder"; } val = obfuscateCC(val); maxlen = 16; } var classString = classesPlusError((notBillingField?[]:['billingfield']).concat(classes), id); return TR({className: classString}, TD({className: 'pcell'}, LABEL({htmlFor: id}, label+(label.length > 0 ? ":" : ''))), TD({className: 'tcell'}, INPUT({type: 'text', name: id, size:35, maxlength:maxlen, value: val, className: border}))); } %>

Your name:

<%= textRow("billingFirstName", "First Name", [], true) %> <%= textRow("billingLastName", "Last Name", [], true) %>

Payment information:

<% if (request.scheme == 'https') { %>

Your payment information will be sent securely.

<% } %> <% function purchaseType(id, title) { var sel; if (! cart.billingPurchaseType) { sel = (id == 'creditcard'); } else { sel = (cart.billingPurchaseType == id); } %> style="display: inline-block; vertical-align: middle;"/> <% } %>

">Pay using: <% purchaseType('creditcard', 'Credit Card'); %> <% purchaseType('invoice', 'Invoice'); %> <% purchaseType('paypal', 'PayPal'); %>

<%= textRow("billingCCNumber", "Credit Card Number", ['creditcardreq']) %> <% function cardInput(cctype) { var classes = []; if (cart.billingCCNumber) { if (cctype == billing.getCcType(cart.billingCCNumber)) { classes.push("ccimageselected"); } } classes.push("ccimage"); var img = IMG({ src: "/static/img/billing/"+cctype+".gif", alt: cctype, className: classes.join(" "), style: "vertical-align: middle", id: "img"+cctype}); return img; } %> "> <%= textRow("billingAddressLine1", "Address", ['creditcardreq', 'invoicereq']) %> <%= textRow("billingAddressLine2", "", ['creditcardreq', 'invoicereq']) %> <%= textRow("billingCity", "City", ['creditcardreq', 'invoicereq']) %> <%= textRow("billingProvince", "Province", ['creditcardreq', 'invoicereq', 'intonly'])%> <%= textRow("billingZipCode", "Zip Code", ['creditcardreq', 'invoicereq', 'usonly']) %> <%= textRow("billingPostalCode", "Postal Code", ['creditcardreq', 'invoicereq', 'intonly'])%>
 
<% ["visa", "mc", "disc", "amex"].forEach(function(t) { %> <%= cardInput(t) %> <% }); %>
Expiration (MM/YY): /     CSC/CVC: what's this?
(Be sure to enter your credit card billing address below.)
Country:
State:
Click "<%= billingButtonName %>" below to continue with PayPal.
<% if (showCouponCode) { %>

Optional information:

<%= textRow("billingReferralCode", "Referral Code", [], true) %>
<% } %> <%= billingFinalPhrase %>