?
Solved

Authorize.Net

Posted on 2011-03-16
5
Medium Priority
?
785 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:RickEpnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

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

0
 
LVL 14

Author Comment

by:RickEpnet
ID: 35153335
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.
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 1500 total points
ID: 35153381
http://developer.authorize.net/tools/responsecode97/


Response Code 97 indicates that the transaction fingerprint created to authenticate a Simple Integration Method (SIM) transaction has expired. This error is received when the timestamp value submitted in x_fp_timestamp is either 15 minutes ahead, or 15 minutes behind in Greenwich Mean Time (GMT) (this is the equivalent of 900 seconds ahead or 900 seconds behind in Coordinated Universal Time, or UTC).

The Response Code 97 troubleshooting tool validates whether the value you submitted to Authorize.Net for x_fp_timestamp is a valid timestamp. Valid timestamps must be formatted in UTC, which is the number of seconds since 12 AM, January 1, 1970.

To troubleshoot a Response Code 97, check the following:

Verify that the time on the Web server that hosts the SIM script is configured correctly to the GMT time zone. You can also modify the SIM script to format UTC.
If you are having consistent problems with your timestamp, make sure that the Web server that hosts your SIM script employs a Network Time Protocol (NTP) to regularly update the time.
Be sure to account for daylight savings time.
0
 
LVL 14

Author Comment

by:RickEpnet
ID: 35153422
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

0
 
LVL 14

Author Closing Comment

by:RickEpnet
ID: 35156080
Although this was not complete it did lead me in the right direction. Basically I switched methods to AIM.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question