I try to integrate payments to my telegram bot. I usen telegraf library for working. So I create an invoice
const invoice = {
provider_token: payment_tocken,
start_parameter: 'online_conslutation',
title: 'Онлайн консультация Айболит',
description: 'Проведение Онлайн консультации с врачем. Стоимость 1000 рублей. Длительность 1час',
currency: 'RUB',
photo_url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcThWVMksAXRtRQJn3oHFWyz9FMusRty4pQX5Iobe8OfMEJmRzpD&usqp=CAU',
need_shipping_address: false,
is_flexible: true,
prices: [
{ label: 'Онлайн консультация', amount: 100 }
],
payload: {}
};
And here I send it
const stepHandlerBuy = new Composer()
stepHandlerBuy.action('buy', (ctx) => {
ctx.replyWithInvoice(invoice);
return ctx.wizard.next();
})
But it always return my an error
(node:24476) UnhandledPromiseRejectionWarning: Error: 400: Bad Request:
CURRENCY_TOTAL_AMOUNT_INVALID
at /Users/nabiullinanton/Documents/UnitBean/NodeJSProjects/VetClinicTelegramFront/node_modules/telegraf/core/network/client.js:281:17
As I see I have problem with total amount? but how can I fix it?