![]() |
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
(Ruby) SOAP Request to https://paycenter.piraeusbank.gr/services/tickets/issuer.asmxSends a SOAP Request to https://paycenter.piraeusbank.gr/services/tickets/issuer.asmx
require 'chilkat' # This example requires the Chilkat API to have been previously unlocked. # See Global Unlock Sample for sample code. http = Chilkat::CkHttp.new() soapXml = Chilkat::CkXml.new() # 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 = Chilkat::CkHttpRequest.new() req.put_HttpVerb("POST") req.put_SendCharset(false) req.AddHeader("Content-Type","atext/xml; charset=utf-8") req.AddHeader("SOAPAction","???") req.put_Path("/services/tickets/issuer.asmx") success = req.LoadBodyFromString(soapXml,"utf-8") http.put_FollowRedirects(true) # resp is a CkHttpResponse resp = http.SynchronousRequest("paycenter.piraeusbank.gr",443,true,req) if (http.get_LastMethodSuccess() == false) print http.lastErrorText() + "\n"; else xmlResponse = Chilkat::CkXml.new() success = xmlResponse.LoadXml(resp.bodyStr()) print xmlResponse.getXml() + "\n"; end |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.