Answer the question
In order to leave comments, you need to log in
POST request to Yandex Money API, how?
Hello!
I'm trying to make a request:
$request = Request::factory('http://money.yandex.ru/quickpay/confirm.xml')
->method('POST')
->post(array(
'receiver' => '41001299****',
'quickpay-form' => 'shop',
'targets' => 'Интернет-магазин *****',
'sum' => '990',
'successURL' => 'http://site.net/result'
))
->headers('Content-Type', 'application/x-www-form-urlencoded');
$response = $request->execute();
echo $response->body();
Answer the question
In order to leave comments, you need to log in
$ch = curl_init(' money.yandex.ru/quickpay/confirm.xml ');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, urlencode(DATA));
$result = curl_exec($ch);
$responseInfo = curl_getinfo($ch);
print_r([$result,responseInfo]);
And what is a framework? If Kohana, then:
$result = Request::factory('http://money.yandex.ru/quickpay/confirm.xml')
->query(array(
'receiver' => '41001299****',
'quickpay-form' => 'shop',
'targets' => 'Интернет-магазин *****',
'sum' => '990',
'sum' => '990',
'successURL' => 'http://site.net/result',
))
->headers('Content-Type', 'application/x-www-form-urlencoded')
->method(HTTP_Request::POST)
->execute();
die($result->body());
$params = array(
'receiver' => '41001299****',
'quickpay-form' => 'shop',
'targets' => 'Интернет-магазин *****',
'sum' => '990',
'sum' => '990',
'successURL' => 'http://site.net/result',
);
$uri = 'http://money.yandex.ru/quickpay/confirm.xml' . '?' . http_build_query($params);
$result = Request::factory($uri)
->method(HTTP_Request::POST)
->execute()
->headers('Content-Type', 'application/x-www-form-urlencoded');
die($result->body());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question