Ejemplo n.º 1
0
 /**
  * Delete Payment
  */
 function deletePayment()
 {
     // Delete the payment
     delete_PaymentDBO($this->paymentDBO);
     // Log the deleted payment
     log_notice("PSIPNPage::deletePayment()", sprintf("Deleted Paypal payment. TXN=%s, Customer=%s, Amount=%s, Paypal Status=%s", $_POST['txn_id'], $_POST['payer_email'], $_POST['mc_gross'], $_POST['payment_status']));
 }
Ejemplo n.º 2
0
/**
 * Delete InvoiceDBO from database
 *
 * @param InvoiceDBO &$dbo InvoiceDBO to delete
 */
function delete_InvoiceDBO(&$dbo)
{
    $DB = DBConnection::getDBConnection();
    // Delete line-items
    foreach ($dbo->getItems() as $item_dbo) {
        delete_InvoiceItemDBO($item_dbo);
    }
    // Delete Payments
    foreach ($dbo->getPayments() as $payment_dbo) {
        delete_PaymentDBO($payment_dbo);
    }
    // Build SQL
    $sql = $DB->build_delete_sql("invoice", "id = " . intval($dbo->getID()));
    // Run query
    if (!mysql_query($sql, $DB->handle())) {
        throw new DBException(mysql_error($DB->handle()));
    }
}
Ejemplo n.º 3
0
 /**
  * Delete Payment
  *
  * Remove a payment from the Invoice
  */
 function delete_payment()
 {
     // Delete Payments
     foreach ($this->post['payments'] as $dbo) {
         delete_PaymentDBO($dbo);
     }
     // Success
     $this->setMessage(array("type" => "[PAYMENT_DELETED]"));
     $this->reload();
 }