Update ykassa.php

This commit is contained in:
Andrey Kuvshinov
2021-06-13 08:51:38 +00:00
parent 40df46c3b6
commit c7793b08c6

View File

@@ -0,0 +1,31 @@
<?php
function ykassa(){
$headers = array(
'Content-Type: application/rss+xml',
'Authorization: OAuth '.YA_TURBO_TOKEN,
'Content-Encoding: gzip'
);
$ch = curl_init($path);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$res = curl_exec($ch);
curl_close($ch);
$res = json_decode($res, true);
print_r($res);
}