Payment Intent
نية الدفع
GLS-000140
Definition
Stripe's object that tracks the lifecycle of a payment — from initiated to completed or failed.
كائن Stripe الذي يتتبع دورة حياة الدفع — من البدء إلى الاكتمال أو الفشل.
Why It Matters
Every payment in a 404Fault project (food delivery, booking, marketplace) flows through a PaymentIntent. Understanding it is required to build any paid feature.
كل دفع في مشروع 404Fault (توصيل طعام وحجز وسوق) يمر عبر PaymentIntent. فهمه مطلوب لبناء أي ميزة مدفوعة.
Full Definition
Example Usage
“Server creates PaymentIntent (amount: 5000, currency: 'usd'), returns client_secret. Client uses stripe.confirmPayment(client_secret) to complete the charge.”
“الخادم يُنشئ PaymentIntent (amount: 5000, currency: 'usd')، يُعيد client_secret. العميل يستخدم stripe.confirmPayment(client_secret) لإتمام التحصيل.”
AI Builder Tips
Avoid these mistakes when using Payment Intent:
Creating PaymentIntent on the client side (amount can be tampered)
Not listening to payment_intent.succeeded webhook (payment can succeed after the user closes the page)
Sign in to unlock guided AI explanations from AI Teacher.
Generate a Prompt
Copy this prompt and use it directly with any AI model — no setup needed.
Help me build a project using Payment Intent. Explain: 1. What is Payment Intent and why it matters 2. The core architecture and required tools 3. Step-by-step implementation plan 4. Common mistakes to avoid: Creating PaymentIntent on the client side (amount can be tampered), Not listening to payment_intent.succeeded webhook (payment can succeed after the user closes the page) 5. Best practices and production tips