Drupal Commerce payment transaction: execute script and pass variables
the transaction is meant to be created on a successful response of your provider (this could be payed, denied or whatever), usually an IPN.
meaning you have to provide a MENU_CALLBACK item in hook_menu.
most likely information about the order will be posted, make sure you get the order id back.

if you really want that on the payment form submission, just call the method (commerce_payment_ideal_transaction) in the hook_redirect_form. the question here is, how do you decide if a payment was successful or not ;)