Skip to content

Normalize problem with prices attribute of SendInvoiceMethod #33

Closed
@oRastor

Description

@oRastor

I tried to send an invoice, but got the notice:
PHP Notice: Array to string conversion in .../src/ApiClient.php on line 106

And receive unsuccessful response from telegram.

Example

$invoice = SendInvoiceMethod::create(
    $telegramAccount->getTelegramId(),
    'title',
    'description',
    'payload',
    'token',
    'startParameter',
    'USD',
    [LabeledPriceType::create('label', 234)]
);

$bot->sendInvoice($invoice);

When ApiClient try to createStreamBody it cast value (array) as string:

        foreach ($request->getData() as $name => $value) {
            // todo [GreenPlugin] fix type cast and replace it to normalizer
            $stream .= $this->createDataStream($boundary, $name, (string) $value);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions