{"id":198668,"date":"2013-10-23T12:11:03","date_gmt":"2013-10-23T08:11:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=198668"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=198668","title":{"rendered":"<span class=\"post_title\">QIWI \u0438 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b REST \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e.<br \/>  \u042f \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0434\u0430\u0432\u043d\u0438\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u043c \u0445\u0430\u0431\u0440\u0430 \u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0445\u043e\u0436\u0443 \u0442\u0443\u0442 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0441\u0432\u043e\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u041d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041f\u0440\u0438\u0447\u0451\u043c \u043d\u0438\u0433\u0434\u0435.<br \/>  \u0410 \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 (REST) \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b QIWI. \u041c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0432\u0435\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0431, \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438, \u0442.\u043a. \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435\u0442, \u0445\u043e\u0442\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0443\u0436 \u0438 \u0441\u043b\u043e\u0436\u043d\u0430\u044f.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043d\u0435 \u0442\u0430\u043a \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443-\u0442\u043e.<br \/>  <a name=\"habracut\"><\/a>\u0421\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u0440\u0430\u0437\u0436\u0435\u0432\u044b\u0432\u0430\u0442\u044c \u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e. \u0411\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c. \u0412\u0441\u0451 \u0436\u0435 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0432\u043e\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0446\u0435\u043b\u0438.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u0430\u0433\u0430\u0437\u0438\u043d <a href=\"http:\/\/ishopnew.qiwi.ru\/\">http:\/\/ishopnew.qiwi.ru\/<\/a><br \/>  \u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0421\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u044b \u043d\u0430\u0439\u0434\u0451\u0442 \u043f\u0443\u043d\u043a\u0442 \u041d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u0422\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 API \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b cURL.<br \/>  \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e:  <\/p>\n<pre><code class=\"php\">$requestType = 'POST'; \/\/ \u0414\u043b\u044f REST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 $url = 'some url'; \/\/ \u0417\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f $parameters = array(); \/\/ \u0422\u0430\u043a \u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 $loginPass = $id . ':' . $password; \/\/ ID \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044c(\u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430) $headers = array(     &quot;Accept: text\/json&quot;,     &quot;Content-Type: application\/x-www-form-urlencoded; charset=utf-8&quot; ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, $loginPass);  if ($requestType != 'GET') {     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $requestType);     curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($parameters)); } $httpResponse = curl_exec($ch); if (!$httpResponse) {     \/\/ \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443      echo curl_error($ch).'('.curl_errno($ch).')';     return false; } $httpResponseAr = json_decode($httpResponse); return $httpResponseAr-&gt;response; <\/code><\/pre>\n<p>  \u0414\u0443\u043c\u0430\u044e \u0442\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c.  <\/p>\n<ul>\n<li>\u0412\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0447\u0435\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e<\/li>\n<li>\u0417\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0441\u0447\u0435\u0442\u0430<\/li>\n<li>\u041f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u043b\u0430\u0442\u044b \u0441\u0447\u0435\u0442\u0430<\/li>\n<li>\u041e\u0442\u043c\u0435\u043d\u0430 \u043d\u0435\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0447\u0435\u0442\u0430<\/li>\n<li>\u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043f\u043e \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430<\/li>\n<\/ul>\n<p>  \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432\u0441\u0451 \u043e\u043f\u0438\u0441\u0430\u043d\u043e. \u042f \u043b\u0438\u0448\u044c \u0430\u043a\u0446\u0435\u043d\u0442\u0438\u0440\u0443\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0435\u0449\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u043b\u0438 \u043c\u043e\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<\/p>\n<p>  \u041e\u043f\u0438\u0448\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <b>1) \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0447\u0435\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e<\/b>  <\/p>\n<pre><code class=\"php\">$requestType = 'PUT'; $url = 'https:\/\/w.qiwi.com\/api\/v2\/prv\/{prv_id}\/bills\/{bill_id}'; \/\/ {prv_id} \u2013 \u0442\u0443\u0442 \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0430\u0448 ID \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \/\/ {bill_id} \u2013 \u043b\u044e\u0431\u043e\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u043d\u043e\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0451\u0442\u0430 \u0438\u0437 \u0431\u0430\u0437\u044b. $parameters = array( \t'user' =&gt; 'tel:+79999999999', \t'amount' =&gt; 0.1, \t'ccy' =&gt; 'RUB', \t'comment' =&gt; '\u041e\u043f\u043b\u0430\u0442\u0430 QIWI', \t'pay_source' =&gt; 'qw', \t'lifetime' =&gt; date('c', $timePlusHour), \t'prv_name' =&gt; 'QIWI', ); <\/code><\/pre>\n<p>  \u0421 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. <\/p>\n<p>  <b>2) \u0417\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0441\u0447\u0435\u0442\u0430<\/b><br \/>  \u0415\u0441\u043b\u0438 \u0441\u0447\u0451\u0442 \u043d\u0435 \u0431\u044b\u043b \u043e\u043f\u043b\u0430\u0447\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0443\u0441. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u043e\u0442\u0432\u0435\u0442 \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0448\u0438\u043b \u043e\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cron.  <\/p>\n<pre><code class=\"php\">$requestType = 'GET'; $url = 'https:\/\/w.qiwi.com\/api\/v2\/prv\/{prv_id}\/bills\/{bill_id}'; \/\/ \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u0448\u0435 $parameters = array(); <\/code><\/pre>\n<p>  <b>3) \u041f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u043b\u0430\u0442\u044b \u0441\u0447\u0435\u0442\u0430<\/b><br \/>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0447\u0451\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u043f\u043b\u0430\u0442\u044b. \u0417\u0434\u0435\u0441\u044c cURL \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442.   <\/p>\n<pre><code class=\"php\">$url = 'https:\/\/w.qiwi.com\/order\/external\/main.action?shop={prv_id }&transaction={bill_id}'; $url .= '&successUrl=' . $successUrl; $url .= '&failUrl=' . $failUrl; \/\/ {prv_id} \u0438 {bill_id} \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430.  \/\/ $successUrl \u0438 $failUrl \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0430\u0448\u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0438 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e \u043e\u043f\u043b\u0430\u0442\u0435. <\/code><\/pre>\n<p>  <b>4) \u041e\u0442\u043c\u0435\u043d\u0430 \u043d\u0435\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0447\u0435\u0442\u0430<\/b><br \/>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043c\u0435\u043d\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0447\u0451\u0442\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0441\u0447\u0451\u0442, \u043d\u043e \u043e\u043d \u043d\u0435 \u043e\u043f\u043b\u0430\u0447\u0435\u043d, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u044b\u043b\u0430\u0442\u044c \u043d\u0430 \u0430\u0434\u0440\u0435\u0441, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0441\u0447\u0451\u0442\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u0435, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0434\u0451\u0442 \u043f\u0438\u0441\u044c\u043c\u043e \u043d\u0430 email, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.  <\/p>\n<pre><code class=\"php\">$requestType = 'PATCH'; $url = 'https:\/\/w.qiwi.com\/api\/v2\/prv\/{prv_id}\/bills\/{bill_id}'; \/\/ \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u0448\u0435 $parameters = array( \t'status' =&gt; 'rejected' );  <\/code><\/pre>\n<p>  <b>5) \u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043f\u043e \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443<\/b><br \/>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430.  <\/p>\n<pre><code class=\"php\">$requestType = 'PUT'; $url = 'https:\/\/w.qiwi.com\/api\/v2\/prv\/{prv_id}\/bills\/{bill_id}\/refund\/{refund_id}'; \/\/ \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u0448\u0435, \u0442\u043e\u043b\u044c\u043a\u043e {refund_id} \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u0435\u043d $parameters = array( \t'amount' =&gt; $amount );  <\/code><\/pre>\n<p>  <b>6) \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430<\/b><br \/>  \u0422\u0430\u043a \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0448\u0435.  <\/p>\n<pre><code class=\"php\">$requestType = 'GET'; $url = 'https:\/\/w.qiwi.com\/api\/v2\/prv\/{prv_id}\/bills\/{bill_id}\/refund\/{refund_id}'; \/\/ \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u0448\u0435, \u0442\u043e\u043b\u044c\u043a\u043e {refund_id} \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u0435\u043d \u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 $parameters = array();  <\/code><\/pre>\n<p>  \u041e\u0442\u0432\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 POST \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u0438\u0441\u0430\u043b \u0432 4 \u043f\u0443\u043d\u043a\u0442\u0435. \u0412 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.  <\/p>\n<ol>\n<li>bill_id=BILL-1<\/li>\n<li>status=paid<\/li>\n<li>error=0<\/li>\n<li>amount=1.00<\/li>\n<li>user=tel%3A%2B79031811737<\/li>\n<li>prv_name=TEST<\/li>\n<li>ccy=RUB<\/li>\n<li>comment=test<\/li>\n<li>command=bill<\/li>\n<\/ol>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0430\u0434\u0440\u0435\u0441 \u043f\u0440\u0438\u0448\u0451\u043b \u0437\u0430\u043f\u0440\u043e\u0441, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438 \u0440\u0435\u0448\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043b\u0430\u0442\u0435\u0436\u043e\u043c. \u0422\u043e \u043b\u0438 \u0437\u0430\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0434\u0435\u043d\u044c\u0433\u0438, \u0435\u0441\u043b\u0438 \u043f\u043b\u0430\u0442\u0451\u0436 \u043f\u0440\u043e\u0448\u0451\u043b \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0441\u043f\u0435\u0448\u0435\u043d.\u0422\u043e \u043b\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441, \u0435\u0441\u043b\u0438 \u0434\u0435\u043d\u044c\u0433\u0438 \u0431\u044b\u043b\u0438 \u0437\u0430\u0447\u0438\u0441\u043b\u0435\u043d\u044b, \u043d\u043e \u043f\u043b\u0430\u0442\u0451\u0436 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u043d.<\/p>\n<p>  \u0418 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043d\u0435\u0433\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 QIWI \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0448\u0435\u043b\u0451\u043a \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043b\u0430\u0442\u0435\u0436\u0438, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043f\u043e 10 \u043a\u043e\u043f\u0435\u0435\u043a.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u044f \u0445\u043e\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0433 \u0442\u0435\u043c, \u043a\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0412\u0435\u0434\u044c \u043e\u043d \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u043f\u043b\u0430\u0442\u0443 \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u0430\u043d, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c QIWI. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/198668\/\"> http:\/\/habrahabr.ru\/post\/198668\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e.<br \/>  \u042f \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0434\u0430\u0432\u043d\u0438\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u043c \u0445\u0430\u0431\u0440\u0430 \u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0445\u043e\u0436\u0443 \u0442\u0443\u0442 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0441\u0432\u043e\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u041d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041f\u0440\u0438\u0447\u0451\u043c \u043d\u0438\u0433\u0434\u0435.<br \/>  \u0410 \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 (REST) \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b QIWI. \u041c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0432\u0435\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0431, \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438, \u0442.\u043a. \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435\u0442, \u0445\u043e\u0442\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0443\u0436 \u0438 \u0441\u043b\u043e\u0436\u043d\u0430\u044f.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043d\u0435 \u0442\u0430\u043a \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443-\u0442\u043e.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-198668","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198668"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198668\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}