/* The type of list to be printed must be passed in as
a propety of the REQUEST object, and usually comes in the form of a URL
argument (e.g. ...url...?name=value ). The type property must be called "type".
If the list is to be a list of transactions associate with a batch, the
batch id must also be passed as a property of the REQUEST object, called "batchid."
*/
// Register LivePayment functions with LiveWire
registerLivePayment();
// The following code creates a title string that is used to print the title of the page based
// on the type which is passed in the request object.
var titleString = "";
viewtype = request.type;
batchid = ((request.batchid == "null") ? "No Batch Open" : request.batchid);
// Get Title
titleString = GetTitleString(viewtype, batchid);
// Print the HTML string.
write(titleString);
LivePayment Transactions as of
var curDate = new Date();
write(curDate);
ID
Card Holder Name
Merchant Reference
Card Type
Amount
Event Time
Status
var slip = null;
// The following code dynamically creates a table view of the LivePayment
// application transactions based on the TYPE and BATCHID that are passed to it.
// Where the viewtype is "auth" or "credit", the transaction ID is a link to the
// properties of that transaction. In the other two cases, the transaction ID
// is simply displayed.
viewtype = request.type;
batchid = request.batchid;
if (viewtype == "auth") {
cursor = database.cursor("select * from LP_PURCHASE where ((status = 'AUTHORIZED') OR (status = 'CAPTURING')) ");
idString1 = ""
idString3 = "";
}
if (viewtype == "cancel") {
cursor = database.cursor("select * from LP_PURCHASE where status = 'AUTHORIZED'");
idString1 = ""
idString3 = "";
}
if (viewtype == "credit")
{
cursor = database.cursor("select * from LP_PURCHASE where LP_PURCHASE.batchID = " + batchid + " AND ((status = 'CAPTURED') OR (status = 'CREDITING')) order by LP_PURCHASE.ID");
idString1 = "";
idString3 = "";
}
if (viewtype == "view")
{
cursor = database.cursor("select * from LP_PURCHASE where LP_PURCHASE.batchID = " + batchid + " order by LP_PURCHASE.ID");
idString1 = "";
idString3 = "";
}
if (viewtype == "current")
{
cursor = database.cursor("select * from LP_PURCHASE where LP_PURCHASE.batchID = " + batchid + " order by LP_PURCHASE.ID");
idString1 = "";
idString3 = "";
}
if (viewtype == "errors")
{
cursor = database.cursor("select * from LP_PURCHASE where ((status = 'AUTHFAILED') OR (status = 'AVSFAILED')) order by LP_PURCHASE.ID");
idString1 = "";
idString3 = "";
}
while (cursor.next())
{
slipID = cursor.slipID;
slipCursor = database.cursor("select * from LP_SLIP where ID = " + slipID);
if (slipCursor.next())
{
asciiDER = slipCursor.slipder;
slip = new Slip(asciiDER);
if (slip.bad())
{
slipCursor.close();
cursor.close();
database.rollbackTransaction();
PrintFmtError("Failed to construct slip object from DER.",
slip.getStatusMessage());
}
}
else
{
slipCursor.close();
cursor.close();
database.rollbackTransaction();
PrintError("Slip not found", "No slip with ID " + slipID + " in database. Could not retrieve card type.");
}
slipCursor.close();