Hi. Does someone have some time to advise me, please? I'm getting a (97) This transaction cannot be accepted." I do not have SSL, so I am using the SIM API.
I am using the sample SIM code. I run it, and get this (97) error. I have been reading that the fingerprint has expired.
My server is in the Pacific Coast USA time zone -- 7 hours behind GMT.
How can I make sure the fingerprint stays current?
I repeat the sample code, below. Thank you for your advice.
best from Eric
<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="xxxxxxxx">
<cfset transactionKey="yyyyyyy">
<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>