cancel
Showing results for 
Search instead for 
Did you mean: 

Returning transaction ID for CIM

I am setting up my script with the CIM API.

 

My question is, is there a way to return the transaction id for the transaction what was just processed?

 

I have this at the end so far:

if ($cim->isSuccessful())
{
$approval_code = $cim->getAuthCode();

}

// Print the results of the request
echo '<strong> Response Summary:</strong> ' .
$cim->getResponseSummary() . '';
echo '<strong>Approval code:</strong> ' . $approval_code;

}

 

But that doesnt give me anything on the transaction id. I need that number and write to my database, so if I can't get the trans id this way, is there a better/different way to get it?

 

Thank you.

afwebworks99
Member
4 REPLIES 4

The transactionID should return with the authorization code. Not sure how you do that in php.

RaynorC1emen7
Expert

I get the following for the output:

Request Response Summary: Response code: I00001 Message: Successful.Approval code: EMUXHV

 

 

 

I don't get anything close to the transaction id. Am I requesting the wrong response or something?

afwebworks99
Member

doesn't look like you getting the whole response. It should look like something like page 84 on the xml documentation

http://developer.authorize.net/api/cim/

Hello,

 

I noticed you found your own answer and posted to stackoverflow.  For the benefit of others, I'm going to add your your solution here:

 

$trans_id = $cim->getTransactionID();

 

 

Richard

RichardH
Administrator Administrator
Administrator