Payment return handling

Hi,

I have created a custom payment module for france.
The tutorial about alertpay has been very useful:
http://devzone.zend.com/article/7525-Accepting-Credit-Card-Payments-with-OXID-eShop-CE-and-AlertPay

I can send request to the gateway, and get response, using the url/function mapping with SEO.

My problem is with updating order status and saving it. How do i perform these actions?
I thought this would be sufficient to update an order status and empty basket:


class myclassOrder extends myclassOrder_parent {
...

	protected function _getNextStep($iSuccess)
	{    
                        $oOrder = oxNew('oxorder');
			if ($iSuccess == 1) 
			{
                                // set order status to OK
				$oOrder->oxorder__oxtransstatus = new oxField('OK');
				$oOrder->save(); 			
			} 
       }

...
}


Unfortunately its not the case. My orders list stays empty and the basket still contains the ordered producs.

Could you help me understand how to process the order after payment (success)?
Thanks a lot for your anwers.

here is the complete class, just in caseā€¦






class myclassOrder extends myclassOrder_parent {

  protected $_sThisTemplate = 'myclass.tpl';
    public function render()
    {
        parent::render();
		// get current language
		$lang = oxLang::getInstance()->getLanguageAbbr();
		//get and pass basket amount
		$oBasket = $this->getBasket();    
		$dAmount = $oBasket->getPrice()->getBruttoPrice();
		$this->_aViewData['amount']            = $dAmount;
		$this->_aViewData['return_url']        = 'http://www.mysite.fr/'.$lang.'/myclass-return/?sid=' . $this->getSession()->getId();
		
        return $this->_sThisTemplate;
    }
	
	protected function _getNextStep($iSuccess)
	{    
		 $oOrder = oxNew('oxorder');

			if ($iSuccess == 1) 
			{
				// if  return
				// set order status to OK
				$oOrder->oxorder__oxtransstatus = new oxField('OK');
				$oOrder->save(); 
				$oBasket = $this->getBasket();    
				$oUser = $this->getUser();    
			} 
			else if ($iSuccess == 0) 
			{
				$oOrder->delete();
				$iSuccess = 'An error has occured.Please contact the website administrator for more information'; 
			}     
		
		return parent::_getNextStep($iSuccess);
	}

    // handles return action
	public function processMyclassReturn()
	{
		$iSuccess = 1;
		return $this->_getNextStep($iSuccess); 
	}
	
	//handles cancel action
	public function processMyclassCancel()
	{
		$iSuccess = 0;
		return $this->_getNextStep($iSuccess); 
	}

}