Api
Api copied to clipboard
Can't find field "label" when I send sendInvoice
I've got error TelegramBot\Api\BotApi::curlValidate($curl = resource(10) of type (curl), $response = '{"ok":false,"error_code":400,"description":"Bad Request: can't parse labeled price: Can't find field \"label\""}') ...vendor/telegram-bot/api/src/BotApi.php:263
$l = new \TelegramBot\Api\Types\Payments\LabeledPrice(); $l->setLabel('qwe'); $l->setAmount(500);
$prices=[$l];
$bot->sendInvoice( $chatId, 'Qwe','descr', $payload, $providerToken, '','USD', $prices, false, 'https://site.me/storage/users/qwe.jpg', null, 640, 490);
Попробуйте [$prices->toJson(true)].