TelegramBot / Api

Native PHP Wrapper for Telegram BOT API
MIT License
1.09k stars 323 forks source link

Can't find field "label" when I send sendInvoice #336

Open devig opened 3 years ago

devig commented 3 years ago

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);

DewFill commented 2 years ago

Попробуйте [$prices->toJson(true)].