Stripe to platforma płatności online używana przez miliony firm na świecie — od startupów po Fortune 500. Stripe obsługuje karty kredytowe, BLIK, przelewy, subskrypcje, marketplace payouts, invoicing i wiele więcej.
Stripe oferuje najlepsze API w branży płatności. Developer-first podejście, doskonała dokumentacja, webhooks, Stripe Elements (gotowe komponenty UI) i Stripe Connect dla marketplace.
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
export async function createCheckout(priceId: string) {
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [{ price: priceId, quantity: 1 }],
success_url: 'https://app.com/success?session={CHECKOUT_SESSION_ID}',
cancel_url: 'https://app.com/pricing',
payment_method_types: ['card', 'blik'],
});
return session.url;
}
export async function handleWebhook(req: Request) {
const sig = req.headers['stripe-signature'];
const event = stripe.webhooks.constructEvent(
req.body, sig, process.env.WEBHOOK_SECRET
);
switch (event.type) {
case 'checkout.session.completed':
await activateSubscription(event.data.object);
break;
case 'invoice.payment_failed':
await notifyPaymentFailed(event.data.object);
break;
case 'customer.subscription.deleted':
await deactivateSubscription(event.data.object);
break;
}
}
Karty, BLIK, przelewy, Apple Pay, Google Pay. Stripe Checkout lub Elements.
Recurring billing, trials, proration, metered usage. Customer portal.
Marketplace payouts. Split payments, onboarding sprzedawców, KYC.
Automatyczne faktury, PDF, email. Tax calculation, credit notes.
Stripe Radar. ML-based fraud detection. 3D Secure, risk scoring.
Real-time events. Payment succeeded, failed, refunded. Retry logic.
Idealny gdy: budujesz SaaS z subskrypcjami, marketplace z payouts, e-commerce, potrzebujesz najlepszego API płatności, chcesz BLIK + karty.
Nie najlepszy gdy: operujesz tylko w Polsce (tańszy Przelewy24/PayU), potrzebujesz tylko prostego przelewu, budżet nie pozwala na 2.9% + 0.25€ prowizji.