$data['expirationYear'] = $expirationYear;
     // Displayed on confirmation page
     $data['total'] = '0' . str_replace(',', '', $citationInfo['ProcessingTotal']) * 100;
     // "Request Amount" Leading zero is required. This is in *pennies*
 }
 $data['name'] = htmlentities($_POST['name']);
 $data['phoneNumber'] = htmlentities($_POST['phone']);
 $data['email'] = htmlentities($_POST['email']);
 $data['address1'] = htmlentities($_POST['address']);
 $data['city'] = htmlentities($_POST['city']);
 $data['state'] = htmlentities($_POST['state']);
 $data['zipcode'] = htmlentities($_POST['zip']);
 $data['receiptNumber'] = $receiptNumber;
 $tf = new TransFirst();
 $request = $tf->generateTransactionRequest($data);
 $response = $client->SendTran($request);
 $success = $tf->isSuccessful($response);
 // If processing fee was successful, let's charge the fine amount
 if ($success || $debug) {
     // Record the convenience fee
     $sql = "insert into orders " . "(name, email, phone, address, city, state, zip, citation_number, case_number, violation_date, court_date, charges, processing_fee, chargetotal, ws_response, receipt_number)" . " values " . "(:name, :email, :phone, :address1, :city, :state, :zipcode, :citation_num, :case_num, :violation_date, :court_date, :charges, :processing_fee, :total, :ws_response, :receipt_number)";
     $statement = $db->prepare($sql);
     try {
         if (!$debug) {
             $statement->execute(array(':name' => $data['name'], ':email' => $data['email'], ':phone' => $data['phoneNumber'], ':address1' => $data['address1'], ':city' => $data['city'], ':state' => $data['state'], ':zipcode' => $data['zipcode'], ':citation_num' => $citation['CitationNumber'], ':case_num' => $citation['CaseNumber'], ':violation_date' => $citation['ViolationDate'], ':court_date' => $citation['CourtDate'], ':charges' => $citation['Charges'], ':processing_fee' => $citationInfo['ProcessingTotal'], ':total' => number_format($data['total'] / 100, 2), ':ws_response' => serialize($response), ':receipt_number' => $receiptNumber));
         }
     } catch (PDOException $e) {
         echo $e->getMessage();
         exit;
     }
     // Process each citation being paid for