I had in mind the following logic:
1) user selects the event, enters their personal details etc, then clicks on submit
2) 2nd form appears, with a radio button group for payment type. User selects their payment method and enters a membership number if appropriate, then clicks submit.
3) Your script checks the value of the radio button group. If its paypal, it issues a http redirect to paypal, or displays a 'now being redirected to paypal' page then redirects to paypal, and sends the confirmation of booking emails. Otherwise, it sends the confirmation emails and displays a 'thank you' type page.
You could also look at opening a new window to redirect to paypal, and displaying the 'thank you' in the main window, although these days a lot of browsers will refuse a popup.
By 'do the paypal transaction outside the perl script' I take it you mean that you can't gather the users paypal account information in your own form and handle the paypal transaction yourself? I think you're right, the user has to interact with paypal themselves, although I don't know this for certain.
Using this process, you only need a single submit button, rather than a submit for two of the payment types, and a separate paypal button (as long as there's nothing else forcing you to create a separate button).
|