You are here

function uc_payment_delete in Ubercart 8.4

Same name and namespace in other branches
  1. 5 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()

Deletes a payment from the database.

Parameters

string $receipt_id: A PaymentReceipt entity id.

File

payment/uc_payment/uc_payment.module, line 270
Defines the payment API that lets payment modules interact with Ubercart.

Code

function uc_payment_delete($receipt_id) {
  if (!is_numeric($receipt_id)) {
    return FALSE;
  }

  /** @var \Drupal\uc_payment\PaymentReceiptInterface $payment */
  $payment = PaymentReceipt::load($receipt_id);
  $payment
    ->delete();
}