Advertisement
Advertisement
| 06.10.2008 at 12:49AM PDT, ID: 23471496 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: |
This is in the showcart.cfm file, which displays the cart and payment fields for submission:
<!--- If the "PLACE ORDER" button has been clicked... --->
<!--- START [ PROCESS ORDER ] =================================================== --->
<cfif FORM.action EQ "placeorder">
<!--- Process order --->
<cfmodule template="CWTags/CWTagProcessOrder.cfm" Cart="#Cart#">
</cfif>
<!--- END [ PROCESS ORDER ] =============================++====================== --->
<!--- If Checking out, show credit card input form or Processor information--->
<form action="<cfoutput>#request.ThisPage#</cfoutput>" method="post" name="PlaceOrder">
<cfif request.PaymentAuthType EQ "Gateway" OR request.PaymentAuthType EQ "None">
<!--- get Credit Cards for form field --->
<cfquery name="rsGetCCards" datasource="#request.dsn#" username="#request.dsnUsername#" password="#request.dsnPassword#">
SELECT ccard_Name, ccard_Code
FROM tbl_list_ccards
WHERE ccard_Archive = 0 ORDER BY ccard_Name
</cfquery>
<p><strong>Enter your payment details to complete your order.</strong></p>
<!--- Output any error messages from credit card input --->
<cfif request.FieldErrorText NEQ "">
<span class="errorMessage"><cfoutput>#request.FieldErrorText#</cfoutput></span>
</cfif>
<CFIF "<cfoutput>#rsGetCustData.cst_terms#</cfoutput>" CONTAINS "Net30">
<input type="hidden" name="cst_terms" value="<cfoutput>#rsGetCustData.cst_terms#</cfoutput>">
<input type="hidden" name="cstPONumer" value="<cfoutput>#FORM.cstPONumber#</cfoutput>">
<table>
<tr>
<td valign="top">Select Payment Method: </td>
<td valign="top"><input type='radio' id=ra1 name=ra1 value=1 onClick="checkClick(this.value)">
<label for=ra1>Purchase Order</label><br>
<input type='radio' id=ra2 name=ra1 value=2 onClick="checkClick(this.value)">
<label for=ra2>Credit Card</label></td>
</tr>
</table>
<table id=tbox1 style="display:none" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table class="tabularData">
<tr>
<th colspan="2">Purchase Order Data</th>
</tr>
<tr class="altRowOdd" >
<td align="right"> <cfif IsDefined ('request.FieldErrorPON')>
<span class="errorMessage">P.O. Number</span>
<cfelse>
P.O. Number
</cfif> </td>
<td> <input name="cstPONumber" size="34" type="text" value="<cfoutput>#FORM.cstPONumber#</cfoutput>">
* </td>
</tr>
</table>
</td>
</tr>
</table>
<table id=placeorder1 style="display:none">
<tr>
<td><input name="placeorder" type="submit" class="formButton" value="Place Order">
<input name="action" type="hidden" value="placeorder"></td>
</tr>
</table>
<table id=sel1 style="display:none" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table class="tabularData">
<tr>
<th colspan="2">Credit Card Data</th>
</tr>
<tr class="altRowOdd" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCHN')>
<span class="errorMessage">Card Holder Name</span>
<cfelse>
Card Holder Name
</cfif> </td>
<td> <input name="cstCCardHolderName" type="text" value="<cfoutput>#FORM.cstCCardHolderName#</cfoutput>">
* </td>
</tr>
<tr class="altRowEven" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCT')>
<span class="errorMessage">Card Type</span>
<cfelse>
Card Type
</cfif> </td>
<td> <select name="cstCCardType">
<option value="forgot" selected="selected">Choose Credit Card</option>
<cfoutput query="rsGetCCards">
<option value="#rsGetCCards.ccard_Code#"<cfif FORM.cstCCardType EQ rsGetCCards.ccard_Code>
selected</cfif>>#rsGetCCards.ccard_Name#</option>
</cfoutput>
</select>
* </td>
</tr>
<tr class="altRowOdd" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCN')>
<span class="errorMessage">Card Number</span>
<cfelse>
Card Number
</cfif>
<br /> </td>
<td> <input type="text" name="cstCCNumber" value="<cfoutput>#FORM.cstCCNumber#</cfoutput>">
*</td>
</tr>
<tr class="altRowEven" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCY') OR IsDefined ('request.FieldErrorCM')>
<span class="errorMessage">Expiration Date</span>
<cfelse>
Expiration Date
</cfif> </td>
<td> <select name="cstExprMonth" id="cst_ExprMonth">
<option value="forgot">--</option>
<cfloop index="MonthValue" from="01" to="12">
<option<cfif FORM.cstExprMonth EQ MonthValue> selected</cfif>><cfoutput>#NumberFormat(MonthValue,"09")#</cfoutput></option>
</cfloop>
</select>
/
<select name="cstExprYr" id="cst_ExprYr">
<option value="forgot">--</option>
<cfloop index="YearValue" from="#DateFormat(Now(),'yyyy')#" to="#DateFormat(DateAdd('yyyy',6,Now()),'yyyy')#">
<option<cfif FORM.cstExprYr EQ YearValue> selected="selected"</cfif>
value="<cfoutput>#Right(YearValue,2)#</cfoutput>"><cfoutput>#YearValue#</cfoutput></option>
</cfloop>
</select>
* </td>
</tr>
<tr class="altRowEven" >
<td align="right" valign="top"><cfif IsDefined ('request.FieldErrorCCV')>
<span class="errorMessage">CCV Code</span>
<cfelse>
CCV Code
</cfif></td>
<td><p>
<input name="cstCCV" type="text" value="<cfoutput>#FORM.cstCCV#</cfoutput>" size="4" maxlength="4">
<br />
<span class="smallprint">This is the 3 digit number<br />
that appears on the reverse side of your <br />
credit card (where your signature appears).<br />
Amex cards only - the 4 digit number on <br />
the front of your card.</span><br />
<br />
<img src="cw3/assets/cards/ccv.gif" width="135" height="86"></p></td>
</tr>
</table>
</td>
</tr>
</table>
<table id=placeorder2 style="display:none">
<tr>
<td><input name="placeorder" type="submit" class="formButton" value="Place Order">
<input name="action" type="hidden" value="placeorder"></td>
</tr>
</table>
<script type="text/JavaScript">
function checkClick(val)
{
if( val == 1 ) {
document.all["tbox1"].style.display = 'block';
document.all["sel1"].style.display = 'none';
document.all["placeorder1"].style.display = 'block';
document.all["placeorder2"].style.display = 'none';
document.all["sel1"].style.display = 'none';
document.all["asel1"].disabled = true;
document.all["atext1"].disabled = false;
} else {
document.all["tbox1"].style.display = 'none';
document.all["sel1"].style.display = 'block';
document.all["placeorder1"].style.display = 'none';
document.all["placeorder2"].style.display = 'block';
document.all["asel1"].disabled = false;
document.all["atext1"].disabled = true;
}
}
</script>
<CFELSE>
<table class="tabularData">
<tr>
<th colspan="2">Credit Card Data</th>
</tr>
<tr class="altRowOdd" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCHN')>
<span class="errorMessage">Card Holder Name</span>
<cfelse>
Card Holder Name
</cfif> </td>
<td> <input name="cstCCardHolderName" type="text" value="<cfoutput>#FORM.cstCCardHolderName#</cfoutput>">
* </td>
</tr>
<tr class="altRowEven" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCT')>
<span class="errorMessage">Card Type</span>
<cfelse>
Card Type
</cfif> </td>
<td> <select name="cstCCardType">
<option value="forgot" selected="selected">Choose Credit Card</option>
<cfoutput query="rsGetCCards">
<option value="#rsGetCCards.ccard_Code#"<cfif FORM.cstCCardType EQ rsGetCCards.ccard_Code>
selected</cfif>>#rsGetCCards.ccard_Name#</option>
</cfoutput>
</select>
* </td>
</tr>
<tr class="altRowOdd" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCN')>
<span class="errorMessage">Card Number</span>
<cfelse>
Card Number
</cfif>
<br /> </td>
<td> <input type="text" name="cstCCNumber" value="<cfoutput>#FORM.cstCCNumber#</cfoutput>">
*</td>
</tr>
<tr class="altRowEven" >
<td align="right"> <cfif IsDefined ('request.FieldErrorCY') OR IsDefined ('request.FieldErrorCM')>
<span class="errorMessage">Expiration Date</span>
<cfelse>
Expiration Date
</cfif> </td>
<td> <select name="cstExprMonth" id="cst_ExprMonth">
<option value="forgot">--</option>
<cfloop index="MonthValue" from="01" to="12">
<option<cfif FORM.cstExprMonth EQ MonthValue> selected</cfif>><cfoutput>#NumberFormat(MonthValue,"09")#</cfoutput></option>
</cfloop>
</select>
/
<select name="cstExprYr" id="cst_ExprYr">
<option value="forgot">--</option>
<cfloop index="YearValue" from="#DateFormat(Now(),'yyyy')#" to="#DateFormat(DateAdd('yyyy',6,Now()),'yyyy')#">
<option<cfif FORM.cstExprYr EQ YearValue> selected="selected"</cfif>
value="<cfoutput>#Right(YearValue,2)#</cfoutput>"><cfoutput>#YearValue#</cfoutput></option>
</cfloop>
</select>
* </td>
</tr>
<tr class="altRowEven" >
<td align="right" valign="top"><cfif IsDefined ('request.FieldErrorCCV')>
<span class="errorMessage">CCV Code</span>
<cfelse>
CCV Code
</cfif></td>
<td><p>
<input name="cstCCV" type="text" value="<cfoutput>#FORM.cstCCV#</cfoutput>" size="4" maxlength="4">
<br />
<span class="smallprint">This is the 3 digit number<br />
that appears on the reverse side of your <br />
credit card (where your signature appears).<br />
Amex cards only - the 4 digit number on <br />
the front of your card.</span><br />
<br />
<img src="cw3/assets/cards/ccv.gif" width="135" height="86"></p></td>
</tr>
</table>
<input name="placeorder" type="submit" class="formButton" value="Place Order">
<input name="action" type="hidden" value="placeorder">
</CFIF>
<cfelseif request.PaymentAuthType EQ "Processor">
<p>Once you click Place Order below you will receive an order number. On
the next page you will need to process your payment through our third party
payment processor before your order will be shipped. </p>
</cfif>
<cfif Client.ShipPref EQ 0 AND application.enableshipping EQ 1>
<p>You must choose a shipping method to complete your order</p>
<cfelse>
</cfif>
<input type="hidden" name="PickShipPref" value="<cfoutput>#Client.ShipPref#</cfoutput>">
</form>
This is in the CWTagProcessOrder.cfm file, which is the cfmodule called when the Place Order button is clicked, in order to validate the form:
<!--- Validate Credit Card Input --->
<cfparam name="request.FieldInvalid" default="NO">
<cfif request.PaymentAuthType EQ "Gateway" OR request.PaymentAuthType EQ "None">
<CFIF "<cfoutput>#FORM.cst_terms#</cfoutput>" CONTAINS "Net30">
<cfscript>
// Check that PO Number is not blank
if (FORM.cstPONumber eq "")
{ request.FieldErrorPON = "<br />P.O. Number cannot be blank.";
request.FieldInvalid = "YES";
}
</cfscript>
<CFELSE>
<cfscript>
// Check Card holder name
if (FORM.cstCCardHolderName eq "")
{ request.FieldErrorCHN = "<br />Card Holder Name cannot be blank.";
request.FieldInvalid = "YES";
}
// Check C Card Type
if (FORM.cstCCardType eq "forgot")
{ request.FieldErrorCT = "<br />Please choose your credit card type.";
request.FieldInvalid = "YES";
}
// Check C Card Number
thisCCNum = FORM.cstCCNumber;
ccLength = 16;
altccLength = 16;
ccvLength = 3;
if(FORM.cstCCardType EQ "amex"){
ccLength = 15;
altccLength = 15;
ccvLength = 4;
}
if(Form.cstCCardType EQ "visa"){
altccLength = 13; // visa now accepts 13 and 16 character numbers, so allow both
}
if (IsNumeric(thisCCNum) IS "FALSE" OR (Len(thisCCNum) NEQ ccLength And Len(thisCCNum) NEQ altccLength)){
request.FieldErrorCN = "<br />You did not enter a valid credit card number.";
request.FieldInvalid = "YES";
}
if (IsNumeric(FORM.cstCCV) IS "FALSE" OR Len(FORM.cstCCV) LT ccvLength)
{ request.FieldErrorCCV = "<br />You did not enter a CCV code.";
request.FieldInvalid = "YES";
}
// Check C Card Expr Month
if (FORM.cstExprMonth eq "forgot"){
request.FieldErrorCM ="<br />Please choose the month your card expires.";
request.FieldInvalid = "YES";
}
// Check C Card Expr Year
if (FORM.cstExprYr eq "forgot"){
request.FieldErrorCY = "<br />Please choose the year your card expires.";
request.FieldInvalid = "YES";
}
</cfscript>
</cfif>
</cfif>
|