SmartCard reader and Fivewin

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

SmartCard reader and Fivewin

Post by Otto »

Hello,
Has someone experiences with SmartCard readers and Fivewin.
Thanks in advance

Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
thefull
Posts: 720
Joined: Fri Oct 07, 2005 7:42 am
Location: Barcelona
Contact:

Re: SmartCard reader and Fivewin

Post by thefull »

Hi
I create diferents solutions with miscellaneous companys.
From DLL, ActiveX, Webservices, rs232, etc..

You can say something more concrete ?

Regards
Saludos
Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: SmartCard reader and Fivewin

Post by TimStone »

Are you referring to credit cards ? If so:

We have credit card processors with whom we integrate our software. It is actually quite simple. They have the smart card keypad / signature terminal connect to the computer, and it is completely driving by their software ( a DLL ).

Our program calls their dll functions and passes it some information about the order ( Invoice ID #, amount, Client's account number in our system ). Their software then activates the terminal and processes the credit card. When complete, it returns some info to us, including the signature capture, and we use that to print on the final invoice / receipt.

We do not obtain, or retain, any of the credit card information in our system so our clients never have a problem with PCI compliance. It works very well.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: SmartCard reader and Fivewin

Post by Otto »

Hello Tim,
thank you for your reply.
In Austria tax law was changed and now we must sign bills through a SmartCard reader.
We should send data like bill number, amount, tax, etc. to the Card Reader and get back a signed string.
It should work through APDU.
Thanks in advance and best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: SmartCard reader and Fivewin

Post by reinaldocrespo »

Hello Otto-

Have been absent for a while so I hope this is still relevant.

If it is a matter of picking up the customer's signature while showing some information on the signature pad screen, then you could use Topaz. I use their signature pads to pickup patient signatures for many forms. Topaz comes with a .dll that you can use as an ActiveX control. You can display images, text, buttons, etc. and a signing box or dotted line for the customer to sign. The signature returns on many different formats including a compressed .jpg that you can save to your .dbf or show on a dialog.

I wrote a class to manage Topaz signing pads. Please let me know if anyone needs the code.

Best regards,


Reinaldo.
audisys
Posts: 36
Joined: Wed Apr 18, 2007 6:01 pm
Location: Cartagena - Colombia

Re: SmartCard reader and Fivewin

Post by audisys »

Hola Reinaldo.

Tengo un Topaz T-S460 podrías enviarme(jd_microexpress@hotmail.com)
la clase para hacer unas pruebas.

Muy agradecido de antemano.
José David Angulo
Auditoria y Sitemas Ltda.
Cartagena Colombia
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: SmartCard reader and Fivewin

Post by Jack »

Hi,
What about identity card .

How to read the contend of EID Card ?

Thanks
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: SmartCard reader and Fivewin

Post by reinaldocrespo »

Hello Jack;

EID identity card and a signature pad are totally different animals. The question itself is puzzling to me. I think signature pads are universal. Every country I've been to implements some sort of signature pad as part of commerce. For example, when you pay with a visa card at a restaurant and the they make you sign on an electronic screen that displays messages, a signing line, and perhaps an accept button. That type of device is what I mean by "signature pad".

I have had great success using Topaz line of signature pads. The code I share here allows you to display a message on the pad's screen, draws a couple of buttons to cancel and to accept and a line where the customer signs. Once the customer clicks on the accept button the signature is returned to my FW app as a jpg that then gets saved to a blob field. The code is very old and it is my actual code in production. It is not a sample app but rather the class itself in production for many years. I hope it helps. If anyone enhances the class, please publish it or send it to me so that I may also benefit from your work.

Code: Select all

#INCLUDE "patients.ch"
#INCLUDE "rgroup.ch"


//---------------------------------------------------------------------------------------
CLASS TTopazSignature

   DATA bSave INIT { || .T. }

   DATA bCleanUp, bDrawScreenPad
   DATA bEventManager
   DATA SigPlus1
   DATA oImage 
   DATA oDlg, oBtn, oOwner
   
   METHOD New( oOwner ) 
   METHOD PickupSignature()
   METHOD End() 
   
END CLASS 



//---------------------------------------------------------------------------------------
METHOD New( oOwner ) CLASS TTopazSignature
   LOCAL oOkBMP, oClearBMP, oSignBMP

   ::oOwner := oOwner 

   TRY

      ::SigPlus1  := TActiveX():New( ::oOwner, "SIGPLUS.SigPlusCtrl.1", 0, 0, 0, 0 )

   CATCH
      MsgStop( "Topaz signature device could not be activated" )
      RETURN NIL 
   END 

   IF !::SigPlus1:TabletConnectQuery()
      MsgStop( "TOPAZ signature pad is not found or missing required components." )
      RETURN NIL
   ENDIF

   ::bCleanUp := { |o| ;
      o:TabletState := 1,;
      o:LCDRefresh( 0, 0, 0, 240, 64 ),;  // 0 the display is cleared at the specified location
      o:KeyPadClearHotSpotList(),;
      o:LCDWriteFile( 1, 0, 0, 0, 240, 64, 0, "" ) ,; //CLEAR BACKGROUND MEMORY
      o:SetSigWindow( 1, 0, 0, 240, 64 ),;
      o:LCDSetWindow( 0, 0, 240, 64 ),;
      o:LCDCaptureMode := 1,;
      o:ClearTablet(),;
      o:TabletState := 0 }

   ::bDrawScreenPad := < ||

      ::SigPlus1:LCDRefresh( 0, 0, 0, 240, 64 )
      ::SigPlus1:LCDCaptureMode := 2 //Sets mode so ink will not disappear after a few seconds

      //Write BMP images out to the LCD 1X5 screen
      oSignBMP := TImage():Define( "Pat_Sign_Line" )  //define a bmp for signature line a the bottom. 
      oClearBMP:= TImage():Define( "Pat_Sign_Clear" ) //define a bmp for clear signature button
      oOkBMP   := TImage():Define( "Pat_Sign_Ok" )    //define a bmp for accept signature button


      //SigPlus1.LCDWriteBitmap( 1, 2, 0, 0, 240, 53, imgThankYou.Picture.Handle?? )
      //LCDWriteBitmap used to write windows bitmap data to the lcd display.
      ::SigPlus1:LCDWriteBitmap( 0, 2, 0, 20, 240, 44, oSignBMP:hBitmap ) 
      ::SigPlus1:LCDWriteBitmap( 0, 2, 207, 4, 21, 11, oOkBMP:hBitmap ) 
      ::SigPlus1:LCDWriteBitmap( 0, 2, 15, 4, 38, 11, oClearBMP:hBitmap )



      //Create the hot spot for the OK BMP
      ::SigPlus1:KeyPadAddHotSpot( 0, 1, 197, 5, 25, 17 ) //For OK button
      ::SigPlus1:KeyPadAddHotSpot( 1, 1, 10, 5, 53, 17 ) //For CLEAR button
      ::SigPlus1:TabletState := 1 //Turns tablet on to collect signature


      //The following sets the LCD's signature window up to display ink only in the
      //certain spot on the LCD specified--in this case, the Signature BMP area
      ::SigPlus1:LCDSetWindow( 0, 22, 240, 40 )
      ::SigPlus1:SetSigWindow( 1, 0, 22, 240, 40 ) //Sets the area where ink is permitted in the SigPlus object


      oOkBMP:End()   //distroy these bmp objects as they have already been sent 
      oClearBMP:End()//to the pad and we no longer need them in the pc's memory.
      oSignBMP:End() 

   >
   
   

   ::bEventManager := < |cEvent, aParms |
      LOCAL cFileName

         IF ::SigPlus1:KeyPadQueryHotSpot( 0 ) > 0 .AND. ::SigPlus1:NumberOfTabletPoints > 0 //ok Botton has been clicked

            cFileName := Temp_Name( "jpg" )
            ::SigPlus1:ImageFileFormat := 4   //compressed jpg
            ::SigPlus1:ImagePenWidth := 15
            ::SigPlus1:JustifyMode := 5 
            
            ::SigPlus1:WriteImageFile( cFileName )
            ::oImage:LoadImage( ,cFileName )
            ::oImage:Refresh()
            ::odlg:Update()

            fErase( cFileName )

            ::oBtn:Enable()

         ELSEIF ::SigPlus1:KeyPadQueryHotSpot( 1 ) > 0 .AND. ::SigPlus1:NumberOfTabletPoints > 0 //CLEAR Botton

            EVAL( ::bCleanUp, ::SigPlus1 )
            EVAL( ::bDrawScreenPad )
            ::SigPlus1:SetEventEnableMask( 3 )

         ELSE 

            //Sleep 5
            ::SigPlus1:ClearSigWindow( 1 )
            ::SigPlus1:SetEventEnableMask( 3 )
         ENDIF 
   > //----------------------------------------------------------------------------------

RETURN SELF 


//---------------------------------------------------------------------------------------
METHOD PickupSignature() CLASS TTopazSignature
   LOCAL oDlg, bValid, bInit


   ::SigPlus1:LCDSetTabletMap( 0, 240, 64, 100, 0, 1900, 700 ) //Sets Map up for LCD 1X5 tablet
   Eval( ::bCleanUp, ::SigPlus1 )


   //******************************************************************'
   // The following parameters are set in case the user's INI file is not correctly set up for an LCD 1X5 tablet
   // Otherwise, if the INI is correctly set up, these parameters do not need to be set
   ::SigPlus1:TabletXStart   := 400
   ::SigPlus1:TabletXStop    := 2400
   ::SigPlus1:TabletYStart   := 350
   ::SigPlus1:TabletYStop    := 1050
   ::SigPlus1:TabletLogicalXSize := 2000
   ::SigPlus1:TabletLogicalYSize := 700
   //******************************************************************'


   EVAL( ::bDrawScreenPad ) 

   // Enables Pen Up and Pend Down events 1 = Enables pen Down, 2 = Pen Up, 3 = both.
   ::SigPlus1:SetEventEnableMask(3)
   ::SigPlus1:bOnEvent := ::bEventManager 


   DEFINE DIALOG oDlg RESOURCE "Pat_Signature" TRANSPARENT COLOR CLR_BLUE, RGB( 240, 240, 240 ) OF ::oOwner
   REDEFINE IMAGE ::oImage ID 1 OF oDlg ADJUST UPDATE
   ::oImage:lStretch := .T.
   
   REDEFINE BUTTONBMP ::oBtn ID 200 OF oDlg BITMAP "Pen16" TEXTRIGHT ACTION ( EVAL( ::bSave, ::SigPlus1 ), oDlg:End() )

   REDEFINE BUTTONBMP ID 201 OF oDlg BITMAP "Cancel16" TEXTRIGHT ACTION oDlg:End()

   FONDOBOTONES 1001, oDlg

   oDlg:lHelpIcon := .F.
   

   bInit  := {|| oDlg:Center( WndMain() ), ::oBtn:Disable() }
   bValid := { || ClearTmpfiles(), IIF( ::oImage != NIL, ::oImage:End(), NIL ), .T. }
   oDlg:oWnd := ::oOwner


   ::oDlg := oDlg 

   TRY

      oDlg:Activate( ,,,,bValid, .T., bInit )

   CATCH
   END 

   Eval( ::bCleanUp, ::SigPlus1 )

   ::SigPlus1:TabletState := 0


RETURN NIL 

//-----------------------------------------------------------------------------------
METHOD End() CLASS TTopazSignature

   ::SigPlus1 := NIL 
   ::oImage   := NIL 
   ::oDlg     := NIL 

RETURN NIL 

 


Reinaldo.
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: SmartCard reader and Fivewin

Post by TimStone »

The issue here in the US is the security of the data. My clients do not want to retain any of the card data on their equipment. So, our processing companies have all the information handled between their card reader and their own servers.

Here is how it works.
1) We have the customer name, total, and invoice info which we pass to the terminal API installed on the workstation.
2) The API then pops up a screen and shows the amount to be charged to the card. If no card is present, you can enter the card data. Otherwise, the customer puts their card in the reader, or swipes it.
3) The terminal asks them to confirm the amount, then prompts for a signature.
4) The signature displays on the API popup screen.
5) When OK is pressed on the API popup, a set of data is passed back to our program which includes the transaction number ( which is all we need to process credits or refunds ), and the graphic of the signature. We save both to the invoice file.
6) We then print the final invoice which includes the required transaction information, and the signature.

We use the same process with two different credit card processing companies. It's quite simple, very secure, and our clients never have to worry about all of the legal requirements for protecting the credit card data itself.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
Post Reply