add a full timestamp to the 'ref' autogeneration to avoid collisions
[Business-OnlinePayment-Jety.git] / lib / Business / OnlinePayment / Jety.pm
index be73019..11fc85c 100644 (file)
@@ -71,7 +71,8 @@ sub map_fields {
     if(lc($content->{action}) ne 'normal authorization');
 
   $content->{'function'} = 'echeck';
-  $content->{'ref'} = time2str('%Y%m%d',time).'-'.int(rand(1000000));
+  $content->{'ref'} =
+    substr( time2str('%Y%m%d%H%M%S',time). int(rand(10000)), -15 );
 
   $content->{'phone'} ||= '111-111-1111';