Salebot.ai
  • About
  • The basics: How to use Salebot.ai
    • The basics of using the editing software
    • Creating blocks and the types of them
    • Arrows (connections)
    • Quick actions
    • Buttons
    • Condition and Matching selection
    • Links to messengers
    • Blocks "not State"
    • The first message
    • Description of the fields in the Editor
    • How to make the bot not interrupt the dialogue with the client
    • Sending attachments. Tracking links.
    • Getting files from the user
    • Editing text message
    • Random answers in a bot
    • Built-in variables
    • Reservation and recovery
    • Free Videos to master Salebot
  • Administration
    • Custom Roles
    • Reservation and recovery
  • Messengers and chats
    • WhatsApp
    • Whatsapp Business API
    • Telegram
    • Viber
    • Facebook Messenger
    • Official Instagram
    • Online-chat on a site
    • Merging contacts from different messengers
  • Variables
    • Variables
    • Calculator
    • API in Calculator
    • Variable comparison
    • Working with Dates and Time
    • Working with Arrays and Dictionaries
    • List of Useful Regular Expressions
    • How to use variables
  • CRM
    • AmoCRM
    • Bitrix24
  • Working with API
    • The editing software's API
    • Integration with third-party APIs
  • Integrations
    • Payment systems
      • Capusta.space
      • Coinpayments
      • INXY Payments
      • Paypal
      • Payeer.trade
      • Paynow
      • Stripe
      • Telegram
      • Fondy
      • Wayforpay
      • WalletOne
    • InfoBusiness
      • MyOwnConference
      • WebinarGeek
    • Analytics
      • Roistat
      • Facebook Pixel
      • Google Analytics
    • Google Sheets
    • Google Tables
    • Google Calendar
    • Apix-Drive
    • SMS services
    • Sendpulse
    • QuizGO
    • Tilda
    • Linkrr
    • Vakas-Tools
  • Mailings
    • Pipelines
    • Manual mailings
    • Mailing list
    • Stop mailing
    • How to filter clients for mailing
    • Transferring the client base. Uploading Whatsapp numbers
  • To partners
    • How to transfer the project to the customer
  • How to...
    • FAQ
    • ...Create a simple chatbot
    • ...Transfer UTM-labels
    • ...Create a referral program
    • ...Create temporarily available content
    • ...Connect analytics counters and configuring conversions through GTM
    • ...Move clients to another block
    • ...Create personalized images
    • ...Create a menu in Telegram
    • ...Connect Telegram-pay
  • Payment Services
    • Page 1
  • Mini-landing
  • Special capabilities
    • Python programming
    • Generating a QR-code
    • Generating a barcode
    • Barcode recognition on an image
    • Using Google Sheets for mailings
    • Sending requests to messengers and email
    • Working with promo codes
  • Our services
    • Pricing
    • Training courses
  • Group 1
Powered by GitBook
On this page
  • How to connect the payment system
  • Payment system is built into Telegram.
  • How to Invoice a Client
  • Callback on payment
  • Examples
  • Example with minimum parameter sets
  • Example with a Keyboard
  1. Integrations
  2. Payment systems

Telegram

PreviousStripeNextFondy

Last updated 2 years ago

How to connect the payment system

Payment system is built into Telegram.

In order to make payments inside the messenger, you need:

  • connect payment system to bot in botfather bot

  • go to the desired bot settings and in the menu select Payments

  • following instructions to connect an accessible payment system and copy the issued token

How to Invoice a Client

To send invoice to telegram use method

tg_send_invoice(provider_token, platform_id, title, description, currency, prices, photo_url, payload, protect_content, disable_notification, need_name, phone_number, need_email, reply_to_message_id, reply_markup, reply_id) - the required parameters are highlighted in bold

provider_token - token received in Botfather, after connecting the payment system

platform_id - recipient - identifier of user, group or channel

title - item title, 1-32 characters

description - description of goods, 1-255 characters

payload - the first part of the coin about payment, by default tg_payment

prices - price breakdown (description below)

photo_url - link to product picture

disable_notification - 1 - send with notification, 0 - without notification

protect_content - 1 copy and screenshot protection, 0 - unprotected

need_name - 1 if you need a full username to complete the order, 0 - without asking for a name

need_phone_number - 1 if you require a user’s phone number to complete the order, 0 - without a request number

need_email - 1 if you require an email address of the user to complete the order, 0 - without a mail request

reply_to_message_id - the message id to which we respond, '' is not the answer

reply_markup - keyboard, the first button should be a button with pay type

If one of the parameters need_name, need_phone_number or need_email is specified, the user will request the data before paying and save it to the client variables if the payment is successful. In the screenshot below the request for all data input:

prices - an array of arrays with data on the cost of goods and additional services (delivery, packaging, etc.). Displayed on the payment page. The amount shall be indicated either by an integer of 125 or by a fraction through point 120.25 For example: [["goods", 2000], ["VAT", 20.75], ["packaging", 100]

Callback on payment

After successful payment in the chat with the user will come a colbeck as follows:

phone_best 4737685 2120.75 UAH 1955518436

where phone_best - payload - from the request for creation of invoice 473737685 - a chat id, to which originally was sent invoice 2120.75 - the full amount of payment UAH - currency 1955518436 - payment id in the merchant system

Also, if you requested a name, phone and/or email, the client will write down the variables:

tg_payment_name, tg_payment_phone and tg_payment_email

In case of success, the kolbek will be sent to the user’s personal messages. To do this, the client and the bot must cooperate before payment (the client must be subscribed to the bot)!

Examples

prices = [["product", 2000], ["NDS", 20.75], ["package", 100]] result = tg_send_invoice('632593626:TEST:sandbox_i38014109763', platform_id, 'phoneW-200', 'Best Model on the Market', 'UAH', prices, 'https://images11.popmeh.ru/cropped.jpg', 'phone_best', 0, 0, 1, 0, 1)

Example with minimum parameter sets

prices = [["an amazing product", 20000]] result = tg_send_invoice('632593626:TEST:sandbox_i38014109763', platform_id, 'The best bot ever!', 'An amazing course! Be the best!', 'UAH', prices)

Example with a Keyboard

prices = [["product", 2000], ["NDS", 20.75], ["package", 100]] result = tg_send_invoice('632593626:TEST:sandbox_i38014109763', platform_id, 'Phone W-200', 'BEst Model on the Market', 'UAH', prices, 'https://helpix.ru/news/200405/181746/gf200_2.jpg', 'phone_best', 0, 0, 1, 1, 1, '', '{"inline_keyboard": [[{"text":"Pay", "pay":"True"}], [{"text":"One more button", "callback_data": "One more button"}]]}')

currency - payment currency (RUB, USD, UAH and so on )

After receiving the hook about payment, the payment will be automatically confirmed, by answerPreCheckoutQuery .

https://core.telegram.org/bots/payments#supported-currencies
https://core.telegram.org/bots/api#answerprecheckoutquery