Parse response from payment server - How?

  HighTower 15:46 19 Jul 2006

I'm building an e-commerce site which has to integrate with a payment provider not on the supported list of the scripts I am using. As such I must manually integrate rather than have the luck of using a Dreamweaver wizard.

So far I've build the cart and all is fine, and I know where I need to send the http post to so that the payment gateway can do its magic. However, on completion of the transaction the payment gateway sends my back a response which a script (that I have to write) will parse. The details in this response include all details from the payment, whether it has been successful etc. I combine this with session variables (which includes details of the purchase) and insert into a database and send a mail informing customers and merchants that a transaction has taken place.


Except - how do I parse this string that is sent back? Never done this before - don't know where to start! Am using Dreamweaver if that makes things any easier.


  harristweed 17:45 19 Jul 2006

php can read most things. Do you have a example of the returned responce, so we can advise?

I'm not sure what help Dreamweaver can offer in this situation. I guess very little!

  HighTower 09:36 20 Jul 2006

This is the example they provide in the documentation:

VPResponseCode=00&VPCrossReference=04100514165800502449&VPMessage=AUTHCODE:00502&VPTransactionUnique=VP ORDER-123456789&VPOrderDesc=VPORDER-123456789&VPBillingCountry=826&VPCardName=Test CardName&VPBillingPostCode=HA67HJ&VPBillingEmail=[email protected]&VPBillingPhoneNumber=0208 9770657&VPAmountReceived=1299&VPAVSCV2ResponseCode=222100&VPCV2ResultMessage=CV2 Matched&VPAVSResultMessage=PostcodeMatched&VPAVSAddressMessage=Address Numeric Matched&VPCardType=VD&VPBillingAddress=Unit 5 Pickwick Walk 120 Uxbridge Road Hatch End Middlesex

Thanks for your help

  harristweed 08:42 21 Jul 2006

That looks like a normal 'name – value pair' string, that is sent via the get or post methods (I guess the finance house would use POST). So you could extract the data using:


However I’d use a function:

function register_globals($form_array)
foreach($form_array as $name => $value)
$GLOBALS[$name] = $value;
//call the function with

This will result in the variables:


(in this case, having the values:

This is a very useful function, I use it for form handling all the time. It works just as well for GET.

Just change

Hope this helps....

  HighTower 16:27 21 Jul 2006

Just picked up your response. Will have a look through it and try it over the weekend with a couple of beers (well, always works for me!).

I appreciate the time you've spend on this, so thanks a lot - I'll let you know how it goes.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Honor 9 Lite review

How Social Media has Propelled Political Graphic Design and Art in the Last Decade

The best kids apps for iPhone & iPad 2018

HomePod d’Apple : date de sortie, prix et fiche technique