Two-Page PHP Stripe Checkout

Заказчик: AI | Опубликовано: 22.02.2026

I have a simple flow in mind: a landing page that shows a single product, then a secure Stripe checkout, followed by a success page. It all needs to be written in plain PHP (no frameworks) and must handle product purchase payments only. During checkout I have to capture the customer’s shipping address and contact number, pass those details into the Stripe session, and store them locally in a small MySQL table (order_id, name, email, phone, address, amount, Stripe payment ID). Once payment succeeds, an order-confirmation email should fire automatically to the buyer using PHPMailer (or the native Stripe email hook if you prefer) so they immediately know the order was received. Key points you should cover: • Use the official Stripe PHP SDK and best-practice client/server token handling. • Keep the public page mobile-friendly but minimal—logo, product description, price, buy button. • Protect the secret key via an .env or config file kept outside web root. • After payment, redirect to /thank-you.php that shows order summary pulled from the database. • Provide a README with setup steps, required PHP extensions, and how to set environment variables. Acceptance Criteria 1. Payment succeeds end-to-end in Stripe test mode. 2. Shipping address and contact number appear in both Stripe dashboard and local database. 3. Buyer receives a clearly formatted confirmation email with order details. 4. Code passes a quick scan for obvious security issues (e.g., SQL injection, key exposure). Deliverables – index.php (product & checkout trigger) – thank-you.php (success page) – db.sql for table creation – .env.sample – README.md If everything works smoothly in test mode, I’ll switch the keys to live and release final payment.