You are here

function payment_ubercart_checkout_form_submit in Payment for Ubercart 7.2

Same name and namespace in other branches
  1. 7 payment_ubercart.module \payment_ubercart_checkout_form_submit()

Implements form submit callback.

See also

payment_ubercart_form_alter()

1 string reference to 'payment_ubercart_checkout_form_submit'
payment_ubercart_form_alter in ./payment_ubercart.module
Implements hook_form_alter().

File

./payment_ubercart.module, line 92
Hook implementations and shared functions.

Code

function payment_ubercart_checkout_form_submit($form, &$form_state) {

  // Save all data required for payment execution, before we execute the
  // payment in payment_ubercart_uc_order().
  if (isset($form_state['storage']['order']) && strpos($form_state['storage']['order']->payment_method, 'payment_ubercart_') === 0) {
    $order = $form_state['storage']['order'];
    $payment = $form_state['payment'];
    entity_save('payment', $payment);
    $payment->payment_ubercart_uc_order_id = $order->order_id;
    payment_ubercart_order_id_save($payment);
  }
}