Jump to content

KimHJ

Members
  • Content Count

    42
  • Joined

  • Last visited

Community Reputation

3 Neutral

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I have a rest server module that process credit cards. It is running on a Windows 2016 R2 server in the cloud since February 2021 with no problems. I have two different processor in the module, one works fine the other stopped working end of February 2025 and I can't find out why. They booth works fine on my Windows 10 computer. Both processors uses TLS1.2 and I checked using the Nartac ISS Crypto 3.3 and it show that TLS1.2 is the only valid protocol. On the server using IE I get this when I enter https://secure.usaepay.com/soap/gate/BBLQPYNC/usaepay.wsdl <!-- USAePay Soap Interface - v1.6 (RPC) --> <!-- WSDL file generated painstakingly by hand --> <!-- For further documentation on the USAePay API Please visit http://help.usaepay.com/developer/soap --> <definitions xmlns:typens="urn:usaepay" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="usaepay" targetNamespace="urn:usaepay"> ... </definitions> When I enter this WSDL: https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v45/Credit.asmx I get this. (Imported to Delphi like this: https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v45/Credit.asmx?WSDL) This page can’t be displayed Turn on TLS 1.0, TLS 1.1, and TLS 1.2 in Advanced settings and try connecting to https://ps1.merchantware.net again. If this error persists, it is possible that this site uses an unsupported protocol or cipher suite such as RC4 (link for the details), which is not considered secure. Please contact your site administrator. I can run the https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v45/Credit.asmx in Nartac ISS Crypto 3.3 in Site Scan and it works fine and does the whole scan. Here is the code for the one that is not working: function TEWBModule1.CayanProcessing(MCCNumber, MExpDate, Mcvv, MWAmount, MCusNum, MName, MTransNum, MWType: string; SaveIt: Boolean): Boolean; var ReturnStr: TransactionResponse45; MerchantC: MerchantCredentials; PData: PaymentData; Sale: SaleRequest; Void: VoidRequest; Service: CreditSoap; RIO: TRIO; MwCardType, CCardNumber, Authoriz, CardT, CCToken, ApproveS: String; MYApprovedAmount: Double; DidConnect: Boolean; begin DidConnect := True; CoInitialize(nil); MerchantC:= MerchantCredentials.Create; MerchantC.MerchantName := MasterTbl.FieldByName('Mlogin').AsString; MerchantC.MerchantSiteId := MasterTbl.FieldByName('MPassword').AsString; MerchantC.MerchantKey := MasterTbl.FieldByName('Merchantnum').AsString; Try if MWType='C' then begin PData:= PaymentData.Create; Sale:= SaleRequest.Create; PData.Source := 'KEYED'; PData.CardNumber := MCCNumber; PData.ExpirationDate := MExpDate; PData.CardHolder := MName; PData.CardVerificationValue := Mcvv; Sale.Amount := MWAmount; Sale.InvoiceNumber := MTransNum; Sale.CustomerCode := MCusNum; Sale.RegisterNumber := 'Web'; Sale.MerchantTransactionId := MTransNum; Sale.CardAcceptorTerminalId := '1'; Sale.EnablePartialAuthorization := 'false'; Sale.ForceDuplicate := 'false'; end else begin Void := VoidRequest.Create; Void.Token := MCCNumber; Void.RegisterNumber := 'Web'; Void.MerchantTransactionId := MTransNum; Void.CardAcceptorTerminalId := '1'; end; Service := GetCreditSoap(Boolean(False), ''); RIO := (Service as IRIOAccess).RIO; if RIO is THTTPRIO then begin THTTPRIO(RIO).HTTPWebNode.ConnectTimeout := 1000 * 30; THTTPRIO(RIO).HTTPWebNode.SendTimeout := 1000 * 15; THTTPRIO(RIO).HTTPWebNode.ReceiveTimeout := 1000 * 60; end; try if MWType='C' then ReturnStr := Service.Sale(MerchantC,PData,Sale) else ReturnStr := Service.Void(MerchantC,Void); except On E:Exception do begin Result := False; DidConnect := False; end; end; Finally if MWType='C' then begin PData.Free; Sale.Free; end else Void.Free; MerchantC.Free; CoUnInitialize; End; end; The ReturnStr is blank. This is the second processor also imported as a WSDL and it is still working fine. function TEWBModule1.ProcessCreditcard(card,Exp,cvv, Amount, account, transnum, PType: String; Saveit: Boolean): Boolean; var NewToken: usaepay.ueSecurityToken; tran: usaepay.TransactionRequestObject; response: usaepay.TransactionResponse; Wclient: usaepay.ueSoapServerPortType; CData: usaepay.CreditcardData; CDetails: usaepay.TransactionDetail; NewAmount: Double; RIO: TRIO; I: Integer; VoidResponse, CApproved: Boolean; Errormsg: String; begin NewToken := nil; tran := nil; Response := nil; try CoInitialize(nil); NewToken := CreateToken(MasterTbl.FieldByName('Merchantnum').AsString, MasterTbl.FieldByName('Mlogin').AsString); tran := usaepay.TransactionRequestObject.Create; if PType='C' then begin CData:= usaepay.CreditcardData.Create; CDetails:= usaepay.TransactionDetail.Create; CData.CardNumber := card; CData.CardExpiration := Exp; CData.CardCode := cvv; NewAmount := StrToFloat(Amount); CDetails.Amount := NewAmount; CDetails.AllowPartialAuth := False; CDetails.Description := 'Web Payment'; tran.Details := CDetails; tran.CreditCardData := CData; tran.CustomerID := account; tran.Software := 'ComcaWeb'; tran.Command := 'sale'; end; Wclient := GetueSoapServerPortType(False,''); RIO := (Wclient as IRIOAccess).RIO; if RIO is THTTPRIO then begin THTTPRIO(RIO).HTTPWebNode.ConnectTimeout := 1000 * 30; THTTPRIO(RIO).HTTPWebNode.SendTimeout := 1000 * 15; THTTPRIO(RIO).HTTPWebNode.ReceiveTimeout := 1000 * 60; end; finally NewToken.Free; tran.Free; response.Free; CoUnInitialize; end; end; The only thing I can think off is that something changed in Windows Server 2016 R2 in February 2025. Thanks for any help.
  2. Followed the same procedure in this topic and it fixed it. [PAClient Error] Error: E7688 Error in c:\...activity-1.7.2.dex.jar:
  3. I installed the Delphi 12 April patch and updated to the latest Java developer kit. jdk-24 and I'm unable to run any Android application, I can compile but not deploy. I noticed that Java uninstalled my JRE folder. I get a lot of lines but in the error here are few of them [PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\23.0\lib\android\Release\annotation-experimental-1.3.0.dex.jar: [PAClient Error] Error: E7688 java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\23.0\lib\android\Release\annotation-experimental-1.3.0.dex.jar [PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\23.0\lib\android\Release\annotation-jvm-1.6.0.dex.jar: [PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\23.0\lib\android\Release\collection-1.1.0.dex.jar: [PAClient Error] Error: E7688 Error in c:\program files (x86)\embarcadero\studio\23.0\lib\android\Release\billing-6.0.1.dex.jar: [PAClient Error] Error: E7688 java.nio.file.NoSuchFileException: c:\program files (x86)\embarcadero\studio\23.0\lib\android\Release\core-1.10.1.dex.jar Thanks for any help. Kim
  4. KimHJ

    Unable to save from TImage to file

    I was just thinking I can just delete the image after I have send it.
  5. KimHJ

    Unable to save from TImage to file

    I just replaced it in the same place in the Client where the MemoryStream.LoadFromFile(FImageFilePath); was. I can save it first and then use LoadFromFile and it works, but I don't want to save them on the device. Image1.Bitmap.SaveToFile(FImageFilePath); MemoryStream.LoadFromFile(FImageFilePath);
  6. KimHJ

    Unable to save from TImage to file

    Remy, I'm sorry I didn't see the sample codes you wrote, before. Maybe we where posting at the same time. On the server side in the first example I get an error: First chance exception at $00007FFCF5F3FA4C. Exception class EIdReadLnMaxLineLengthExceeded with message 'Max line length exceeded.'. Process CSIPictureServer.exe (3744) Here: JsonStr := AContext.Connection.IOHandler.ReadLn; The second example worked, thanks. I have the TImage with a image, why when I save to MemoryStream like this I just get a 19kb black image on the server side? Image1.Bitmap.SaveToStream(MemoryStream); //MemoryStream.LoadFromFile(FImageFilePath); I just get a 19kb black image.
  7. KimHJ

    Unable to save from TImage to file

    Remy, It works as it is, but I changed the code in the Client StringStream := TStringStream.Create(IdEncoderMIME1.Encode(MemoryStream),TEncoding.UTF8); .. IdTCPClient1.Socket.Write(JObj.ToJSON); I change the code in the Server code: StringStream := TStringStream.Create('', TEncoding.UTF8); I tried to use ReadString, but the I get a read error when it tries to parse the json PicStr: String; .. PicStr := AContext.Connection.IOHandler.ReadString(-1); JSON := TJSONObject.ParseJSONValue(PicStr) as TJSONObject; It works fine now and I found that it did save the images, but they was not in the folder that I had in the filename string, but in the project folder where the application was running from. I take a picture with the camera and place it in a TImage. procedure TMainForm.TakePhotoFromCameraAction1DidFinishTaking(Image: TBitmap); begin Image1.Bitmap.Assign(Image); end; Then with the same code that works sending a image from a file works. MemoryStream := TMemoryStream.Create; MemoryStream.Position := 0; MemoryStream.LoadFromFile(FImageFilePath); When I try this I get a blank image. MemoryStream := TMemoryStream.Create; MemoryStream.Position := 0; Image1.Bitmap.SaveToStream(MemoryStream); Thanks for your help.
  8. KimHJ

    Unable to save from TImage to file

    Remy, I do see the image in the TImage on the server application after it is send from the client app. I by accident remove the rest to 0, but still no file are saved. Here is the Client side running on Android. procedure TMainForm.SendPicture; var MemoryStream: TMemoryStream; StringStream: TStringStream; JObj: TJSONObject; begin {$IFDEF MSWINDOWS} FImageFilePath := TPath.Combine(TPath.GetDocumentsPath, EditImage.Text); {$ENDIF} {$IFDEF ANDROID} FImageFilePath := TPath.Combine(TPath.GetSharedDocumentsPath, SetupForm.EditImage.Text); {$ENDIF} if not FileExists(FImageFilePath) then begin ShowMessage('No such file at ' + FImageFilePath + '!'); Exit; end; IdTCPClient1.Host := SetupForm.EditHost.Text; try IdTCPClient1.Port := Integer.Parse(SetupForm.EditPort.Text); except on EConvertError do begin ShowMessage('Wrong port value!'); Exit; end; end; if not IdTCPClient1.Connected then begin try IdTCPClient1.Connect; except on EIdSocketError do begin ShowMessage('Connection error!'); Exit; end; end; end else begin IdTCPClient1.Disconnect; Exit; end; TTask.Run( procedure begin MemoryStream := nil; StringStream := nil; JObj := nil; try MemoryStream := TMemoryStream.Create; MemoryStream.LoadFromFile(FImageFilePath); StringStream := TStringStream.Create(IdEncoderMIME1.Encode(MemoryStream),TEncoding.ASCII); JOBJ := TJSONObject.Create; JOBJ.AddPair('image_encoded', StringStream.DataString); JOBJ.AddPair('message', Edit1.Text); IdTCPClient1.Socket.WriteLn(JObj.ToJSON); TThread.Synchronize(nil, procedure begin ShowMessage('BASE64 Image and message successfully sent to server!'); end); finally IdTCPClient1.Disconnect; JObj.Free; StringStream.Free; MemoryStream.Free; end; end); end; Right no I'm testing the send and save on the server side, but eventually I would like to send and save an image displayed in a TImage on the client side and not a file. The TImage is from the camera.
  9. KimHJ

    Android aidl error when using it.

    Yes, it compiles and it prints. First It didn't print, but then I added the command Nextline(1) first and PrintText after then it printed. Now I just need to create the rest of the app. I'm working on two different apps at the same time as you can see on my posts, not getting enough sleep lately. Again, thanks for all your help.
  10. I have this code where I send an jpg image with TidTCPClient to a TidTCPServer. On the Server side the image aperea in a TImage, but no file is created when I save it. I tried using .jpg as well I try to use the MemoryStream.SaveToFile. I look in many forums and it looks like the do the same thing, what is wrong with this code? Here is the server code. procedure TMainForm.IdTCPServer1Execute(AContext: TIdContext); var JSON: TJSONObject; StringStream: TStringStream; MemoryStream: TMemoryStream; begin MemoryStream := nil; StringStream := nil; JSON := nil; try StringStream := TStringStream.Create('', TEncoding.ASCII); AContext.Connection.IOHandler.LargeStream := True; AContext.Connection.IOHandler.ReadStream(StringStream, SizeOf(StringStream), True); JSON := TJSONObject.ParseJSONValue(StringStream.DataString) as TJSONObject; MemoryStream := TMemoryStream.Create; IdDecoderMIME1.DecodeStream(JSON.GetValue('image_encoded').Value, MemoryStream); TThread.Synchronize(nil, procedure begin Edit2.Text := ''; Edit2.Text := JSON.GetValue('message').Value; Image1.Bitmap.LoadFromStream(MemoryStream); end); finally MemoryStream.Free; StringStream.Free; JSON.Free; end; SaveImageToDisk; end; procedure TMainForm.SaveImageToDisk; var CsFilename: String; begin CsFilename := Edit2.Text + '.png'; Image1.Bitmap.SaveToFile(CsFilename); end;
  11. KimHJ

    Android aidl error when using it.

    Great, that did it.
  12. Ok it works, just had to open the port in the firewall.
  13. KimHJ

    Android aidl error when using it.

    Sorry, I still have problems when compiling the new JavaInterfaces.pas I get those errors all the way down from JSrPrinter_10 [JavaSignature('com/sr/SrPrinter$10')] JSrPrinter_10 = interface(JRunnable) ['{A13C6C9C-B945-4438-A33F-1B4453FD0555}'] function _Getval$line: Integer; cdecl; //function needs result type. With a red line under the $ sign procedure run; cdecl; property val$line: Integer read _Getval$line; // property 'val' does not exsist in base class. With a red line under val($line), read and $ sign in Getval$text end; TJSrPrinter_10 = class(TJavaGenericImport<JSrPrinter_10Class, JSrPrinter_10>) end; Does it looks like Java2Op created some wrong classes? Is it something i can correct manually? Again, thanks for any help. JavaInterfaces.pas
  14. KimHJ

    Android aidl error when using it.

    Thanks a lot for your help, I would never had been able to find out this by my self. I was almost going back to Android Studio and make the app there.
  15. KimHJ

    Android aidl error when using it.

    No, that is the jar file they emailed me in the SDK, with the example. I just posted a bit of the sample, here is the SDK I was emailed. The SDK is 18mb here is my dropbox link. https://www.dropbox.com/scl/fi/0nw4mhyha0qx72m4dbgfn/Java-Printer-SDK.zip?rlkey=tcn49jv2vt4ofmg90xojnzun5&amp;dl=0
×