Hello fellas/ladies,
I'm trying to solve a seemingly very simple problem, and yes, I've been reading through the php manual until my eyes became sore. I post some information to a payment processor (a formatted XML document faked by creating an array of pre-formatted XML strings), and the payment processor returns me an XML document back.
Now, I've found a way to search for a specific string that I know the possible contents of, namely AUTH, DCL or REF for the status message. The code for that looks like this:
if (eregi("authstatus=\"AUTH\"", $result)) {
$spauthmsg = "AUTH";
} else if (eregi("authstatus=\"DCL\"", $result)) {
$spauthmsg = "DCL";
} else if (eregi("authstatus=\"REF\"", $result)) {
$spauthmsg = "DCL";
}
Ofcourse, the XML document I get back is stored in the $result variable.
Now, I also need to look for some information that changes between every single transaction, namely a transaction id that will be of the form
TRANSID="CC1239842FcdD"
or something similar. Any idea how I can filter out that information? The problem is that there are about 15 strings in the return document that are all enclosed by quotes like this one (although only one starting with TRANSID=" in the beginning) - and the transaction ID code is not necessarily the same length each time, depending on which type of credit card the user has used for his transaction.
Help?
Kind regards,
Henning Pedersen
Funcom Oslo AS