Got "Hello World" example up and running great. But pulling hair out with trying to display errorText for decline:
Here's an untouched snippet from Hello World. You can see if there is an error, we need more info on the reason.
if (($tresponse != null) && ($tresponse->getResponseCode()=="1"))
{
echo "Charge Credit Card AUTH CODE : " . $tresponse->getAuthCode() . "\n";
echo "Charge Credit Card TRANS ID : " . $tresponse->getTransId() . "\n";
}
else
{
echo "Charge Credit Card ERROR : Invalid response\n";
}
}
I can not for the life of me, figure out how to display the errorText and errorCode. I have tried:
echo "Card declined reason: " . $tresponse->getErrors[0]->errorText;
and every possible variation of this you can imagine and nothing works. None of the examples or samples go beyond the "Hello World" example if declined.
I realize this may be 101 coding, but I can't figure this one out.
Thanks