Cześć,
Wymodziłem coś takiego:
$server = 'ssl.dotpay.pl';
$parameters = "id=12345&kwota=10.53&waluta=PLN&opis=Klucz 45634&lang=pl";
$fsocket = false;
$curl = false;
$result = false;
if ( (PHP_VERSION
>= 4
.3
) && ($fp = @fsockopen('ssl://' . $server, 443
, $errno, $errstr, 30
)) ) { $fsocket = true;
} elseif (function_exists('curl_exec')) {
$curl = true;
}
if ($fsocket == true) {
$header = 'POST HTTP/1.0' . "\r\n" .
'Host: ' . $server . "\r\n" .
'Content-Type: application/x-www-form-urlencoded' . "\r\n" .
'Content-Length: ' . strlen($parameters) . "\r\n" . 'Connection: close' . "\r\n\r\n";
@fputs($fp, $header . $parameters); $platnosci_response = '';
$res = @fgets($fp, 1024
); $platnosci_response .= $res;
}
} elseif ($curl == true) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://" . $server);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$platnosci_response = curl_exec($ch);
curl_close($ch);
} else {
die("ERROR: No connect method ...\n"); }
Niestety pomimo tego, że działało mi to z platnosci.pl, to nie chce działać z DotPay. Po prostu wyświetla pustą stronę i koniec. A powinien być wybór metody płatności.
Jakby ktoś rzucił na to okiem i coś podpowiedział, to będę wdzięczny.
Pozdrawiam,
Bartek.
Ten post edytował servs 19.01.2012, 18:24:26