Hi
I am having trouble working out how to instantiate a class. Which class to instantiate is chosen on the fly, by combining a string and a GET variable.
Examples of $_GET['ipn'] might be 'nochex' or 'worldpay', each of which needs a seperate class calling.
require_once( 'payment_' . $_GET['ipn'] . '.class.php' );
$payment = new {'payment_' . $_GET['ipn']}( $this ); // this is the line that doesn't work
$payment->_process_ipn();
I've also tried the following without success
require_once( 'payment_' . $_GET['ipn'] . '.class.php' );
eval('$payment = new payment_' . $_GET['ipn'] . '( $this )' ); // this is the line that doesn't work
$payment->_process_ipn();
Any ideas?
voidstate