Hello. On my website I receive an array of payment data.
The following code:
Produces the following (fake payment info):
I'm also able to display indidividual items from within this array. They are numbered upwards from 0.
So:
Response.Write queryStringData(0) writes: VendorTxCode=83029
Response.Write queryStringData(3) writes: StatusDetail=Successful.
e.t.c
What I need to do however is search the array and find out which item contains a particular string. The items within the array are not always received in the same order so I cannot simply always choose item 5 for example.
If we take BankAuthCode it is currently in position 16. Sometimes however it appears in position 15.
Am I able to search the array for the string BankAuthCode and then identify which item that string is in?
If I'm able to identify the string in item 15 I can then set it as my new variable:
e.g.
I hope that is clear. Appreciate any responses.
The following code:
Code:
For Each queryStringItem in queryStringData
Response.Write queryStringItem
Response.Write "<br />"
Next
Produces the following (fake payment info):
Code:
VendorTxCode=83029
VPSTxId={20CED47D}
Status=OK
StatusDetail=Successful.
TxAuthNo=13981
AVSCV2=DATA NOT CHECKED
AddressResult=NOTPROVIDED
PostCodeResult=NOTPROVIDED
CV2Result=NOTPROVIDED
GiftAid=0
3DSecureStatus=NOTCHECKED
CardType=MC
Last4Digits=1954
Surcharge=0.05
DeclineCode=00
Amount=1.05
BankAuthCode=035892
I'm also able to display indidividual items from within this array. They are numbered upwards from 0.
So:
Response.Write queryStringData(0) writes: VendorTxCode=83029
Response.Write queryStringData(3) writes: StatusDetail=Successful.
e.t.c
What I need to do however is search the array and find out which item contains a particular string. The items within the array are not always received in the same order so I cannot simply always choose item 5 for example.
If we take BankAuthCode it is currently in position 16. Sometimes however it appears in position 15.
Am I able to search the array for the string BankAuthCode and then identify which item that string is in?
If I'm able to identify the string in item 15 I can then set it as my new variable:
e.g.
Code:
***Find "BankAuthCode" in Array
NewVariable = queryStringData(15)
I hope that is clear. Appreciate any responses.