![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) SOAP Request to https://paycenter.piraeusbank.gr/services/tickets/issuer.asmxSends a SOAP Request to https://paycenter.piraeusbank.gr/services/tickets/issuer.asmx
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Http, HttpRequest, HttpResponse, Xml; ... procedure TForm1.Button1Click(Sender: TObject); var http: HCkHttp; soapXml: HCkXml; soapXml: PWideChar; req: HCkHttpRequest; success: Boolean; resp: HCkHttpResponse; xmlResponse: HCkXml; begin // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. http := CkHttp_Create(); soapXml := CkXml_Create(); // Set the HTTP request's XML body to the following SOAP XML: // <?xml version='1.0' encoding='UTF-8'?> // <SOAP-ENV:Envelope SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'> // <SOAP-ENV:Body> // <IssueNewTicket xmlns="http://piraeusbank.gr/paycenter/redirection"> // <Request> // <Username xsi:type="xsd:string">TheUserNameOfCustomer</Username> // <Password xsi:type="xsd:string">ThePasswordOfCustomer</Password> // <MerchantId xsi:type="xsd:int">TheMerchantIdOfCustomer</MerchantId> // <PosId xsi:type="xsd:int">ThePosId</PosId> // <AcquirerId xsi:type="xsd:int">TheAcquirerId</AcquirerId> // <MerchantReference xsi:type="xsd:string">str_MerchantReference</MerchantReference> // <RequestType xsi:type="xsd:string">02</RequestType> // <ExpirePreauth xsi:type="xsd:int">0</ExpirePreauth> // <Amount xsi:type="xsd:decimal">strBankAmount</Amount> // <CurrencyCode xsi:type="xsd:int">978</CurrencyCode> // <Installments xsi:type="xsd:unsignedByte">0</Installments> // <Bnpl xsi:type="xsd:unsignedByte">0</Bnpl> // <Parameters xsi:type="xsd:string">SomeValue</Parameters> // <BillAddrCity xsi:type="xsd:string"></BillAddrCity> // <BillAddrCountry xsi:type="xsd:string">300</BillAddrCountry> // <BillAddrLine1 xsi:type="xsd:string"> 7</BillAddrLine1> // <BillAddrPostCode xsi:type="xsd:string"></BillAddrPostCode> // <BillAddrState xsi:type="xsd:string"></BillAddrState> // <ShipAddrCity xsi:type="xsd:string"></ShipAddrCity> // <ShipAddrCountry xsi:type="xsd:string"></ShipAddrCountry> // <ShipAddrLine1 xsi:type="xsd:string"></ShipAddrLine1> // <ShipAddrPostCode xsi:type="xsd:string"></ShipAddrPostCode> // <ShipAddrState xsi:type="xsd:string"></ShipAddrState> // <CardholderName xsi:type="xsd:string"></CardholderName> // <Email xsi:type="xsd:string"></Email> // <HomePhone xsi:type="xsd:string"></HomePhone> // <MobilePhone xsi:type="xsd:string"></MobilePhone> // <WorkPhone xsi:type="xsd:string"></WorkPhone> // </Request> // </IssueNewTicket> // </SOAP-ENV:Body> // </SOAP-ENV:Envelope> soapXml := '...'; req := CkHttpRequest_Create(); CkHttpRequest_putHttpVerb(req,'POST'); CkHttpRequest_putSendCharset(req,False); CkHttpRequest_AddHeader(req,'Content-Type','atext/xml; charset=utf-8'); CkHttpRequest_AddHeader(req,'SOAPAction','???'); CkHttpRequest_putPath(req,'/services/tickets/issuer.asmx'); success := CkHttpRequest_LoadBodyFromString(req,soapXml,'utf-8'); CkHttp_putFollowRedirects(http,True); resp := CkHttp_SynchronousRequest(http,'paycenter.piraeusbank.gr',443,True,req); if (CkHttp_getLastMethodSuccess(http) = False) then begin Memo1.Lines.Add(CkHttp__lastErrorText(http)); end else begin xmlResponse := CkXml_Create(); success := CkXml_LoadXml(xmlResponse,CkHttpResponse__bodyStr(resp)); Memo1.Lines.Add(CkXml__getXml(xmlResponse)); CkHttpResponse_Dispose(resp); end; CkHttp_Dispose(http); CkXml_Dispose(soapXml); CkHttpRequest_Dispose(req); CkXml_Dispose(xmlResponse); end; |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.