Urgent.News

What's breaking now, across thousands of outlets.

Tech

Secure Telegram Stars Payment Flow in PHP: sendInvoice pre_checkout_query successful_payment

Architecture Overview A Telegram Stars payment flow has three distinct phases. First, the bot sends an sendInvoice request containing a unique lead identifier and an HMAC-protected initData . The lead identifier is a 14-character hex string generated with bin2hex(random_bytes(7)) and stored in a database. Second, when the user taps the MainButton, the bot calls pre_checkout_query to verify the…

The Telegram Stars payment flow is structured into three key phases. Initially, the bot generates an invoice by transmitting a sendInvoice request to the user. This request includes a unique lead identifier and a HMAC-protected initData string. The lead identifier, a 14-character hex string, is created using bin2hex(random_bytes(7)) and then saved in a database.

Subsequently, upon the user tapping the MainButton, the bot invokes pre_checkout_query to authenticate the invoice, ensuring it has not been duplicated, the bot token remains valid, and the auth_date is recent. Upon successful payment, the successful_payment function is triggered, which updates the invoice status as paid, modifies the lead state, and notifies the user.

Any omission or incorrect validation at these stages could allow an attacker to manipulate the initData and subsequently redirect funds to an unauthorized account.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A message from Intel

  • 67% of leaders believe readiness for human-robot workforce by 2030
  • 40% of leaders lack formal strategy for robotics deployment
  • Safety concerns delay robotics deployment in many organizations

80 000 échantillons, des centaines de protéines : pourquoi la VR change la donne pour la biologie structurale (et mon…

80 000 échantillons, des centaines de protéines : pourquoi la VR change la donne pour la biologie structurale (et mon quotidien de dev bioinfo) Quand j'ai vu l'annonce Alamar/Nightingale sur l'analyse…

  • NULISA analysis of 80,000 UK Biobank samples tracks early neurodegeneration signs
  • NexoPeek VR headset transforms into immersive molecular laboratory
  • PDB Pro visualizer enables cross-database research with AI-predicted pocket detection

Say hi to Paperwall, a design tool that fits in one HTML file

I kept needing a quick poster, a slide, an invitation, and kept bouncing off tools that wanted an account, a subscription, or a watermark in the corner. So I built Paperwall. What it does.

  • Paperwall is a single-file design tool
  • No account or subscription needed
  • Runs entirely offline

Building a GPS file converter that never uploads your files

Every online converter for fitness files works the same way: you upload your activity, a server parses it, you download the result. For a GPX track that is a strange deal to accept.

  • GPX Converter processes files entirely in the browser, eliminating uploads
  • FIT to GPX conversion increases file size 5-8 times due to XML formatting
  • GPX Converter offers free, account-free access at gpxconverter.com

More from Sunday 8 November →