You are here

function uc_payment_delete in Ubercart 5

Same name and namespace in other branches
  1. 8.4 payment/uc_payment/uc_payment.module \uc_payment_delete()
  2. 6.2 payment/uc_payment/uc_payment.module \uc_payment_delete()
  3. 7.3 payment/uc_payment/uc_payment.module \uc_payment_delete()

Delete a payment from the database.

1 call to uc_payment_delete()
uc_payment_delete_confirm_form_submit in payment/uc_payment/uc_payment.module

File

payment/uc_payment/uc_payment.module, line 997

Code

function uc_payment_delete($receipt_id) {
  if (!is_numeric($receipt_id)) {
    return FALSE;
  }
  if (variable_get('uc_payment_logging', TRUE)) {
    global $user;
    $payment = uc_payment_load($receipt_id);
    $log_message = t('!method payment for !amount deleted by !user.', array(
      '!method' => $payment->method,
      '!amount' => uc_currency_format($payment->amount),
      '!user' => uc_get_initials($user->uid),
    ));
    uc_order_log_changes($payment->order_id, array(
      $log_message,
    ));
  }
  db_query("DELETE FROM {uc_payment_receipts} WHERE receipt_id = %d", $receipt_id);
}