Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I read posted data in MX7

Status
Not open for further replies.

MinalMoe

IS-IT--Management
Mar 25, 2004
62
GB
The following code is an example of data that is posted back to a coldfusion page.

instId=38290&email=tiq%40uk.worldpay.com&transTime=999178402000&country=GB&
rawAuthCode=A&amount=14.99&installation=38290&tel=0123+456789012&address=
Test+Road%0D%0ATest+Town%0D%0ATest+City&futurePayId=76486&MC_log=2379&raw
AuthMessage=authorised+(testMode+always+Yes)&authAmount=23.11&amountString
=%26%23163%3B14.99&cardType=Visa&AVS=0001&cost=14.99&currency=GBP&testMode
=100&authAmountString=EUR23.11&fax=01234+5678901&lang=en&transStatus=Y&
compName=
Ian+Richardson&authCurrency=EUR&postcode=AB1+2CD&authCost=23.11&desc=Test+
Item&
countryMatch=S&cartId=Test+Item&transId=12227758&callbackPW=38290&M_var1=
fred&
authMode=E&countryString=United+Kingdom&name=WorldPay+Test

How do I read it?
 
In all web languages variables come in key-value pairs, and this is the same here. all of the above items have a variable name(key) and a value associated.

I assume the above is posted back to you from Worldpay, so it will be in the URL scope. for the variable instId you would use the following:

Code:
<cfoutput>
  #url.instId#
</cfoutput>

if you wanted to see all of the values then you could use the cfdump function, like this:

Code:
<cfdump var="#url#">

or to output all of the variables:

Code:
<cfoutput>
  <cfloop collection="#URL#" item="i">
    #i#&nbsp;&nbsp;#URL[i]#<br />
  </cfloop>
</cfoutput>

Hope this helps!

Tony
 
Thanks for your help.

I ran a test payment, and then went to my Callback page, into which I had entered the <cfoutput> code and the <cfdump> code.

All I saw was an empty structure.

The various parameters separated by the & are not being read.

The other point I am worried about, is how do I know that follow-through action will occur and that code will be activated by a successful credit card transaction.

 
You say that it is posted back to your server, so i assumed it was via a url, is it via a form from the worldpay system?

Do a dump of the form scope:
<cfdump var="#Form#">

see if it is in that scope instead.

If you have debugging turned on, on your server you might see all of the values at the bottom of your call back page, in the debugging area.

your other question is really one for WorldPay tech support

Hope this helps!

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top