Is the response code the same for AIM and CIM? I have a AIM shopping cart and it checks if "1" or "4" is returned. But in my CIM method it returns "I001" ok.
Solved! Go to Solution.
โ03-14-2013 10:48 AM
Yes they are the same.
โ03-26-2013 08:46 AM
Great thanks. So in this sample below. How can I refrence it. Is it ResponseCode or responseCode? If I wanted to print just the "1" or check the value it.
<directResponse>1,1,1,This transaction has been approved.,000000,Y,2000000001,INV000001,description of transaction,10.95,CC,auth_capture,custId123,John,Doe,,123 Main St.,Bellevue,WA,98004,USA,000-000-0000,,mark@example.com,John,Doe,,123 Main St.,Bellevue,WA,98004,USA,1.00,0.00,2.00,FALSE,PONUM000001, D18EB6B211FE0BBF556B271FDA6F92EE,M,2,,,,,,,,,,,,,,,,,,,,,,,,,,,, </directResponse>
โ03-26-2013 11:34 AM - edited โ03-26-2013 11:35 AM
The same way you do it for AIM.
โ03-26-2013 12:12 PM
I'm doing a <createCustomerProfileTransactionRequest> and I get back
<directResponse>1,1,1,This transaction has been approved.,abcd,Y,2156665,INV000001,description of transaction......
So I don't know how to get the individual parts of this tag.
โ03-26-2013 01:14 PM
When you run AIM, it return 1,1,1,This transaction has been approved.,abcd,Y,2156665,INV000001,description of transaction...... so just do it the same.
โ03-26-2013 04:10 PM
Thanks. But I am not using AIM. I am using CIM. So I cannot get the response like this<directResponse>1</directResponse> when it has a string of other information in it "1,1,1,This transaction has been approved.,abcd,Y,2156665,INV000001" I am using the CIM examples from here. Maybe that will make it more clear what I am doing. https://github.com/stymiee/Authorize.Net-XML/blob/master/examples/cim/createCustomerProfileTransacti...
So I can't echo $xml->messages->message->directResponse;
โ03-29-2013 06:48 AM - edited โ03-29-2013 07:03 AM
by looking at this
?xml version="1.0" encoding="utf-8"?> <createCustomerProfileTransactionResponse xmlns="AnetApi/xml/v1/schema/ AnetApiSchema.xsd"> <messages> <resultCode>Ok</resultCode> <message> <code>I00001</code> <text>Successful.</text> </message> </messages> <directResponse>1,1,1,This transaction has been approved.,000000,Y,2000000001,INV000001,description of transaction,10.95,CC,auth_capture,custId123,John,Doe,,123 Main St.,Bellevue,WA,98004,USA,000-000-0000,,mark@example.com,John,Doe,,123 Main St.,Bellevue,WA,98004,USA,1.00,0.00,2.00,FALSE,PONUM000001, D18EB6B211FE0BBF556B271FDA6F92EE,M,2,,,,,,,,,,,,,,,,,,,,,,,,,,,, </directResponse> </createCustomerProfileTransactionResponse>
could it be
echo $xml->directResponse;
โ03-29-2013 07:30 AM
Ok. So I can do these:
echo $xml->messages->message->code //Ok echo $xml->messages->resultCode // I00001 echo $xml->messages->message->text //Successful
But I can't get parts of the directResponse.
โ03-29-2013 07:36 AM
what do you get when you do that
echo $xml->directResponse;
โ03-29-2013 07:48 AM
I got it finally. I wasn't sire how to get the individual values of the string. Here it is. I tested it and can get any value now by changing the number in [0].
$splitted = explode(',', $xml->directResponse);
echo $splitted[0] .
โ03-29-2013 07:57 AM