PHP
- 1 ответ
- 0 вопросов
1
Вклад в тег
$token = 'токен нельзя палить';
$paramGet = [
"id" => (string)(1000 * time()),
"sum" => [
"amount" => 8,
"currency" => "643"
],
"paymentMethod" => [
"type" => "Account",
"accountId" => "643"
],
"comment" => "Testing",
"fields" => [
"account" => "+79114353887"
]
];
$dataPostParam = json_encode($paramGet, JSON_UNESCAPED_UNICODE);
$ch = curl_init("https://edge.qiwi.com/sinap/api/v2/terms/__idPROVIVER__/payments");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer ' . $token
)
);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataPostParam);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$sResponse = curl_exec($ch);