0

I have a problem in a payment solution I have made. In this, I use ereg to extract a returned Transaction ID from the payment provider, and with PHP 5.3 this does not work anymore. The code used was:

ereg('<TransactionId>(.+)</TransactionId>',$resultat_3,$c);

I have tried to use this instead: (but it doesn't work)

preg_match("/<TransactionId>(.+)<\/TransactionId>/",$resultat_3,$c);

Does anybody have an idea what to do?

Edited by kaiwahl: Corrected spelling

2
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by diafol
0

Hmm, the pattern seems to work for me.

"fsbefrb<TransactionId>Help me</TransactionId>s;bmfefb" gave 'Help me' with the pattern you supplied.

0

OK, thanks. So, something else must be wrong, then. Do you see anything wrong with the rest of my code for making the registry call and extracting the answer as $transactionid?:

        $ch = curl_init ();         
        $payment_url = "https://MyPaymentProvider.com";
        curl_setopt( $ch , CURLOPT_SSL_VERIFYPEER , false );
        curl_setopt( $ch , CURLOPT_SSL_VERIFYHOST , false );
        curl_setopt( $ch, CURLOPT_URL, $payment_url);
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);

        $resultat_3 = curl_exec ($ch);
        curl_close($ch);

        preg_match('/<TransactionId>(.+)<\/TransactionId>/',$resultat_3,$c);

        $transactionid=$c[1];
1
echo htmlentities($resultat_3);

Do that and then search for '<TransactionId>' with the browser's search-in-page. You won't find it. The page looked like normal html to me as opposed to xml.

0

So, it's the registry call at my payment provider that has stopped working then?

echo htmlentities($resultat_3);

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.