Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help me fix decoding error :) Thanks!
08-13-2012, 03:29 PM (This post was last modified: 08-13-2012 03:32 PM by trytofly.)
Post: #1
Help me fix decoding error :) Thanks!
Hi guys, need help fixing error :

Fatal error: Cannot break/continue 1 level in /home/sks/public_html/skps/classes/payment.php on line 238


$this->setInfo( $lng['payments']['transaction_already_processed'] );
}
else if ( !$this->getManual( ) )
{
line 238: break;
}
else
{
FULL FUNCTION:
Code:
public function process( )
    {
        global $db;
        global $lng;
        if ( $this->payment_processor['recurring'] <= 0 || !$this->pay->isAutoRenew( ) )
        {
            $completed = $db->fetchRow( "select completed from ".TABLE_PAYMENT_ACTIONS." where ukey = '".$this->user_key."'" );
            if ( $completed )
            {
                $this->setInfo( $lng['payments']['transaction_already_processed'] );
            }
            else if ( !$this->getManual( ) )
            {
            break;
            }
            else
            {
                $exists = $db->fetchRow( "select count(*) from ".$this->pay->getRetTable( )." where ukey = '".$this->user_key."'" );
                if ( !$exists )
                {
                    //break;
                    $this->setInfo( $lng['payments']['transaction_already_processed'] );
                }
                else
                {
                break;
                }
            }
        }
        else
        {
            do
            {
                do
                {
                    $this->user_key = "";
                } while ( 0 );
            } while ( 0 );
            $success = $this->pay->process( );
            if ( $success )
            {
                if ( !$this->pending )
                {
                    $this->pending = $this->pay->getPending( );
                }
                $this->paymentDone( );
            }
            else
            {
                $this->setInfo( $lng[$this->processor]['invalid_transaction'] );
            }
        }
    }
Thanks all for helping fix that error Smile
Find all posts by this user
Quote this message in a reply
08-15-2012, 12:34 PM
Post: #2
RE: Help me fix decoding error :) Thanks!
Because you are using break without "switch...case" or looping. You can solve this by changing "break" to "return" to exit from the function.

Enjoy!!! .. all the best... Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | Homepage | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication