Запрос через cURL к https://merchant.webmoney.ru

Discussion in 'PHP' started by The46Doctor, 2 Jul 2012.

  1. The46Doctor

    The46Doctor New Member

    Joined:
    31 May 2012
    Messages:
    44
    Likes Received:
    0
    Reputations:
    0
    <?php
    $url = "https://merchant.webmoney.ru/lmi/payment.asp?at=authtype_8";
    $post = "LMI_PAYEE_PURSE=R259132622467&LMI_PAYMENT_AMOUNT=5&LMI_PAYMENT_DESC=test";
    $user_agent = "Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0";
    $referer = "https://merchant.webmoney.ru/lmi/payment.asp?at=authtype_8";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_VERBOSE, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
    curl_setopt ($ch, CURLOPT_POST, 1);
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
    curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_REFERER, $referer);

    curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/cookies.txt');//куки сохранить
    curl_setopt($ch, CURLOPT_COOKIEFILE,$_SERVER['DOCUMENT_ROOT'].'/cookies.txt');
    // curl_setopt ($ch, CURLOPT_ ,);
    // curl_setopt ($ch, CURLOPT_ ,);
    $result = curl_exec ($ch);

    echo $str = str_replace ("<head>","<head><base href = 'https://merchant.webmoney.ru/lmi/'>", $result);

    ?>

    После выполнения скрипта вбиваю капчу и как результат: "
    Вы не смогли войти в защищенную зону сервиса Merchant WebMoney Transfer!
    Возможно, проверка электронной подписи не прошла или Ваш кипер еще не подключился или Вы неправильно ввели код подтверждения.
    3|access denied. Please, close all browser windows and repeat the payment again.|
    Проверьте, что кипер подключился к серверу сертификации и попробуйте снова
    "

    В чем может быть проблема?