public function complete()
    {
        $session = $this
            ->getRequest()
            ->getSession();
        
        $site = SiteConfig::current_site_config();
        $id = $this->request->param('ID');
        $error = ($id == "error") ? true : false;

        if ($error) {
            $return = [
                'Title' => _t('SilverCommerce\Checkout.OrderProblem', 'There was a problem with your order'),
                'Content' => $site->dbobject("PaymentFailerContent")
            ];
        } else {
            $return = [
                'Title' => _t('SilverCommerce\Checkout.ThankYouForOrder', 'Thank you for your order'),
                'Content' => $site->dbobject("PaymentSuccessContent")
            ];
        }

        // Add the paid order data to our completed page
        $return["Invoice"] = $this->getEstimate();

        $this->customise($return);

        // Extend our completion process, to allow for custom
        // completion actions
        $this->extend("onBeforeComplete");

        // Clear our session data
        if (!$error && isset($_SESSION)) {
            $session->clear('Checkout.PaymentMethodID');
            $session->clear('Checkout.EstimateID');
        }

        // If we are using the shopping cart, clear that as well
        if (class_exists(ShoppingCartFactory::class)) {
            ShoppingCartFactory::create()->delete();
        }

        return $this->render();
    }
public function complete()
    {
        $session = $this
            ->getRequest()
            ->getSession();
        
        $site = SiteConfig::current_site_config();
        $id = $this->request->param('ID');
        $error = ($id == "error") ? true : false;

        if ($error) {
            $return = [
                'Title' => _t('SilverCommerce\Checkout.OrderProblem', 'There was a problem with your order'),
                'Content' => $site->dbobject("PaymentFailerContent")
            ];
        } else {
            $return = [
                'Title' => _t('SilverCommerce\Checkout.ThankYouForOrder', 'Thank you for your order'),
                'Content' => $site->dbobject("PaymentSuccessContent")
            ];
        }

        // Add the paid order data to our completed page
        $return["Invoice"] = $this->getEstimate();

        $this->customise($return);

        // Extend our completion process, to allow for custom
        // completion actions
        $this->extend("onBeforeComplete");

        // Clear our session data
        if (!$error && isset($_SESSION)) {
            $session->clear('Checkout.PaymentMethodID');
            $session->clear('Checkout.EstimateID');
        }

        // If we are using the shopping cart, clear that as well
        if (class_exists(ShoppingCartFactory::class)) {
            ShoppingCartFactory::create()->delete();
        }

        return $this->render();
    }
public function complete ( ) { $ session = $ this -> getRequest ( ) -> getSession ( ) ; $ site = SiteConfig :: current_site_config ( ) ; $ id = $ this -> request -> param ( 'ID' ) ; $ error = ( $ id == "error" ) ? true : false ; if ( $ error ) { $ return = [ 'Title' => _t ( 'SilverCommerce\Checkout.OrderProblem' , 'There was a problem with your order' ) , 'Content' => $ site -> dbobject ( "PaymentFailerContent" ) ] ; } else { $ return = [ 'Title' => _t ( 'SilverCommerce\Checkout.ThankYouForOrder' , 'Thank you for your order' ) , 'Content' => $ site -> dbobject ( "PaymentSuccessContent" ) ] ; } // Add the paid order data to our completed page $ return [ "Invoice" ] = $ this -> getEstimate ( ) ; $ this -> customise ( $ return ) ; // Extend our completion process, to allow for custom // completion actions $ this -> extend ( "onBeforeComplete" ) ; // Clear our session data if ( ! $ error && isset ( $ _SESSION ) ) { $ session -> clear ( 'Checkout.PaymentMethodID' ) ; $ session -> clear ( 'Checkout.EstimateID' ) ; } // If we are using the shopping cart, clear that as well if ( class_exists ( ShoppingCartFactory :: class ) ) { ShoppingCartFactory :: create ( ) -> delete ( ) ; } return $ this -> render ( ) ; }
Deal with rendering a completion message to the end user

@return string
Deal with rendering a completion message to the end user