Jump to content

boris.nihil

Members
  • Content Count

    32
  • Joined

  • Last visited

Everything posted by boris.nihil

  1. boris.nihil

    New to JSON

    you are right, from small to big picture i think this will do: JSonObject := TJSonObject.Create; JsonValue := JSonObject.ParseJSONValue(memoRequest.Lines.Text); JsonValue := (JsonValue as TJSONObject).Get('b2GOutgoingInvoiceEnvelope').JSONValue; JsonValue := (JsonValue as TJSONObject).Get('b2GOutgoingInvoiceProcessing').JSONValue; JsonValue := (JsonValue as TJSONObject).Get('correctB2GOutgoingInvoice').JSONValue; JsonValue := (JsonValue as TJSONObject).Get('invoiceID').JSONValue;
  2. boris.nihil

    Comunicate with POS terminal (Ingenico)

    ok..thanks a lot for all the help!
  3. boris.nihil

    Comunicate with POS terminal (Ingenico)

    Thank a lot for a time you spend for this.. Solution 2 with timer works on some way...it's hard to work since i can't play with this device so i need to improvise.. Problem is that timer must work all the time until transaction is complete.. After i received message 'INSERT CARD' timer stops and i can't read anymore. Could you help me how to send some message from server I made with IdTCPServer1 component to Client program with some Button on server form ? Something like "AContext.Connection.IOHandler.Write"...
  4. boris.nihil

    Comunicate with POS terminal (Ingenico)

    i tryed IdTCPClient1.IOHandler.InputBuffer.Clear; IdTCPClient1.IOHandler.Write(s + chr(strtoint(lrc)), IndyTextEncoding_8bit); and then i activate timer: if IdTCPClient1.IOHandler.InputBufferIsEmpty then begin if IdTCPClient1.IOHandler.CheckForDataOnSource(500) then begin receivedtext1 := IdTCPClient1.IOHandler.WaitFor(#6,true,true,IndyTextEncoding_8bit); memo1.SelStart := memo1.GetTextLen; memo1.SelLength := 0; memo1.SelText := 'Received ACK:' + receivedtext1 + #13#10; sleep(500); receivedtext := IdTCPClient1.IOHandler.WaitFor(#3,true,true,IndyTextEncoding_8bit); memo1.SelStart := memo1.GetTextLen; memo1.SelLength := 0; memo1.SelText := 'Received message:' + receivedtext + #13#10; end;
  5. boris.nihil

    Comunicate with POS terminal (Ingenico)

    >> Though I suspect the POS is actually expecting binary data for the message content, not hex-encoded strings, so try something more like this: >> s := #2#2'000000000001000'#28'1000'#28#28'+0'#28'191'#28#28#28#28#28#28#28#28#28#28#28'00'#28'1'#12#28#28#28#28#28#28#28#28#3','; >> IdTCPClient1.IOHandler.Write(s, IndyTextEncoding_8bit); you were right, this works ! But now program hangs for a while waiting for some response or something.. How to receive ACK from POS terminal and other data from POS ? I need to send ACK after every returned answer from POS.. ECR-->POS: <STX><STX>303030303030303030303031303030<FS>31303030<FS><FS>2B30<FS>313931<FS><FS><FS><FS><FS><FS><FS><FS><FS><FS><FS>3030<FS>31<FF><FS><FS><FS><FS><FS><FS><FS><FS><ETX>2C POS-->ECR: <ACK> POS-->ECR: <STX>32303030303030305542414349204B415254494355<ETX>2E (insert CARD) ECR-->POS: <ACK> POS-->ECR: <STX>(CARD in process) ECR-->POS: <ACK> POS-->ECR: <STX>(wait) ECR-->POS: <ACK> POS-->ECR: <STX(aproved) ECR-->POS: <ACK> Maybe this code is not good ? answer := IdTCPClient1.IOHandler.ReadLn(); showmessage(answer ); Here is Protocol what POS terminal use..
  6. boris.nihil

    Comunicate with POS terminal (Ingenico)

    thanks a lot for a help, i will try it tommorow and see...
  7. boris.nihil

    Comunicate with POS terminal (Ingenico)

    no, it is connected to local network with fixed ip 192.168.1.23 and port 3000.. on POS screen its written: LISTEN 192.168.1.23:3000
×