Stripe
Payment & Financial Services Platform
Stripe
Overview
Stripe is the world's leading online payment and financial infrastructure platform. Supporting 125+ payment methods, comprehensive APIs, AI-powered fraud detection, subscription management, and financial services, it's widely adopted from startups to enterprises. In 2025, Stripe announced groundbreaking features including the world's first AI foundation model for payments, stablecoin financial services, and multi-currency management capabilities, continuing its evolution from a payment provider to comprehensive financial infrastructure.
Details
Founded in 2010, Stripe has led the industry with developer-friendly APIs and innovative payment technology. As of 2025, Stripe Connect supports over 15,000 SaaS platforms, serving more than 10 million businesses. Recent announcements include AI foundation models for payment optimization, stablecoin-enabled financial accounts, and multi-currency management across 101 countries, showcasing next-generation financial infrastructure capabilities.
Key Features
- 125 Payment Methods: Support for cards, digital wallets, bank transfers, and region-specific payments
- Comprehensive APIs: Unified APIs for payments, subscriptions, and financial services
- AI-Driven Features: Fraud detection, dispute automation, and benchmarking tools
- Stablecoin Support: International transfers and balance management with USDC and USDB
- Multi-Currency Management: Balance and card issuance in USD, EUR, GBP, and more
- Stripe Connect: Embedded payments and financial services for platforms
- Stripe Billing: Flexible subscription and billing systems
- Global Coverage: Licensed and operating in 50+ countries
Supported Payment Methods
- Card Payments: Visa, Mastercard, American Express, Discover, JCB
- Digital Wallets: Apple Pay, Google Pay, PayPal, Amazon Pay
- Bank Transfers: ACH, SEPA, Boleto, SOFORT, Giropay
- Regional Methods: Alipay, WeChat Pay, UPI, PIX, iDEAL
- Buy Now, Pay Later: Klarna, Afterpay, Affirm
- Cryptocurrency: Stablecoins (USDC, USDB)
Pros and Cons
Pros
- Developer Experience: Intuitive and comprehensive API design
- Global Expansion: Unified platform across 50+ countries
- Comprehensive Features: One-stop solution from payments to financial services
- AI Technology: Advanced fraud detection and risk management
- Flexibility: Scalability from small to large-scale operations
- Security: PCI DSS Level 1 compliant with advanced security
- Transparent Pricing: Clear pricing structure without hidden costs
Cons
- Transaction Fees: Relatively high fees for small transactions
- Account Review: Strict approval process may delay onboarding
- Customization Limits: Some constraints due to platform design
- Dependency Risk: Service outages directly impact business operations
- Regional Restrictions: Some features and payment methods are region-limited
- Support: Phone support limited unless on higher-tier plans
Reference Links
- Stripe Official Site
- Stripe Developer Documentation
- Stripe API Reference
- Stripe Dashboard
- Stripe Community
Implementation Examples
1. Basic Setup
# Install Stripe JavaScript SDK
npm install stripe @stripe/stripe-js
# Install Stripe CLI (development/testing)
brew install stripe/stripe-cli/stripe
# or
npm install -g stripe-cli
# Login to Stripe CLI
stripe login
# Start webhook listener (development)
stripe listen --forward-to localhost:3000/webhook
2. Basic Payment Processing
// Server-side (Node.js)
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
// Create Payment Intent
async function createPaymentIntent(amount, currency = 'usd') {
try {
const paymentIntent = await stripe.paymentIntents.create({
amount: amount, // Amount in cents
currency: currency,
payment_method_types: ['card'],
confirmation_method: 'manual',
confirm: true,
// 3D Secure support
payment_method_options: {
card: {
request_three_d_secure: 'automatic'
}
},
// Metadata
metadata: {
order_id: 'order_12345',
customer_id: 'customer_67890'
}
});
return {
success: true,
client_secret: paymentIntent.client_secret,
status: paymentIntent.status
};
} catch (error) {
console.error('Payment Intent creation error:', error);
return {
success: false,
error: error.message
};
}
}
// Customer creation and management
async function createCustomer(customerData) {
try {
const customer = await stripe.customers.create({
email: customerData.email,
name: customerData.name,
phone: customerData.phone,
address: {
line1: customerData.address.line1,
line2: customerData.address.line2,
city: customerData.address.city,
postal_code: customerData.address.postalCode,
country: customerData.address.country
},
metadata: {
user_id: customerData.userId
}
});
return customer;
} catch (error) {
console.error('Customer creation error:', error);
throw error;
}
}
// Client-side (React)
import { loadStripe } from '@stripe/stripe-js';
import {
Elements,
CardElement,
useStripe,
useElements
} from '@stripe/react-stripe-js';
const stripePromise = loadStripe(process.env.REACT_APP_STRIPE_PUBLISHABLE_KEY);
function CheckoutForm() {
const stripe = useStripe();
const elements = useElements();
const [isProcessing, setIsProcessing] = useState(false);
const [paymentResult, setPaymentResult] = useState(null);
const handleSubmit = async (event) => {
event.preventDefault();
if (!stripe || !elements) return;
setIsProcessing(true);
const cardElement = elements.getElement(CardElement);
try {
// Get client_secret from server
const response = await fetch('/create-payment-intent', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 2000, // $20.00
currency: 'usd'
}),
});
const { client_secret } = await response.json();
// Confirm payment
const result = await stripe.confirmCardPayment(client_secret, {
payment_method: {
card: cardElement,
billing_details: {
name: 'Customer Name',
email: '[email protected]'
}
}
});
if (result.error) {
setPaymentResult({ error: result.error.message });
} else {
setPaymentResult({ success: true, paymentIntent: result.paymentIntent });
}
} catch (error) {
setPaymentResult({ error: error.message });
} finally {
setIsProcessing(false);
}
};
return (
<form onSubmit={handleSubmit}>
<CardElement
options={{
style: {
base: {
fontSize: '16px',
color: '#424770',
'::placeholder': {
color: '#aab7c4',
},
},
},
}}
/>
<button
type="submit"
disabled={!stripe || isProcessing}
>
{isProcessing ? 'Processing...' : 'Pay Now'}
</button>
{paymentResult && (
<div className={paymentResult.error ? 'error' : 'success'}>
{paymentResult.error || 'Payment completed successfully'}
</div>
)}
</form>
);
}
export default function CheckoutPage() {
return (
<Elements stripe={stripePromise}>
<CheckoutForm />
</Elements>
);
}
3. Subscription Management
// Create subscription
async function createSubscription(customerId, priceId) {
try {
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [
{
price: priceId,
},
],
payment_behavior: 'default_incomplete',
payment_settings: { save_default_payment_method: 'on_subscription' },
expand: ['latest_invoice.payment_intent'],
// Trial period
trial_period_days: 7,
// Fixed billing cycle
billing_cycle_anchor: Math.floor(Date.now() / 1000) + (30 * 24 * 60 * 60), // 30 days later
// Automatic tax
automatic_tax: {
enabled: true
}
});
return subscription;
} catch (error) {
console.error('Subscription creation error:', error);
throw error;
}
}
// Create price plan
async function createPrice(productId, amount, interval) {
try {
const price = await stripe.prices.create({
product: productId,
unit_amount: amount,
currency: 'usd',
recurring: {
interval: interval, // 'month', 'year', 'week', 'day'
interval_count: 1
},
// Usage-based billing
billing_scheme: 'per_unit',
// Tiered pricing
tiers_mode: 'graduated',
tiers: [
{
up_to: 100,
unit_amount: 1000,
flat_amount: 0
},
{
up_to: 'inf',
unit_amount: 800,
flat_amount: 0
}
]
});
return price;
} catch (error) {
console.error('Price plan creation error:', error);
throw error;
}
}
// Customer portal for subscription management
async function createCustomerPortalSession(customerId, returnUrl) {
try {
const session = await stripe.billingPortal.sessions.create({
customer: customerId,
return_url: returnUrl,
// Customization settings
configuration: {
features: {
payment_method_update: { enabled: true },
invoice_history: { enabled: true },
subscription_cancel: {
enabled: true,
mode: 'at_period_end'
}
}
}
});
return session.url;
} catch (error) {
console.error('Customer portal creation error:', error);
throw error;
}
}
4. Webhook Processing
// Webhook handler (Express.js)
const express = require('express');
const app = express();
// Webhook endpoint
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['stripe-signature'];
const endpointSecret = process.env.STRIPE_WEBHOOK_SECRET;
let event;
try {
event = stripe.webhooks.constructEvent(req.body, sig, endpointSecret);
} catch (err) {
console.error('Webhook signature verification failed:', err.message);
return res.status(400).send(`Webhook Error: ${err.message}`);
}
// Event processing
switch (event.type) {
case 'payment_intent.succeeded':
const paymentIntent = event.data.object;
console.log('Payment succeeded:', paymentIntent.id);
handlePaymentSuccess(paymentIntent);
break;
case 'payment_intent.payment_failed':
const failedPayment = event.data.object;
console.log('Payment failed:', failedPayment.id);
handlePaymentFailure(failedPayment);
break;
case 'customer.subscription.created':
const subscription = event.data.object;
console.log('Subscription created:', subscription.id);
handleSubscriptionCreated(subscription);
break;
case 'customer.subscription.deleted':
const deletedSubscription = event.data.object;
console.log('Subscription deleted:', deletedSubscription.id);
handleSubscriptionCanceled(deletedSubscription);
break;
case 'invoice.payment_succeeded':
const invoice = event.data.object;
console.log('Invoice payment succeeded:', invoice.id);
handleInvoicePaymentSuccess(invoice);
break;
case 'customer.subscription.trial_will_end':
const trialSubscription = event.data.object;
console.log('Trial will end:', trialSubscription.id);
handleTrialWillEnd(trialSubscription);
break;
default:
console.log(`Unhandled event type: ${event.type}`);
}
res.json({ received: true });
});
// Event handler functions
async function handlePaymentSuccess(paymentIntent) {
// Order processing, product fulfillment, email sending, etc.
const orderId = paymentIntent.metadata.order_id;
await updateOrderStatus(orderId, 'paid');
await sendConfirmationEmail(paymentIntent.receipt_email);
}
async function handleSubscriptionCreated(subscription) {
// Activate premium features for user account
const customerId = subscription.customer;
await activatePremiumFeatures(customerId);
}
async function handleTrialWillEnd(subscription) {
// Send notification 3 days before trial ends
const customer = await stripe.customers.retrieve(subscription.customer);
await sendTrialEndingNotification(customer.email, subscription);
}
5. Connect (Platform) Implementation
// Create Connected Account
async function createConnectedAccount(accountData) {
try {
const account = await stripe.accounts.create({
type: 'express', // 'standard', 'express', 'custom'
country: accountData.country,
email: accountData.email,
business_type: accountData.businessType,
company: {
name: accountData.companyName,
phone: accountData.phone,
address: accountData.address
},
capabilities: {
card_payments: { requested: true },
transfers: { requested: true }
},
// Instant onboarding (2025 new feature)
settings: {
payouts: {
schedule: {
interval: 'daily'
}
}
}
});
return account;
} catch (error) {
console.error('Connected Account creation error:', error);
throw error;
}
}
// Create onboarding link
async function createAccountLink(accountId, returnUrl, refreshUrl) {
try {
const accountLink = await stripe.accountLinks.create({
account: accountId,
refresh_url: refreshUrl,
return_url: returnUrl,
type: 'account_onboarding',
});
return accountLink.url;
} catch (error) {
console.error('Account link creation error:', error);
throw error;
}
}
// Platform payment with application fee
async function createPlatformPayment(amount, connectedAccountId, applicationFee) {
try {
const paymentIntent = await stripe.paymentIntents.create({
amount: amount,
currency: 'usd',
application_fee_amount: applicationFee, // Platform fee
transfer_data: {
destination: connectedAccountId,
},
metadata: {
platform_fee: applicationFee,
seller_id: connectedAccountId
}
});
return paymentIntent;
} catch (error) {
console.error('Platform payment creation error:', error);
throw error;
}
}
// Split payments (Connect)
async function createTransfer(amount, destination, metadata = {}) {
try {
const transfer = await stripe.transfers.create({
amount: amount,
currency: 'usd',
destination: destination,
metadata: metadata,
// Instant transfer
transfer_group: 'ORDER_123'
});
return transfer;
} catch (error) {
console.error('Transfer creation error:', error);
throw error;
}
}
6. 2025 New Features: Stablecoin & AI Integration
// Stablecoin Financial Account (2025 new feature)
async function createFinancialAccount(currency = 'usd') {
try {
const account = await stripe.treasury.financialAccounts.create({
supported_currencies: [currency],
features: {
card_issuing: { requested: true },
deposit_insurance: { requested: true },
financial_addresses: { aba: { requested: true } },
inbound_transfers: { ach: { requested: true } },
intra_stripe_flows: { requested: true },
outbound_payments: {
ach: { requested: true },
us_domestic_wire: { requested: true }
},
outbound_transfers: {
ach: { requested: true },
us_domestic_wire: { requested: true }
}
},
// Stablecoin support
metadata: {
stablecoin_enabled: 'true',
supported_stablecoins: 'USDC,USDB'
}
});
return account;
} catch (error) {
console.error('Financial account creation error:', error);
throw error;
}
}
// AI fraud detection and dispute handling (2025 enhancement)
async function configureAIFraudDetection(accountId) {
try {
// Radar Rule configuration (AI-enhanced)
const rules = await stripe.radar.rules.create({
action: 'block',
predicate: "card_country != ip_country AND risk_score > 32",
// AI machine learning model application
metadata: {
ai_model: 'payments_foundation_v1',
auto_learning: 'enabled'
}
});
return rules;
} catch (error) {
console.error('AI fraud detection configuration error:', error);
throw error;
}
}
// Multi-currency management (2025 new feature)
async function convertCurrency(amount, fromCurrency, toCurrency) {
try {
// Currency conversion API (actual API scheduled for 2025 release)
const conversion = await stripe.treasury.currencyExchanges.create({
amount: amount,
source_currency: fromCurrency,
destination_currency: toCurrency,
// Real-time exchange rates
exchange_rate_type: 'real_time'
});
return conversion;
} catch (error) {
console.error('Currency conversion error:', error);
throw error;
}
}
// Workflows (automation) - 2025 new feature
async function createWorkflow(workflowData) {
try {
const workflow = await stripe.workflows.create({
name: workflowData.name,
trigger: {
type: 'webhook',
event_types: workflowData.eventTypes
},
steps: workflowData.steps.map(step => ({
type: step.type,
action: step.action,
conditions: step.conditions
}))
});
return workflow;
} catch (error) {
console.error('Workflow creation error:', error);
throw error;
}
}