need to cope with cancelled/failed transactions

This commit is contained in:
2018-05-19 16:04:07 +01:00
parent aad442c3a5
commit 889bd68900
3 changed files with 106 additions and 1 deletions

View File

@ -132,6 +132,9 @@ function fulcrm_shoppingcart_theme( $existing, $type, $theme, $path ) {
'fulcrm_shoppingcart_transaction_complete' => array( 'variables' => array( 'transaction' => null ), // data returned from fulcrm API
'template' => 'fulcrm_shoppingcart_transaction_complete',
),
'fulcrm_shoppingcart_transaction_incomplete' => array( 'variables' => array( 'transaction' => null ), // data returned from fulcrm API
'template' => 'fulcrm_shoppingcart_transaction_incomplete',
),
'fulcrm_shoppingcart_transaction_mailshots' => array( 'variables' => array( 'transaction' => null ), // data returned from fulcrm API
'template' => 'fulcrm_shoppingcart_transaction_mailshots',
),
@ -377,6 +380,10 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form( $form, &$form_state, $pe
'#markup' => '<h3>' . check_plain( $product[ 'name' ] ) . '</h3>',
);
drupal_set_title( check_plain( $eventbookingtype[ 'event' ][ 'name' ] ) . ', ' .
check_plain( $eventbookingtype[ 'name' ] ) . ', ' .
check_plain( $product_data[ 'data' ][ 'name' ] ) );
// $form[ 'person' ] = fulcrm_collection_to_form( 'person', $eventbookingtype[ 'person_ddatacollection' ], $person[ 'd' ] );
if ( array_key_exists( 'name', $person ) )
@ -472,6 +479,8 @@ function fulcrm_shoppingcart_buy_generic_product_form( $form, &$form_state, $per
'#markup' => '<h3>' . check_plain( $product[ 'name' ] ) . '</h3>',
);
drupal_set_title( check_plain( $product_data[ 'data' ][ 'name' ] ) );
$form[ 'actions' ] = array( '#type' => 'actions' );
$form[ 'actions' ][ 'save' ] = array( '#type' => 'submit',
'#value' => t('Add to Cart'),
@ -769,7 +778,7 @@ function fulcrm_shoppingcart_checkout_failure( $transaction_id, $hmac ) {
}
foreach ( $hook_results as $hook_result )
return $hook_result;
return 'failure';
return theme( 'fulcrm_shoppingcart_transaction_complete', array( 'transaction' => $transaction_data[ 'data' ] ) );
}
}