cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Sending a XML using Curl

From: adeel shahid <imadeelshahid_at_gmail.com>
Date: Wed, 12 Nov 2008 13:55:25 +0500

try disabling verify_host to false or 0

2008/11/12 Quad is Activating <activate_at_quadraxas.com>

> Hi,
>
> I want to send a XML and read the respond using curl and php. Trying for 5
> days without luck. I always get the "Invalid XML" repsond:
>
> this is what i do:
>
> $request=
> '<?xml version="1.0" encoding="ISO-8859-9" ?>
> <ePaymentMsg VersionInfo="2.0" TT="Request" RM="Direct" CT="Money">
> <Operation ActionType="Sale">
> <OpData>
>
> <MerchantInfo MerchantId="12345678" MerchantPassword="1111111"/>
> <ActionInfo>
> <TrnxCommon TrnxID="TRX_1a2b3c4d5e6f7g" Protocol="156">
> <AmountInfo Amount="1.00" Currency="949" />
> </TrnxCommon>
> <PaymentTypeInfo>
> <InstallmentInfo NumberOfInstallments="0" />
> </PaymentTypeInfo>
> </ActionInfo>
>
> <PANInfo PAN="1111222233334444" ExpiryDate="200911" CVV2="123" BrandID="VISA" />
> <OrderInfo>
> <OrderLine>1</OrderLine>
> <OrderText>Urun_Ismi</OrderText>
> </OrderInfo>
> <OrgTrnxInfo />
> </OpData>
> </Operation>
> </ePaymentMsg>';
>
> $url = "https://web.bankasya.com.tr/spos/iposnet/sposnet.aspx";
>
> $ch = curl_init();
>
> curl_setopt($ch, CURLOPT_URL,$url);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
> curl_setopt($ch, CURLOPT_FAILONERROR, 1);
> curl_setopt($ch, CURLOPT_TIMEOUT, 15);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
>
> $result = curl_exec($ch);
> curl_close($ch);
>
> $result always has "Invalid XML" result.
>
> i am using a secure connection, bu t cant get this to work, ant help?
>
> sorry for my bad english.
> Thank yout
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-11-12