[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

generate a timestamp to be used for authorize.net processing

Posted on 2005-04-08
10
Medium Priority
?
625 Views
Last Modified: 2016-10-17
Hello,
  I think I may have found a solution to authorize.net sim processing but I need to generate a time stamp to produce the fingerprint.  I am currently using the following code:

<cfset rand_num = rand()>  - although this only produces a random number from 0-1 ... better suggestions?
<cfset time_stamp = TimeFormat(Now())>  
<cfset data="tryaccount123^#rand_num#^#time_stamp#^12.50^">
<cf_hmac data_format="#data#" key_format="#merchant_info.x_tran_key#">

when I send this to test the processing at: http://gatewaylinking.com/echo.php  I get the following:


x_fp_sequence =  0.95313333
x_fp_timestamp =  01:23 PM
x_fp_hash =  E4EE327D0AF7463EE92D9DA3BB0FBBDC


and the outcome:  
Your time is 1112980733 seconds too slow.

Perl
In the SimLib.pm file, replace the following line: my = time;
with this:
my = time + (time difference in seconds);

ASP
In the simlib.asp file, replace the following line: var tstamp = GetSecondsSince1970 ();
with this:
var tstamp = GetSecondsSince1970() + (time difference in seconds);

PHP
In the simlib.php file, replace the following line: = time ();
with this:
= time () + (time difference in seconds);

I believe that I am not producing the proper timestamp.  Any suggestions would be greatly appreciated!!
0
Comment
Question by:JGoyer
10 Comments
 
LVL 15

Expert Comment

by:DanielSKim
ID: 13738607
have you tried:

<cfset time_stamp = TimeFormat(Now(), "hh:mm:ss")>

or

<cfset time_stamp = TimeFormat(Now(), "hh:mm:ss tt")>
0
 
LVL 7

Expert Comment

by:INSDivision6
ID: 13738767
Not sure, but it might simply require this, as a timestamp:

DateDiff("s", "1/1/1970", Now())
0
 
LVL 2

Author Comment

by:JGoyer
ID: 13738821
x_fp_sequence =  0.89835883
x_fp_timestamp =  01:49:27 PM
x_fp_hash =  A5766591F3CD7F8E66157B62A4541F04


Your time is 1112982353 seconds too slow.

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 
LVL 2

Author Comment

by:JGoyer
ID: 13738865
That last one seems to be much closer.  I got the following:


x_fp_sequence =  0.08034932
x_fp_timestamp =  1112968433
x_fp_hash =  C7B18508D10A07E50E5E96F9642C596F


Your time is 14116 seconds too slow.
0
 
LVL 2

Author Comment

by:JGoyer
ID: 13738870
The datediff seems to be a lot closer!
0
 
LVL 2

Author Comment

by:JGoyer
ID: 13738901
when I added 14116 to the timestamp generated by INSDivision6's suggestion I got this:

x_fp_sequence =  0.10241803
x_fp_timestamp =  1112982663
x_fp_hash =  1BAA2279634863C205F63BCD87BF8324


and it seems to work perfectly!  Should I just keep it this way?  I am hesitant to do it that way but it looks like it works!
0
 
LVL 2

Author Comment

by:JGoyer
ID: 13738913
I ran it again and it told me that I was 4 seconds too slow.
0
 
LVL 7

Expert Comment

by:INSDivision6
ID: 13738970
1. What is their time zone?  Does it need to be taken into consideration?

2. What about the time on your computer? Does it need to be adjusted?
0
 
LVL 7

Accepted Solution

by:
INSDivision6 earned 2000 total points
ID: 13739091
This might help:

14116 sec is 3 h 55 min 16 sec.  Sounds like timezone difference.  Also, if you didn't update to [E/C/P]DT last weekend, it reduces the difference by 1 hour (3600).  Obviuosly, timestamp expected is the number of seconds since 1/1/1970.
0
 

Expert Comment

by:Ferfe
ID: 41847434
<!--- create EPOCH (required format) timestamp --->
            <cfscript>
            function GetEpochTimeFromLocal() {
            var datetime = 0;
            if (ArrayLen(Arguments) eq 0) {
            datetime = Now();
            }
            else {
            datetime = arguments[1];
            }
            return DateDiff("s", DateConvert("utc2Local", "January 1 1970 00:00"), datetime);
            }
            </cfscript>


<cfSet DteTime = GetEpochTimeFromLocal()>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 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