cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Is response code the same for AIM and CIM

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.

mallen
Regular Contributor
19 REPLIES 19

Yes they are the same.

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>

 

mallen
Regular Contributor

The same way you do it for AIM.

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.

mallen
Regular Contributor

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.

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;

mallen
Regular Contributor

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;

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.

mallen
Regular Contributor

what do you get when you do that

echo $xml->directResponse;

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

mallen
Regular Contributor