Stripe Payments & SaaS Billing Systems · درس

معالجة أول دفعة باستخدام Checkout

نفّذوا تدفق دفع بسيطًا باستخدام Stripe Checkout، مع توضيح كيفية جمع بيانات البطاقة وإتمام المعاملة.

الدرس 3 من 411 خطوة

معالجة أول دفعة باستخدام Checkout درس مجاني في Stripe Payments & SaaS Billing Systems على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Stripe Payments & SaaS Billing Systems، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Stripe Payments & SaaS Billing Systems 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Welcome to Stripe Checkout!

Stripe Checkout is a pre-built, hosted payment page. Stripe handles the hard parts — security and compliance — so you never touch raw card details.

How Stripe Checkout Works

How Checkout works: your server creates a session, the customer is redirected to Stripe's secure page to pay, then sent back to your site afterward.

The Checkout Session Object

The Checkout Session object describes the payment: the line_items being bought, the mode, and the success and cancel redirect URLs.

Setting Up Your Server

To create a session you need a small server (Node, Python, Ruby, PHP, etc). Install the Stripe library and init it with your secret key — never expose it client-side.

Creating a Checkout Session

Here's how to create a one-time Checkout Session on your server. Swap in your real secret key; it prints the session ID and URL.

const stripe = require('stripe')('sk_test_YOUR_SECRET_KEY');

async function createCheckoutSession() {
  try {
    const session = await stripe.checkout.sessions.create({
      line_items: [
        {
          price_data: {
            currency: 'usd',
            product_data: {
              name: 'CoddyKit Course',
            },
            unit_amount: 1999, // $19.99
          },
          quantity: 1,
        },
      ],
      mode: 'payment',
      success_url: 'https://example.com/success?session_id={CHECKOUT_SESSION_ID}',
      cancel_url: 'https://example.com/cancel',
    });
    console.log('Checkout Session created:');
    console.log('  ID:', session.id);
    console.log('  URL:', session.url);
  } catch (error) {
    console.error('Error creating Checkout Session:', error.message);
  }
}

createCheckoutSession();

Redirecting to Checkout

The server returns a session.url; your client then redirects the user there with window.location.href = session.url to reach Stripe's secure page.

Handling Success & Cancel

After paying or cancelling, the customer returns to your success_url or cancel_url. The success URL can carry the session ID for confirmation.

Retrieving Session Details

On the success page, use the session_id to retrieve the full session on your server. That confirms payment status before you fulfill the order.

Security & PCI Compliance

Checkout's big win is security: Stripe handles all card data, your server never sees card numbers, and your PCI compliance burden drops dramatically.

Quick Check

Which of the following are key benefits or features of using Stripe Checkout for processing payments?

Recap: Your First Payment

Recap: Stripe Checkout is a hosted page driven by a session object you create server-side, then a redirect, post-payment handling, and big security wins.

البدء مجانًا

تعلم Stripe Payments & SaaS Billing Systems مع معلم ذكاء اصطناعي — مجانًا

اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.

الدورات
12
الدروس
48

الأسئلة الشائعة

هل درس «معالجة أول دفعة باستخدام Checkout» مجاني؟

نعم — نص درس «معالجة أول دفعة باستخدام Checkout» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Stripe Payments & SaaS Billing Systems، انتقل إلى CoddyKit PRO. تتضمن دورة Stripe Payments & SaaS Billing Systems 4 دروس في المجموع.

ماذا ستتعلم في «معالجة أول دفعة باستخدام Checkout»؟

نفّذوا تدفق دفع بسيطًا باستخدام Stripe Checkout، مع توضيح كيفية جمع بيانات البطاقة وإتمام المعاملة. تتمرن على Stripe Payments & SaaS Billing Systems مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Stripe Payments & SaaS Billing Systems؟

لا تُشترط خبرة سابقة. Stripe Payments & SaaS Billing Systems على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.

كم من الوقت يستغرق درس «معالجة أول دفعة باستخدام Checkout»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Stripe Payments & SaaS Billing Systems هذا؟

نعم. كل درس في Stripe Payments & SaaS Billing Systems يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. فهم منظومات الدفع الإلكتروني
  2. إعداد حساب Stripe وجولة في لوحة المعلومات
  3. معالجة أول دفعة باستخدام Checkout
  4. فهم وضع الاختبار وبطاقات الاختبار في Stripe
← العودة إلى Stripe Payments & SaaS Billing Systems