You are here

function uc_recurring_hosted_subscription_load 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_load()

Get a hosted subscription ID and recurring fee ID.

Parameters

$id: The ID.

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

Return value

Object with the subscription ID and recurring fee ID, or an empty array if none found.

4 calls to uc_recurring_hosted_subscription_load()
uc_recurring_hosted_paypal_wpp_cancel in modules/uc_recurring_hosted/uc_recurring_hosted.module
PayPal website payments pro renew.
uc_recurring_hosted_paypal_wpp_get_profile in modules/uc_recurring_hosted/uc_recurring_hosted.module
Helper function; Get a recurring payments profile from PayPal.
uc_recurring_hosted_paypal_wpp_update in modules/uc_recurring_hosted/uc_recurring_hosted.module
Updates a PayPal subscription; for simplicity's sake, Credit Card information except for expiration date cannot be updated at this time.
uc_recurring_hosted_uc_auth_arb_payment in modules/uc_recurring_hosted/uc_recurring_hosted.module
Implements hook_uc_auth_arb_payment(). Called during an ARB silent post.

File

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

Code

function uc_recurring_hosted_subscription_load($id, $type = 'rfid') {
  $return = array();
  if ($type == 'rfid') {
    $return = db_query("SELECT * FROM {uc_recurring_hosted} WHERE rfid = :rfid", array(
      ':rfid' => $id,
    ));
  }
  elseif ($type == 'subscription_id') {
    $return = db_query("SELECT * FROM {uc_recurring_hosted} WHERE subscription_id = :subscription_id", array(
      ':subscription_id' => $id,
    ));
  }
  drupal_alter('uc_recurring_hosted_subscription', $object);
  return $return
    ->fetchObject();
}