You are here

function commerce_paypal_checkout_void_form in Commerce PayPal 7.2

Form callback: allows the user to void a transaction.

1 string reference to 'commerce_paypal_checkout_void_form'
commerce_paypal_checkout_menu in modules/checkout/commerce_paypal_checkout.module
Implements hook_menu().

File

modules/checkout/includes/commerce_paypal_checkout.admin.inc, line 139
Administrative forms for the Paypal Checkout module.

Code

function commerce_paypal_checkout_void_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['markup'] = array(
    '#markup' => t('Are you sure that you want to void this transaction?'),
  );
  $form = confirm_form($form, t('Are you sure that you want to void this transaction?'), 'admin/commerce/orders/' . $order->order_id . '/payment', '', t('Void'), t('Cancel'), 'confirm');
  return $form;
}