home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / Sample.bin / PHVerifyInfo.java < prev    next >
Text File  |  1998-09-13  |  2KB  |  76 lines

  1. package symantec.sourcebook.servlet;
  2.  
  3. import java.io.*;
  4. import javax.servlet.*;
  5. import javax.servlet.http.*;
  6.  
  7. public class PHVerifyInfo extends PageHandler 
  8. {
  9.  
  10.  
  11.    private final static String PAGENAME = PAGEBASE + "verifyinfo.html";
  12.    
  13.    public PHVerifyInfo()
  14.    {
  15.     
  16.      
  17.    }
  18.    
  19.    public String pageName()
  20.    {
  21.         return PAGENAME;
  22.    }
  23.    
  24.    
  25.    
  26.    protected void customize(Object pageDataObject) throws IOException
  27.    {
  28.         PageData pageData = (PageData) pageDataObject;
  29.         
  30.         Transaction t = pageData.transaction;
  31.         
  32.         // Record transaction information
  33.         
  34.         t.selectId();
  35.         t.record();  
  36.     
  37.         String orderInformation = t.name + "<br>" +
  38.                t.company + "<br>" +
  39.                t.email + "<br>" +
  40.                t.address + "<br>" +
  41.                t.city  + " " + t.state + " " + t.zip + "<br>" +
  42.                t.country + " " + t.phone +"<br>";
  43.  
  44.  
  45.         String fieldText = "<input type=\"hidden\" name=\"orderId\" value=\""+ t.orderID +"\"> ";
  46.        
  47.         fieldText += orderInformation + "<br> <br>";
  48.         
  49.         if(t.chargeTax)
  50.         {
  51.             fieldText += "Product Price: "+t.price+"<br>";
  52.             fieldText += "California Tax: "+t.tax+"<br> <br>";
  53.             fieldText += "Total Price: "+t.total+"<br>";
  54.         }
  55.         else
  56.         {
  57.             fieldText += "Total Price: "+t.total+"<br>";
  58.         }
  59.         
  60.          fieldText += "<input type=\"hidden\" name=\"ccTotal\" value=\""+t.total+"\">";
  61.          fieldText += "<input type=\"hidden\" name=\"ccName\" value=\""+t.name+"\">";
  62.                        
  63.         insert("fieldPosition",fieldText);       
  64.    }
  65.  
  66.  
  67.     // this form is never submitted to our web server (and therefore no validation)
  68.     // the form is validated by the credit card processor
  69.     
  70.     public Object validate(ServletConfig config,HttpServletRequest request,HttpServletResponse response) 
  71.     {
  72.         return null;
  73.     }
  74.  
  75.  
  76. }