<% /* 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. */ %><% function textRow(tcell, pcell) { %> <%= tcell %> <%= pcell %> <% } var keyData = { ownerName: cart.ownerName, orgName: cart.orgName } if (cart.licenseKey) { var parts = cart.licenseKey.split(":"); keyData.ownerName = parts[0]; keyData.orgName = parts[1]; keyData.key = parts[2]; keyData.keyLine1 = keyData.key.substring(0, keyData.key.length/3); keyData.keyLine2 = keyData.key.substring(keyData.key.length/3, 2*keyData.key.length/3); keyData.keyLine3 = keyData.key.substring(2*keyData.key.length/3, keyData.key.length); } function makeRows(arr) { arr.forEach(function(arr) { textRow(arr[0], arr[1]); }); } %>

License Information <% if (editable) { %>(">edit)<% } %>

<% makeRows([ [ "Administrator name:", keyData.ownerName ], [ "Organization/Company:", keyData.orgName ], [ "Email address for delivery:", cart.email ], [ "Total users:", cart.userCount ] ]); if (keyData.key) { textRow("License key:", keyData.keyLine1+"
"+keyData.keyLine2+"
"+keyData.keyLine3); %><% } %>

Payment Information <% if (editable) { %>(">edit)<% } %>

<% var isUs = cart.billingCountry == "US"; switch(cart.billingPurchaseType) { case 'creditcard': makeRows([ [ "Credit card number:", obfuscateCC(cart.billingCCNumber) ], [ "Expiration date:", cart.billingExpirationMonth+" / 20"+cart.billingExpirationYear ] ]); // falling through intentional. case 'invoice': makeRows([ [ "Purchaser name:", cart.billingFirstName + " " + cart.billingLastName ], [ "Purchaser address: ", cart.billingAddressLine1 + "
" + (cart.billingAddressLine2 ? cart.billingAddressLine2 + "
" : "") + cart.billingCity + ", " + (isUs?cart.billingState:cart.billingProvince) + "
" + (isUs?cart.billingZipCode:cart.billingPostalCode) + (isUs?'':', '+cart.billingCountry) ], [ "Invoice number: ", cart.invoiceId ] ]); break; case 'paypal': textRow("Paid using:", "PayPal"); textRow("InvoiceNumber:", cart.invoiceId); } %>

Summary of Charges

<%= displayCart("shoppingconfirmation", editable) %>