Using other payment protocol data to find orders
As provided, WebSphere Commerce enables you to perform an advanced search for orders using the payment account information as the search criteria. For example, on the Find Orders page in the WebSphere Commerce Accelerator, you can search orders and include the cardholder account number as part of the search criteria. To search on other types of payment protocol data, or to include other payment protocol data with the account number as part of the search criteria, you must modify the order search JSP file used to perform order searches. The following examples describe how to substitute some other field for account, and how to add a second field to be used in addition to the account field.
About this task
The following examples show how to modify the CSROrderSearchB2C.jsp file. You can extend the examples to make modifications to order search JSP files, such as CSROrderSearchB2B.jsp.
The JSP files reside in the following directory:
- WC_eardir/CommerceAccelerator.war/tools/order
- WCDE_installdir\workspace\CommerceAccelerator\WebContent\tools\order
Changing the payment protocol criteria field
Procedure
- Locate and modify the CSROrderSearchB2C.jsp file to change the
order label for account to the new field. This example shows the check routing
number being substituted for account. Because the entire check routing number
is entered rather than the last 5 digits of the account, the INPUT element
also changes.
Before:
<TR> <TD> <label for="protocolDataName1"></label> <label for="protocolDataValue1"><%=orderLabels.get("account")%></label> </TD> </TR> <TR> <TD> <INPUT type="hidden" name="protocolDataName1" value="account" id="protocolDataName1"/> <INPUT size="5" type="text" maxlength="5" id="protocolDataValue1" name="protocolDataValue1"/> </TD> </TR>
After:
<TR> <TD> <label for="protocolDataName1"></label> <label for="protocolDataValue1"><%=orderLabels.get("check_routing_number")%></label> </TD> </TR> <TR> <TD> <INPUT type="hidden" name="protocolDataName1" value="check_routing_number" id="protocolDataName1"/> <INPUT type="text" id="protocolDataValue1" name="protocolDataValue1"/> </TD> </TR>
- Locate and modify the OrderLabels*.properties file to add a line
for the new field. Add the following line:
check_routing_number=The check routing number
- Ensure that the PaymentSystemPluginMapping.xml file is updated
to use the substituted data.
<Keyword name="check_routing_number" searchable="true"/>
- To verify that your modification has been successful, place a test order.
Results
Adding another field in addition to account
- Before:
<TR> <TD> <label for="protocolDataName1"></label> <label for="protocolDataValue1"><%=orderLabels.get("account")%></label> </TD> </TR> <TR> <TD> <INPUT type="hidden" name="protocolDataName1" value="account" id="protocolDataName1"/> <INPUT size="5" type="text" maxlength="5" id="protocolDataValue1" name="protocolDataValue1"/> </TD> </TR>
After:
<TR> <TD> <label for="protocolDataName2"></label> <label for="protocolDataValue2"><%=orderLabels.get("cc_brand")%></label> </TD> <TD> <label for="protocolDataName1"></label> <label for="protocolDataValue1"><%=orderLabels.get("account")%></label> </TD> </TR> <TR> <TD> <INPUT type="hidden" name="protocolDataName2" value="cc_brand" id="protocolDataName2"/> <SELECT id="protocolDataValue2" name="protocolDataValue2"/> <OPTION value="VisaNet" SELECTED>VisaNet</OPTION> <OPTION value="Master Card">Master Card</OPTION> <OPTION value="AMEX">American Express</OPTION> </SELECT> </TD> <TD> <INPUT type="hidden" name="protocolDataName1" value="account" id="protocolDataName1"/> <INPUT size="5" type="text" maxlength="5" id="protocolDataValue1" name="protocolDataValue1"/> </TD> </TR>
The SELECTED attribute is used to indicate what the default credit card brand should be when the page is first displayed. Because only one default exists, the lines for the other two card brands do not contain the attribute.
- Modify the function findAction() in the CSROrderSearchB2C.jsp file to
include the additional data:
Before:
if( !isEmpty(document.orderFindForm.protocolDataValue1.value) ) { urlPara.paymentDataSize=1; urlPara.paymentData_name_1=document.orderFindForm.protocolDataName1.value; urlPara.paymentData_value_1=document.orderFindForm.protocolDataValue1.value; } else { urlPara.paymentDataSize=0; }
After:
if( !isEmpty(document.orderFindForm.protocolDataValue1.value) && !isEmpty(document.orderFindForm.protocolDataValue2.value) ) { urlPara.paymentDataSize=2; urlPara.paymentData_name_1=document.orderFindForm.protocolDataName1.value; urlPara.paymentData_value_1=document.orderFindForm.protocolDataValue1.value; urlPara.paymentData_name_2=document.orderFindForm.protocolDataName2.value; urlPara.paymentData_value_2=document.orderFindForm.protocolDataValue2.value; } else { urlPara.paymentDataSize=0; }
- Locate and modify the OrderLabels*.properties file to add a line for the
new field. Add the following line:
cc_brand=The brand of the credit card
- Ensure that the PaymentSystemPluginMapping.xml file is updated to use
the additional data.
<Keyword name="account" mask="*" plain="-5" searchable="true"/> <Keyword name="cc_brand" searchable="true"/>
- To verify that your modification has been successful, place a test order.