Link to home
Start Free TrialLog in
Avatar of RickEpnet
RickEpnetFlag for United States of America

asked on

Authorize.Net

Below you will find my code.
I am using Coldfusion. My Error is

X_RESPONSE_CODE 3
X_RESPONSE_REASON_CODE 97

Error code 97 says this
Applicable only to SIM API. Fingerprints are only valid for a short period of time. This code indicates that the transaction fingerprint has expired.
<cfset timestamp=DateDiff("s", "January 1 1970 00:00", DateConvert('local2UTC', Now())) >
<cfset x_exp_date = Month & Year>
<cfset loginID = "XXXXXXXXXXX">
<cfset sequence = orderHeader.orderid>
<cfset amount = orderHeader.total>
<cfset transactionKey = "XXXXXXXXXXXXXXXX">
<cf_hmac data="#loginID#^#sequence#^#timestamp#^#amount#^" key="#transactionKey#">
<cfset fingerprint=#digest#> 


Post Submitted

<CFHTTP URL="https://test.authorize.net/gateway/transact.dll" method="post" delimiter="," resolveurl="yes" redirect="yes">
<cfhttpparam type="formfield" name="x_card_code" value="#x_card_code#">
<cfhttpparam type="formfield" name="x_exp_date" value="#x_exp_date#">
<cfhttpparam type="formfield" name="x_card_num" value="#x_card_num#">
<cfhttpparam type="formfield" name="X_ADDRESS" value="#orderHeader.address#">
<cfhttpparam type="formfield" name="X_CITY" value="#orderHeader.city#">
<cfhttpparam type="formfield" name="X_STATE" value="#orderHeader.st#">
<cfhttpparam type="formfield" name="X_ZIP" value="#orderHeader.zip#">
<cfhttpparam type="formfield" name="x_amount" value="#amount#">
<cfhttpparam type="formfield" name="x_freight" value="#orderHeader.fright#">
<cfhttpparam type="formfield" name="x_tax" value="#orderHeader.tax#">
<cfhttpparam type="formfield" name="x_invoice_num" value="#orderHeader.orderid#">
<cfhttpparam type="formfield" name="x_tax" value="#orderHeader.tax#">
<cfhttpparam type="formfield" name="x_relay_response" value="TRUE">
<cfhttpparam type="formfield" name="x_relay_url" value="https://www.xxxxxxx.com/payment/paymentresp.cfm">
<cfhttpparam type="formfield" name="x_login" value="#loginID#">
<cfhttpparam type="formfield" name="x_fp_sequence" value="#sequence#">
<cfhttpparam type="formfield" name="x_fp_timestamp" value="#timestamp#">
<cfhttpparam type="formfield" name="x_fp_hash" value="#fingerprint#">
<cfhttpparam type="formfield" name="x_version" value="3.1">
<cfhttpparam type="formfield" name="x_method" value="CC">
<cfhttpparam type="formfield" name="x_type" value="AUTH_CAPTURE">
<cfhttpparam type="formfield" name="x_test_request" value="FALSE">
<cfhttpparam type="formfield" name="x_transml" value="#oid#">
</cfhttp>

Open in new window

Avatar of gdemaria
gdemaria
Flag of United States of America image

seems to be an error returned by authorize.net indicating that your session had expired

Avatar of RickEpnet

ASKER

Ok I do not think it is that but I am willing to try. How do I fix that? The transaction happens in less that 5 sec.
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok I tested something but it does not make any sense to me why it worked.

See my script below. This should convert my time to UTC time yet it does not. If I add 3600 Sec to it (1 hour) it works. My server has the correct time I checked. It has the correct time even for daylight savings time. The server has the exact right time it gets it time from 2.north-america.pool.ntp.org and 1.north-america.pool.ntp.org.

Why would it be an hour off.
<cfset timestamp=DateDiff("s", "January 1 1970 00:00", DateConvert('local2UTC', Now())) >

Open in new window

Although this was not complete it did lead me in the right direction. Basically I switched methods to AIM.