Error 97s occur when we receive an invalid timestamp from your Web server. Your Web server would use its clock to generate a timestamp which is used to generate a fingerprint hash for security reasons. When your script submits a transaction to us, the fingerprint hash and the timestamp are sent to us. If the timestamp is either fifteen minutes ahead or fifteen minutes behind the current time in Greenwich Mean Time (GMT)--also called Coordinated Universal Time (UTC)--this error would occur.
<cfsetting enablecfoutputonly="true">
<cfoutput>
<!--
This sample code is designed to connect to Authorize.net using the SIM method.
For API documentation or additional sample code, please visit:
http://developer.authorize.net
Most of this page below (and including) this comment can be modified using any
standard html. The parts of the page that cannot be modified are noted in the
comments. This file can be renamed as long as the file extension remains .cfm
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML lang='en'>
<HEAD>
<TITLE> Sample SIM Implementation </TITLE>
</HEAD>
<BODY>
<!-- This section generates the "Submit Payment" button using Coldfusion -->
</cfoutput>
<!--- the parameters for the payment can be configured here --->
<!--- the API Login ID and Transaction Key must be replaced with valid values --->
<cfset loginID="xxxx">
<cfset transactionKey="xxxx">
<cfset amount="19.99">
<cfset description="Sample Transaction">
<cfset label="Submit Payment"> <!--- This is the label on the 'submit' button --->
<cfset testMode="false">
<cfset posturl="https://secure.authorize.net/gateway/transact.dll">
<!--- If an amount or description were posted to this page, the defaults are overidden --->
<cfif IsDefined("FORM.amount")>
<cfset amount=FORM.amount>
</cfif>
<cfif IsDefined("FORM.description")>
<cfset description=FORM.description>
</cfif>
<!--- also check to see if the amount or description were sent using the GET method --->
<cfif IsDefined("URL.amount")>
<cfset amount=URL.amount>
</cfif>
<cfif IsDefined("URL.description")>
<cfset description=URL.description>
</cfif>
<!--- an invoice is generated using the date and time --->
<cfset invoice=DateFormat(Now(),"yyyymmdd") & TimeFormat(Now(),"HHmmss")>
<!--- a sequence number is randomly generated --->
<cfset sequence=RandRange(1, 1000)>
<!--- a timestamp is generated --->
<cfset timestamp=DateDiff("s", "January 1 1970 00:00", DateConvert('local2UTC', Now())) >
<!--- The following lines generate the SIM fingerprint --->
<cf_hmac data="#loginID#^#sequence#^#timestamp#^#amount#^" key="#transactionKey#">
<cfset fingerprint=#digest#>
<cfoutput>
<!--- Print the Amount and Description to the screen.--->
Amount: #amount# <br />
Description: #description# <br />
<!--- Create the HTML form containing necessary SIM post values --->
<FORM method='post' action='#posturl#' >
<!--- Additional fields can be added here as outlined in the SIM integration
guide at http://developer.authorize.net --->
<INPUT type='hidden' name='x_login' value='#loginID#' />
<INPUT type='hidden' name='x_amount' value='#amount#' />
<INPUT type='hidden' name='x_description' value='#description#' />
<INPUT type='hidden' name='x_invoice_num' value='#invoice#' />
<INPUT type='hidden' name='x_fp_sequence' value='#sequence#' />
<INPUT type='hidden' name='x_fp_timestamp' value='#timeStamp#' />
<INPUT type='hidden' name='x_fp_hash' value='#fingerprint#' />
<INPUT type='hidden' name='x_test_request' value='#testMode#' />
<INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' />
<input type='submit' value='#label#' />
</FORM>
<!-- This is the end of the code generating the "submit payment" button. -->
</BODY>
</HTML>
<!-- The last line is a necessary part of the coldfusion script -->
</cfoutput>
The best way is to edit your jvm.config file add it to the jvm arguments section. Â Make a backup copy first! For single server installs the file's located: C:\ColdFusion9\runtime\bin\jvm.confi g). Save the settings and restart CF.
# Arguments to VM java.args=-server -Xmx512m -Duser.timezone="your tz ID goes here" ... other settings
http://forums.adobe.com/thread/552963?tstart=0
<!--- an invoice is generated using the date and time --->
<cfset invoice=DateFormat(Now(),"yyyymmdd") & TimeFormat(Now(),"HHmmss")>
<!--- a sequence number is randomly generated --->
<cfset sequence=RandRange(1, 1000)>
<!--- a timestamp is generated --->
<!--- old cfset timestamp --->
<!---<cfset timestamp=DateDiff("s", "January 1 1970 07:00", DateConvert('local2UTC', Now())) >--->
<!--- new cfset timestamp, per _agx_ --->
<cfset timestamp = dateConvert("local2Utc", now() )>
<!--- The following lines generate the SIM fingerprint --->
<cf_hmac data="#loginID#^#sequence#^#timestamp#^#amount#^" key="#transactionKey#">
<cfset fingerprint=#digest#>
which means (according to them) that my server is still outputting a Pacific Time timestamp
<cfoutput>
now #now()#<br>
gmt #dateConvert("local2utc", now())#<br>
</cfoutput>
<cfset prop =createObject('java', 'java.lang.System').getProperties()>
<cfdump var="user.timezone = #prop['user.timezone']#">
<cfdump var="#GetTimeZoneInfo()#">
> I am a little nervous about changing the JVM config file
<cfsetting enablecfoutputonly="true">
<cfoutput>
<!--
This sample code is designed to connect to Authorize.net using the SIM method.
For API documentation or additional sample code, please visit:
http://developer.authorize.net
Most of this page below (and including) this comment can be modified using any
standard html. The parts of the page that cannot be modified are noted in the
comments. This file can be renamed as long as the file extension remains .cfm
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML lang='en'>
<HEAD>
<TITLE> Sample SIM Implementation </TITLE>
</HEAD>
<BODY>
<!-- This section generates the "Submit Payment" button using Coldfusion -->
</cfoutput>
<!--- the parameters for the payment can be configured here --->
<!--- the API Login ID and Transaction Key must be replaced with valid values --->
<cfset loginID="xxxxxx">
<cfset transactionKey="yyyyyy">
<cfset amount="19.99">
<cfset description="Sample Transaction">
<cfset label="Submit Payment"> <!--- This is the label on the 'submit' button --->
<cfset testMode="false">
<cfset posturl="https://secure.authorize.net/gateway/transact.dll">
<!--- If an amount or description were posted to this page, the defaults are overidden --->
<cfif IsDefined("FORM.amount")>
<cfset amount=FORM.amount>
</cfif>
<cfif IsDefined("FORM.description")>
<cfset description=FORM.description>
</cfif>
<!--- also check to see if the amount or description were sent using the GET method --->
<cfif IsDefined("URL.amount")>
<cfset amount=URL.amount>
</cfif>
<cfif IsDefined("URL.description")>
<cfset description=URL.description>
</cfif>
<!--- an invoice is generated using the date and time --->
<cfset invoice=DateFormat(Now(),"yyyymmdd") & TimeFormat(Now(),"HHmmss")>
<!--- a sequence number is randomly generated --->
<cfset sequence=RandRange(1, 1000)>
<!--- a timestamp is generated --->
<!--- old cfset timestamp --->
<!---<cfset timestamp=DateDiff("s", "January 1 1970 07:00", DateConvert('local2UTC', Now())) >--->
<!--- new cfset timestamp, per _agx_ --->
<cfset timestamp = dateConvert("local2Utc", now() )>
<!--- The following lines generate the SIM fingerprint --->
<cf_hmac data="#loginID#^#sequence#^#timestamp#^#amount#^" key="#transactionKey#">
<cfset fingerprint=#digest#>
<cfoutput>
<!--- Print the Amount and Description to the screen.--->
Amount: #amount# <br />
Description: #description# <br />
<!--- Create the HTML form containing necessary SIM post values --->
<FORM method='post' action='#posturl#' >
<!--- Additional fields can be added here as outlined in the SIM integration
guide at http://developer.authorize.net --->
<INPUT type='hidden' name='x_login' value='#loginID#' />
<INPUT type='hidden' name='x_amount' value='#amount#' />
<INPUT type='hidden' name='x_description' value='#description#' />
<INPUT type='hidden' name='x_invoice_num' value='#invoice#' />
<INPUT type='hidden' name='x_fp_sequence' value='#sequence#' />
<INPUT type='hidden' name='x_fp_timestamp' value='#timeStamp#' />
<INPUT type='hidden' name='x_fp_hash' value='#fingerprint#' />
<INPUT type='hidden' name='x_test_request' value='#testMode#' />
<INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' />
<input type='submit' value='#label#' />
</FORM>
<!-- This is the end of the code generating the "submit payment" button. -->
</BODY>
</HTML>
<!-- The last line is a necessary part of the coldfusion script -->
</cfoutput>
# Arguments to VM
java.args=-server -Xmx512m -Duser.timezone=America/New_York -Dsun.io.useCanonCaches=false
# Arguments to VM
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Djava.security.policy={application.home}/../lib/coldfusion.policy -Djava.security.auth.policy={application.home}/../lib/neo_jaas.policy -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars,{application.home}/../wwwroot/WEB-INF/flex/jars -Dcoldfusion.libPath={application.home}/../lib
# Arguments to VM
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Djava.security.policy={application.home}/../lib/coldfusion.policy -Djava.security.auth.policy={application.home}/../lib/neo_jaas.policy -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars,{application.home}/../wwwroot/WEB-INF/flex/jars -Dcoldfusion.libPath={application.home}/../lib
-Duser.timezone=America/New_York -Dsun.io.useCanonCaches=false
# Arguments to VM
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Djava.security.policy={application.home}/../lib/coldfusion.policy -Djava.security.auth.policy={application.home}/../lib/neo_jaas.policy -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars,{application.home}/../wwwroot/WEB-INF/flex/jars -Dcoldfusion.libPath={application.home}/../lib
# Arguments to VM
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Djava.security.policy={application.home}/../lib/coldfusion.policy -Djava.security.auth.policy={application.home}/../lib/neo_jaas.policy -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars,{application.home}/../wwwroot/WEB-INF/flex/jars -Dcoldfusion.libPath={application.home}/../lib
# Arguments to VM
java.args=-server -Xms256m -Xmx512m -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.home={application.home} .... etctera ....
# Arguments to VM
java.args=-server -Xms256m -Xmx512m -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Duser.timezone=GMT -Dcoldfusion.home={application.home} .... etctera ....
# Arguments to VM
java.args=-server -Xmx512m -XX:MaxPermSize=192m -XX:+UseParallelGC -Duser.timezone=America/New_York -Dsun.io.useCanonCaches=false -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Djava.security.policy={application.home}/../lib/coldfusion.policy -Djava.security.auth.policy={application.home}/../lib/neo_jaas.policy -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars,{application.home}/../wwwroot/WEB-INF/flex/jars -Dcoldfusion.libPath={application.home}/../lib
Yes and no. Â CF gets the time from the JVM. The JVM time is based on the server o/s, but it can be changed to use a different timezone. For example, some hosts add JVM arguments to change the time zone to GMT/UTC, so everyone is using the same time.
         -Duser.timezone=GMT
That means if you are on the East Coast, the time returned by now() will several hours ahead of what you were expecting. Â I don't know if you have access to createObject("java"). If not, try dumping the TZ information:
    <cfdump var="#GetTimeZoneInfo()#">