[eluser]bscott[/eluser]
Or you could have getStatus and getErrorMessage methods in your Payment class and use
Code:
$z->chargeCard();
if($z->getStatus() == 'success')
{
echo 'Payment complete';
// further logic pertaining to a successful payment..
}
else
{
echo $z->getErrorMessage();
// further logic pertaining to an failed payment..
}
This way the determination of sucsess/failure and the content of the error is encapsulated in the Payment class and the action taken dependant on the result of the chargeCard method is in the model.