Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

Sell a file for USDT with one PHP file (no Stripe, no KYC)

Stripe and PayPal weren't an option for this project, so we wanted to sell a digital file for crypto without a payment processor or an account anywhere. The whole thing is one download.php. The buyer sends USDT (TRC20) t

Stripe and PayPal weren't an option for this project, so we wanted to sell a digital file for crypto without a payment processor or an account anywhere.
The whole thing is one download.php. The buyer sends USDT (TRC20) to our wallet and pastes the transaction id. The script asks the public TronGrid API for that transaction and checks that it went to our address, that the contract is USDT, and that the amount is at least the price. Only then it reads the file and sends it.
The file lives outside the web root, so a direct URL gives 404. If TronGrid is down the script answers 502 and does not hand out the file. A malformed txid gets 400, an unpaid one gets 403.
The live demo is our own shop page, kit.html, priced at 1 USDT. What we sell with it is a pack of 20 prompts and 3 Python scripts (price scraper, Telegram bot template, CSV profiler). You don't need to buy anything to read the code.
Known gaps: a txid is not bound to a buyer, so anyone holding a paid txid can download again, and you depend on one public API with no key.
Code and notes: https://swarmagency.shop/free/crypto-paywall.php
Demo: https://swarmagency.shop/kit.html
Feedback on the verification logic is welcome, especially where you would break it.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.