function uc_recurring_get_extension in UC Recurring Payments and Subscriptions 6.2
Same name and namespace in other branches
- 7.2 uc_recurring.module \uc_recurring_get_extension()
Returns the time to extend for a payment attempt.
Parameters
$fee_id: The id of the recurring fee to get extensions.
$attempt: The attempt number to return.
2 calls to uc_recurring_get_extension()
- uc_recurring_process_extensions in ./
uc_recurring.module - Handle extensions when a recurring payment was unsuccessful.
- uc_recurring_renew in ./
uc_recurring.module - Process a renewal, either from the cron job or manually from a fee handler.
File
- ./
uc_recurring.module, line 607 - Allows you to add a recurring fee to a product/SKU to handle subscription type services.
Code
function uc_recurring_get_extension($fee_id, $attempt) {
$result = db_query("SELECT * FROM {uc_recurring_extensions} WHERE (pfid = %d OR pfid IS NULL) AND rebill_attempt = %d ORDER BY pfid DESC", $fee_id, $attempt);
$extend_seconds = 0;
if ($result != FALSE) {
$extension = db_fetch_object($result);
$extend_seconds = $extension->time_to_extend;
}
return $extend_seconds;
}