// // This page should be defined as an "initial" page in the Application Manager // configuration when the application is installed. // /* ************************ PARAMETERS ************************ */ // DATABASE CONNECTION PROPERTIES: // ------------------------------- // Set the following four properties to reflect your particular database // connectivity parameters: project.dbType = "yourtype"; // Database type (e.g. INFORMIX, ORACLE, etc.) project.dbServer = "yourserver"; // Database server name project.dbUsername = "youruser"; // Database username project.dbPassword = "yourpassword"; // Database password /* The following database name is the default for the Starter Application. It may be used to run the application as a demonstration, but should be changed when this application is modified for integration into your website. */ project.dbName = "LIVEPAYMENT"; // Database name (default) // OTHER CONFIGURABLE PARAMETERS: // ------------------------------ // Below we initialize some new properties of the PROJECT object that may change for your particular // application. The default values are set below, but may be changed if necessary. // See the LivePayment Documentation for valid values. // Business Parameters project.acquirer = "FDC"; // This must match your acquirer project.currency = "USD"; // This must match your currency type // Address Verification Parameters // Set the following parameters if you wish to pass/fail authorizations based on // Address and/or Zip code mismatches. project.failOnZip = "Y"; // Set to "Y" to fail on Zip mismatch, "N" to ignore such mismatches. project.failOnAddr = "Y"; // Set to "Y" to fail on Address mismatch, "N" to ignore such mismatches. /* ************************************************************ */ project.dbType = project.dbType.toUpperCase(); if(!database.connected()) { database.connect(project.dbType, project.dbServer, project.dbUsername, project.dbPassword, project.dbName); } if (database.connected()) { project.dbconnected = 1; if (registerNativeFunction("registerLivePayment", "LiveWireLibraryPath", "registerLivePayment")) { project.register = 1; // Remember that we registered the function successfully project.apptype = "admin"; // Declare this application to be an administrative app. database.beginTransaction(); // Get Max Purchase ID and store it in the SERVER object server.lock() cursor = database.cursor("select max(id) from LP_PURCHASE"); if (cursor.next()) { if (cursor[0]) { server.lastPurchaseID = cursor[0]; } else { server.lastPurchaseID = 0; } } else { server.lastPurchaseID = 0; } cursor.close(); server.unlock(); // Get Max Slip ID and store it in the SERVER object server.lock(); cursor = database.cursor("select max(id) from LP_SLIP"); if (cursor.next()) { if (cursor[0]) { server.lastSlipID = cursor[0]; } else { server.lastSlipID = 0; } } else { server.lastSlipID = 0; } cursor.close(); server.unlock(); // Get Max Event ID and store it in the SERVER object server.lock() cursor = database.cursor("select max(eventid) from LP_PURCHASE, LP_BATCH where LP_PURCHASE.batchid = LP_BATCH.id AND LP_BATCH.status = 'OPENED'"); if (cursor.next()) { if (cursor[0]) server.eventID = cursor[0]; else server.eventID = 0; } else server.eventID = 0; cursor.close(); server.unlock() // Get Max Batch ID and store it in the SERVER object server.lock() cursor = database.cursor("select max(id) from LP_BATCH"); if (cursor.next()) { if (cursor[0]) { server.lastBatchID = cursor[0]; } else { server.lastBatchID = 0; } } else { server.lastBatchID = 0; } cursor.close(); server.unlock() database.commitTransaction(); } else { project.register = 0; } } else { project.dbconnected = 0; }