What Stripe does
When someone buys something on your website, a lot happens behind the scenes. The credit card number needs to be encrypted and sent to the card network (Visa, Mastercard). The bank that issued the card needs to approve the charge. The money needs to be held, then transferred to your bank account. Stripe handles all of this.
Payment processor vs payment gateway
A payment gateway is the connection between your website and the financial system. A payment processor is the company that actually moves the money. Stripe is both. Older setups required you to choose a separate gateway and processor. Stripe combines them into one service, which is why it became so popular.
How money flows through Stripe
- 1A customer enters their card details on your website
- 2Stripe encrypts the card data and sends it to the card network for authorization
- 3The customer's bank approves or declines the charge
- 4If approved, Stripe captures the payment and holds the funds
- 5After a 2-day settlement period, Stripe transfers the money to your bank account minus their fee
What Stripe charges
Stripe charges 2.9% plus 30 cents per successful transaction. On a $100 sale, you pay $3.20 to Stripe and keep $96.80. There are no monthly fees, no setup fees, and no minimum charges. You only pay when you actually process a payment.
For subscriptions, Stripe also offers Billing, which handles recurring charges, invoicing, and proration when customers upgrade or downgrade. The same 2.9% + 30 cent fee applies to each recurring charge.
Webhooks: how your site knows a payment happened
After a payment succeeds (or fails), Stripe sends a webhook to your website. A webhook is an automatic message from one system to another. Your site receives this message and takes action: creating an order record, sending a confirmation email, or granting access to a paid product.
Webhooks are important because payments can fail or be delayed. Your site should not assume a payment worked just because the customer clicked "Pay." It should wait for the webhook confirmation from Stripe.
When you connect Stripe to a CodePup AI site, you paste your publishable and secret keys. CodePup automatically sets up the webhook endpoint so your site responds to payment events correctly.
One-time payments vs subscriptions
- One-time payments: Customer pays once, gets the product. Good for physical goods, digital downloads, and services.
- Subscriptions: Customer pays on a recurring schedule (monthly, yearly). Good for SaaS, memberships, and ongoing services.
- Metered billing: Customer pays based on usage. Good for API services and cloud infrastructure.
Why Stripe won
Before Stripe, accepting payments online required a merchant account, a payment gateway, and weeks of paperwork. Stripe launched in 2011 with a simple API that developers could integrate in an afternoon. That developer-friendly approach made it the default choice for startups, and it now processes hundreds of billions of dollars in payments annually.
Getting started
You create a Stripe account, verify your identity and bank details, and get two API keys: a publishable key (safe to use in frontend code) and a secret key (used only on your server). These keys connect your website to your Stripe account. Every payment your site processes goes into your Stripe balance and then to your bank.