You are here

function payment_form_standalone in Payment 7

Implements form build callback: the payment add/edit form.

To alter the payment form in general, see hook_payment_form_alter().

_state

Parameters

array $form:

Payment $payment:

array $pmids: The PMIDs of the payment methods the user is allowed to choose from.

Return value

array A render array.

See also

payment_form_embedded()

hook_payment_form_alter()

3 string references to 'payment_form_standalone'
paymentform_field_formatter_view in modules/paymentform/paymentform.module
Implements hook_field_formatter_view().
paymentreference_page in modules/paymentreference/paymentreference.module
Return a payment page for a field instance.
payment_menu in ./payment.module
Implements hook_menu().

File

./payment.ui.inc, line 160
The Payment user interface.

Code

function payment_form_standalone(array $form, array &$form_state, Payment $payment, array $pmids = array()) {
  $form_info = payment_form_embedded($form_state, $payment, $pmids);
  $form = $form_info['elements'];
  $form['#submit'] = array_merge($form_info['submit'], array(
    'payment_form_standalone_submit',
  ));
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['save'] = array(
    '#type' => 'submit',
    '#value' => $payment->pid ? t('Save') : t('Pay'),
  );
  if ($payment->pid) {
    $form['actions']['delete'] = array(
      '#type' => 'link',
      '#title' => t('Delete'),
      '#href' => 'payment/' . $payment->pid . '/delete',
      '#access' => payment_access('delete', $payment),
    );
  }
  return $form;
}