You are here

function uc_recurring_user_cancel_form in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 uc_recurring.pages.inc \uc_recurring_user_cancel_form()
  2. 6 uc_recurring.pages.inc \uc_recurring_user_cancel_form()

Displays the confirmation form for cancelling a recurring fee.

3 string references to 'uc_recurring_user_cancel_form'
hook_recurring_info in ./uc_recurring.api.php
Define the recurring payment method/gateway function callbacks.
hook_recurring_info_alter in ./uc_recurring.api.php
Alter the recurring method/ gateway info.
uc_recurring_recurring_info in ./uc_recurring.module
Implements hook_recurring_info().

File

./uc_recurring.pages.inc, line 11
Recurring payments menu items.

Code

function uc_recurring_user_cancel_form($form, $form_state, $rfid, $fee_handler) {
  $cancel_path = request_uri();
  $fee = uc_recurring_fee_user_load($rfid);
  if ($fee->fee_handler == $fee_handler) {
    $form['uid'] = array(
      '#type' => 'value',
      '#value' => $fee->uid,
    );
    $form['rfid'] = array(
      '#type' => 'value',
      '#value' => $rfid,
    );
    return confirm_form($form, t('Are you sure you want to cancel this recurring fee?'), $cancel_path, t('This action cannot be undone and may result in the termination of subscription services.'), t('Yes, I want to cancel the subscription'), t('No, I want to continue with the subscription'));
  }
  else {
    drupal_set_message(t('Invalid fee handler was given, try again from the operations for this <a href="@url">recurring fee</a>, if problem persists contact the site administrator.', array(
      '@url' => url($cancel_path),
    )), 'error');
  }
}