As for storing the payment method, I would do so in the head of the order by modifying the shopaccounthandler, or creating a new one as an extension. You could then test against this value in your second event, and then redirect to the appropriate payment gateway.
You could also store the payment method as an order item, but it doesn't make much sense unless the specific payment method should result in a fee/discount.
Provided that you have stored the payment method as suggested, meaning as an xml attribute in the data_text_1 field of the ezorder table, you could fetch the value doing something like this (please note that this code has not been tested):
However, I haven't be clear about what's my real problem: How would you do the multiplexer (based on what you've extracted from the code) ?
As the real multiplexer isn't able (for what I've understood) to switch on a value like the choosen payment system extracted from the code ?
The only solution I thought of was to put all the payments as events into the same workflow (1, paypal, 2 by check, 3 by worldpay...), and test in each process if the choosen payment system is "me" or if I do nothing and let the next event deal with the order.
I would probably do it a little different. In stead of creating an event to select the payment method, I would create a custome shopaccounthandler and include the selection of the payment method in the same screen where the user registers the order information.
I would then create a custome event to run before checkout including the code posted earlier.
That's a good idea, and once a user has choosen a payment method, that's quite likely he's going to use the same on the next order too.
Ok, I'm going to have a look at how to do a custom shopaccounthandler.
Many thanks.
I'm going to modify my signature to only keep my question about a cache resistant method to exchange parameters between templates : http://www.ez.no/community/forum/...tween_several_parts_blocks_on_a_page
BTW, you gave me the idea of using the signature for a call for help.