/**
* Implementation of hook_form_alter().
*/
function simple_checkout_form_alter($form_id, &$form) {
switch($form_id) {
case 'ideal_payment_api_issuer_form':
// Add a submit handler.
// NOTE: we do not override the #submit array, but ADD our own to the array. That way we do not break existing submit-handlers!
$form['#submit']['simple_checkout_order_submit'] = array();
// Add a validate handler.
$form['#validate']['simple_checkout_order_validate'] = array();
break;
}
}
// ... A lot of code ...
/**
* Fapi callback added in form_alter: validates the orders to our orders table.
*
* @param $form_id
* Description of param $form_id
* @param $form_values
* Description of param $form_values
*
* @return
* Nothing.
*/
function simple_checkout_order_validate($form_id, &$form_values) {
// @TODO: prepare $order and insert into our DB table.
}
/**
* Fapi callback added in form_alter: submits the orders to our orders table.
*
* @param $form_id
* Description of param $form_id
* @param $form_values
* Description of param $form_values
*
* @return
* Nothing.
*/
function simple_checkout_order_submit($form_id, &$form_values) {
// @TODO: prepare $order and insert into our DB table.
}