You are here

function uc_recurring_admin_charge_form in UC Recurring Payments and Subscriptions 6.2

Same name and namespace in other branches
  1. 6 uc_recurring.admin.inc \uc_recurring_admin_charge_form()
  2. 7.2 uc_recurring.admin.inc \uc_recurring_admin_charge_form()

Confirm a recurring fee charge.

Parameters

$form_state:

$uid:

Return value

unknown_type

1 string reference to 'uc_recurring_admin_charge_form'
uc_recurring_recurring_info in ./uc_recurring.module
Implementation of hook_recurring_info().

File

./uc_recurring.admin.inc, line 113
Recurring payments administration page callbacks and form builder functions.

Code

function uc_recurring_admin_charge_form($form_state, $rfid, $fee_handler) {
  $fee = uc_recurring_fee_user_load($rfid);
  if ($fee->fee_handler == $fee_handler) {
    $context = array(
      'revision' => 'formatted-original',
      'location' => 'recurring-charge-form',
    );
    $form['rfid'] = array(
      '#type' => 'hidden',
      '#value' => $rfid,
    );
    $form['message'] = array(
      '#value' => '<div>' . t('Are you sure you want to charge the customer @amount at this time?', array(
        '@amount' => uc_price($fee->fee_amount, $context),
      )) . '</div>',
    );
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Process Renewal'),
      '#suffix' => l(t('Cancel'), uc_referer_uri()),
    );
    return $form;
  }
  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(uc_referer_uri()),
    )), 'error');
  }
}