You are here

function uc_recurring_hosted_subscription_delete in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 modules/uc_recurring_hosted/uc_recurring_hosted.module \uc_recurring_hosted_subscription_delete()

Delete a record by subscription ID or recurring fee ID.

Parameters

$id: The ID.

$type: The type of the get request. can be "rfid" for recuring fee ID, or "subscription" for the subscription ID.

1 call to uc_recurring_hosted_subscription_delete()
uc_recurring_hosted_subscription_save in modules/uc_recurring_hosted/uc_recurring_hosted.module
Save a new subscription ID

File

modules/uc_recurring_hosted/uc_recurring_hosted.module, line 187
Provides hosted gateway specific code for recurring payments, specifically Authorize.net ARB and Paypal WPS

Code

function uc_recurring_hosted_subscription_delete($id, $type = 'rfid') {
  module_invoke_all('uc_recurring_hosted_subscription_delete', $id, $type);
  if ($type == 'rfid') {

    // TODO Please review the conversion of this statement to the D7 database API syntax.

    /* db_query("DELETE FROM {uc_recurring_hosted} WHERE rfid = %d", $id) */
    $return = db_delete('uc_recurring_hosted')
      ->condition('rfid', $id)
      ->execute();
  }
  else {

    // TODO Please review the conversion of this statement to the D7 database API syntax.

    /* db_query("DELETE FROM {uc_recurring_hosted} WHERE subscription_id = '%s'", $id) */
    $return = db_delete('uc_recurring_hosted')
      ->condition('subscription_id', $id)
      ->execute();
  }
}