@Renaissance @airman81
I agree with @Renaissance that the foreach loop in a red herring. It is basically splitting everything out into just the values in the words array --- so I can't find the field names.
I've displayed everything I can think of displaying, and still can't find anything with the field NAMES!
Referring to my code from previous post, I am getting this for $apiresponse:
1|1|1|(TESTMODE) This transaction has been approved.|000000|P|0|8478||39.00|CC|auth_capture|10001253|Sharon|Shatest||123 Somewhere Street|Anywhere|PA|19666|US|||sharon.shatest@test.com||||||||||||||5E3E841F808768EA1E68EB5800CD0A48|||||||||||||XXXX0002|American Express|||||||||||||||||422E3EF8AA729B89FC102825EA9FEE6DCCB701D861B4248CF24C12600AB1EAF04371257B7163091AFCD883D57C3F9B83424717C7317BCFD90392CE33E87BFCE2
This is the same information I display when I print out the @words array - just the values of the fields and nothing else. And the script currently accesses values by using the @words array, but those positions in the array (like I pull response_code from the zero element) do not match what the API fields in the HMAC SHA-512 Hash documentation in the SIM manual. Without the field names, I'm dead in the water.
AND when I print out the values in @responses as in:
my $response = $useragent->request( $request );
my @responses = split( /$request_values->{x_delim_char}/, $response->content );
foreach $pair(@responses)
{
$debug .= "$pair<br>";
}
I get this (which means it is only printing one character at a time before newline - what the heck?):
1
|
1
|
1
|
(
T
E
S
T
M
O
D
E
)
T
h
i
s
t
r
a
n
s
a
c
t
i
o
n
h
a
s
b
e
e
n
a
p
p
r
o
v
e
d
.
|
0
0
0
0
0
0
|
P
|
0
|
8
4
7
8
|
|
3
9
.
0
0
............. on and on
There just doesn't seem to be any field names being returned. I'm at a complete loss. Maybe I can TRY to figure out what some of the returned values represent (like the name, address, etc) but some of them are codes (like the first 3 are all 1's) and I have no idea what they represent.
How can I get the values in the correct order for hashing if I can't access the field names? When I get a cgi response - not used here - I use $query->param('fieldname') -- would I do something similar here, and if so, what do I use instead of $query->param based on my code in the prior post?
I am way out of my league here. You all have been very patient, but I'm lost.