Reply
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is response code the same for AIM and CIM

Yes they are the same.

Regular Contributor
Posts: 82
Registered: ‎02-15-2013

Re: Is response code the same for AIM and CIM

[ Edited ]

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>

 

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is response code the same for AIM and CIM

The same way you do it for AIM.

Regular Contributor
Posts: 82
Registered: ‎02-15-2013

Re: Is response code the same for AIM and CIM

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.

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is response code the same for AIM and CIM

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.

Regular Contributor
Posts: 82
Registered: ‎02-15-2013

Re: Is response code the same for AIM and CIM

[ Edited ]

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;

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is response code the same for AIM and CIM

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;

Regular Contributor
Posts: 82
Registered: ‎02-15-2013

Re: Is response code the same for AIM and CIM

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.

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is response code the same for AIM and CIM

what do you get when you do that

echo $xml->directResponse;

Solution
Accepted by topic author mallen
‎08-21-2015 01:58 AM
Regular Contributor
Posts: 82
Registered: ‎02-15-2013

Re: Is response code the same for AIM and CIM

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] .