Monday, 12 August 2013

Acessing array inside form variable sent

Acessing array inside form variable sent

I`m working with PayPal and I need this block of code to read the post
Payment Responses of API:
<cfif StructKeyExists(FORM.TRANSACTION[0],"ID_FOR_SENDER_TXN")>
<cfset pTxnId = FORM.TRANSACTION[0].ID_FOR_SENDER_TXN />
</cfif>
But when I runs the payment response test tool, I got this error: 500
Element TRANSACTION is undefined in a Java object of type class
[Ljava.lang.String;.
I used this loop:
<cfloop collection="#form#" item="theField">
<cfif theField is not "fieldNames">
#theField# = #form[theField]#<br>
</cfif>
</cfloop>
to see the variables sent in FORM and the variables is like this:
TRANSACTION[0].ID_FOR_SENDER_TXN
TRANSACTION[0].IS_PRIMARY_RECEIVER
TRANSACTION[0].RECEIVER TRANSACTION[0].AMOUNT
TRANSACTION[0].STATUS_FOR_SENDER_TXN
I don't know why I can't access this.

No comments:

Post a Comment