Stripe and Online Payments Tutorial
Learn Stripe and Online Payments step by step: 38 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Stripe Is and How Online Payments Flow Understand what Stripe does, who is involved in an online card payment, which Stripe objects model it, and how this course runs its examples without a network.
- Accounts, Test Mode and API Keys Learn how a Stripe account is organised, the difference between test and live mode, publishable, secret and restricted keys, and how to load keys safely from the environment.
- Your First Stripe API Request Make your first Stripe-style API request with fetch. Learn bearer authentication, form-encoded bodies, response objects, error types and why the HTTP status matters.
- The Node SDK, API Versions and Pagination See what the official Stripe SDK adds to raw HTTP: typed methods, API version pinning, auto-pagination, expandable objects and automatic retries, with runnable stand-ins.
- Dashboard, Stripe CLI and Developer Tools Tour the tools around the Stripe API: the Dashboard, request logs, the event log, the Stripe CLI for triggering events and forwarding webhooks, and how to debug a failing call.
Payment Concepts and Security
- How Card Payments Work Behind the Scenes Follow a card payment from authorization to capture, settlement and payout. Learn interchange fees, decline codes, holds, chargebacks and what Stripe's fee really covers.
- Money in Code: Amounts and Currencies Learn why money must be stored as integers, how Stripe's minor units work, zero-decimal and three-decimal currencies, safe rounding for tax and splits, and formatting with Intl.
- PCI DSS, Tokenization and Card Data Safety Understand PCI DSS in plain language, why Stripe Elements and Checkout keep you in the lightest compliance tier, how tokenization works, the Luhn check and what never to log or store.
- API Security: HMAC, CSRF, Rate Limits and Trust Secure the code around your payments. Learn trust boundaries, signed requests with HMAC, constant-time comparison, rate limiting, safe error messages and why the client must never decide the price.
- Strong Customer Authentication and 3D Secure Learn what Strong Customer Authentication is, how 3D Secure challenges work, when exemptions apply, and how requires_action and off-session payments fit into your Stripe integration.
Checkout and Payment Intents
- Stripe Checkout: The Hosted Payment Page Take payments with Stripe Checkout. Create a Checkout Session on the server, redirect the customer, handle success and cancel URLs, and fulfil orders safely with a runnable stand-in.
- PaymentIntents and Their Lifecycle Learn the PaymentIntent object at the heart of Stripe payments: every status from requires_payment_method to succeeded, manual capture, cancellation and a runnable state machine.
- The Payment Element and the Client Secret Build a custom payment page with the Stripe Payment Element. Learn the client secret, server and browser roles, confirmPayment, return_url handling and how to verify results on the server.
- Customers, SetupIntents and Saved Payment Methods Save cards for later with Stripe Customer objects and SetupIntents. Learn on-session and off-session use, default payment methods, listing and detaching cards and mapping Stripe customers to your users.
- Idempotency Keys and Safe Retries Learn why network failures cause duplicate payments and how Stripe idempotency keys, exponential backoff and jitter let you retry safely, with a runnable stand-in of the server-side logic.
- Refunds, Disputes and Payouts Handle money after a payment: issue full and partial refunds, respond to chargebacks with evidence, understand the Stripe balance and payout schedule, and track fees with balance transactions.
Subscriptions and Billing
- Products and Prices: Modelling What You Sell Model your catalog with Stripe Products and Prices. Learn one-time and recurring prices, billing intervals, tiered and volume pricing, lookup keys and how to compute totals for each model.
- The Subscription Lifecycle: Trials, Renewals, Cancellation Understand Stripe Subscriptions end to end: creating one with Checkout, every status from trialing to canceled, trial periods, renewals, cancel at period end, pausing and syncing access to your app.
- Invoices, Proration and Plan Changes Learn how Stripe invoices work, their lifecycle from draft to paid, how proration prices mid-cycle upgrades and downgrades, and how to preview changes with a runnable proration calculator.
- Billing Portal, Failed Payment Retries and Dunning Reduce churn from failed payments. Set up the Stripe Customer Portal, understand Smart Retries and dunning emails, handle invoice.payment_failed, and build a runnable retry schedule simulation.
Webhooks
- Webhooks Basics Learn what Stripe webhooks are, why polling is the wrong tool, how events are shaped, and how to build a fast endpoint that acknowledges every event with a 2xx response.
- Verifying Webhook Signatures Understand the Stripe-Signature header, rebuild the HMAC check with node:crypto, defend against replays with a timestamp tolerance, and avoid the raw-body mistake.
- Idempotent Event Handling Make webhook handlers safe to run twice. Store processed event ids, use database unique constraints, apply state changes atomically, and use idempotency keys for outgoing requests.
- Webhook Retries and Ordering Learn how Stripe retries failed webhook deliveries, why events can arrive out of order, how to fetch fresh state from the API, and how to acknowledge fast and process in a queue.
Connect and Marketplaces
- Stripe Connect and Account Types Understand what Stripe Connect is for, how platforms and connected accounts relate, how Standard, Express and Custom accounts differ, and which model fits a marketplace.
- Onboarding Connected Accounts Walk through Connect onboarding with account links, the requirements object, verification statuses and the account.updated webhook, and learn to gate payouts on real account state.
- Destination Charges and Platform Fees Compare direct, destination and separate charges in Stripe Connect, calculate application fees and seller payouts in integer cents, and see how Stripe processing fees change the math.
- Payouts, Balances and Transfers Learn how Stripe balances work, the difference between transfers and payouts, pending versus available funds, payout schedules, negative balances and reconciliation with balance transactions.
Testing and Fraud
- Test Mode and Test Cards Learn how Stripe test mode keeps real money safe, how test and live keys differ, which published test card numbers trigger success, declines and 3D Secure, and how to build a test matrix.
- Testing Webhooks Locally Learn how to receive Stripe webhooks on your own machine with the Stripe CLI, trigger sample events, write automated tests with signed fixtures, and replay events after fixing bugs.
- Radar and Fraud Prevention Understand common payment fraud such as card testing and stolen cards, how Stripe Radar scores risk, how rules and velocity limits work, and which signals your own code should check.
- Disputes and Chargebacks Learn the lifecycle of a card dispute, the dispute webhooks and statuses, what evidence wins, deadlines and fees, and how to reduce chargebacks with clear billing descriptors and refunds.
Compliance and Patterns
- PCI DSS and Staying Out of Scope Understand what PCI DSS requires, how Stripe Checkout, Elements and tokenization keep card data off your servers, which self-assessment questionnaire applies, and common mistakes that widen scope.
- Strong Customer Authentication and 3D Secure Learn what Strong Customer Authentication is, how 3D Secure challenges work, how PaymentIntent statuses like requires_action drive your code, exemptions, and off-session payments.
- Refunds, Tax and Invoices Handle full and partial refunds in integer cents, understand sales tax, VAT and Stripe Tax at a practical level, and generate clear invoices and receipts with correct totals and rounding.
Projects and Practice
- Project: A Webhook Processor Build a complete, runnable webhook processor with signature verification, replay protection, idempotent storage, a worker queue with retries and a dead-letter list, all on loopback.
- Project: A Marketplace Ledger Build a double-entry style ledger for a marketplace in integer cents, covering sales, platform fees, seller balances, refunds, payout holds and a final reconciliation check.
- Payments Practice Exercises Practice webhook verification, idempotency, Connect fee splits, refunds, tax and fraud rules with hands-on exercises, each with a runnable starting point and a solution to compare.