Init(); /*$fh = fopen(FULL_PATH.'/gw.log', 'a'); fwrite ($fh, "\n\n".date('d/m/y h:i:s').":\n"); foreach ($_POST as $key => $val) { fwrite($fh, "\n"); } fclose($fh);*/ $db =& $application->GetADODBConnection(); $application->setUnitOption('ord','AutoLoad',false); $order =& $application->recallObject('ord'); $order_id = $application->GetVar('order_id'); $order->Load( $order_id ); $gw_data = $order->getGatewayData($application->GetVar('payment_type_id')); $application->registerClass( $gw_data['ClassName'], GW_CLASS_PATH.'/'.$gw_data['ClassFile'] ); $gateway_object =& $application->recallObject( $gw_data['ClassName'] ); $transaction_status = $gateway_object->processNotification($gw_data['gw_params']); $sql = 'UPDATE %s SET TransactionStatus = %s WHERE %s = %s'; $db->Query( sprintf($sql, $order->TableName, $transaction_status, $order->IDField, $order->GetID()) ); $order->SetDBField('TransactionStatus', $transaction_status); if($transaction_status == 1) { $dummy_var = '10'; $application->HandleEvent($dummy_var, 'ord:OnCompleteOrder'); } ?>