In working with Paypal's Adaptive Payments API, the response to
the CallPay() function returns an array with items names as such:
$resArray["error(0).errorId"]
$resArray["error(0).message"]
$resArray["error(0).domain"]
$resArray["error(0).severity"]
$resArray["error(0).category"]
There may be more than one error() value, so I also need
to check for error(1)... ,error(2)..., etc.
How can I do this in a loop? I thought about this but not sure
how to count how many error() items there are.
for($i=0;$i<count(?????);$i++) {
$ErrorCode = urldecode($resArray["error($i).errorId"]);
$ErrorMsg = urldecode($resArray["error($i).message"]);
$ErrorDomain = urldecode($resArray["error($i).domain"]);
$ErrorSeverity = urldecode($resArray["error($i).severity"]);
$ErrorCategory = urldecode($resArray["error($i).category"]);
}
echo "Preapproval API call failed. ";
echo "Detailed Error Message: " . $ErrorMsg;
echo "Error Code: " . $ErrorCode;
echo "Error Severity: " . $ErrorSeverity;
echo "Error Domain: " . $ErrorDomain;
echo "Error Category: " . $ErrorCategory;