You are here

function commerce_sagepay_cancel_form in Drupal Commerce SagePay Integration 7

Form callback: allows the user to void a transaction.

Parameters

array $form: The form array.

array $form_state: The form state array

commerce_order $order: The Commerce Order to process.

commerce_payment_transaction $transaction: The Commerce Payment Transaction to process.

Return value

mixed The form array.

1 string reference to 'commerce_sagepay_cancel_form'
commerce_sagepay_menu in ./commerce_sagepay.module
Implements hook_menu().

File

includes/commerce_sagepay_cancel.inc, line 27

Code

function commerce_sagepay_cancel_form($form, &$form_state, $order, $transaction) {
  $form_state['order'] = $order;
  $form_state['transaction'] = $transaction;

  // Load and store the payment method instance for this transaction.
  $payment_method = commerce_payment_method_instance_load($transaction->instance_id);
  $form_state['payment_method'] = $payment_method;
  $form = confirm_form($form, t('Are you sure you want to cancel this transaction?'), 'admin/commerce/orders/' . $order->order_id . '/payment', '', t('Cancel Transaction'), t('Cancel'), 'confirm');
  return $form;
}