Stripe Integration Expert

Stripe Integration Expert automation and integration

Stripe Integration Expert is a community skill for building advanced payment integrations with the Stripe platform, covering Payment Intents, Connect accounts, billing portal, dispute handling, and multi-currency support for complex e-commerce payment workflows.

What Is This?

Overview

Stripe Integration Expert provides patterns for building custom payment flows beyond basic checkout sessions. It covers Payment Intent creation with manual confirmation for custom checkout UIs, Stripe Connect integration for marketplace and platform payment splitting, customer billing portal for self-service subscription management, dispute and chargeback handling with evidence submission workflows, and multi-currency pricing with automatic currency conversion and localized payment methods. The skill enables developers to implement sophisticated payment architectures that handle marketplace splits, international transactions, and complex billing scenarios.

Who Should Use This

This skill serves payment engineers building marketplace platforms with Stripe Connect, SaaS developers implementing complex billing logic with metered usage and tiered pricing, and teams handling international payments with multi-currency requirements.

Why Use It?

Problems It Solves

Marketplace payment flows require splitting funds between platform and connected accounts with proper fee handling. Custom checkout experiences need Payment Intent management with client-side confirmation and 3D Secure handling. Subscription billing with metered usage requires tracking consumption and generating invoices. International payments demand currency conversion and region-specific payment method support.

Core Highlights

Payment Intent builder manages the full lifecycle from creation through confirmation with error recovery. Connect manager handles account onboarding, transfer creation, and fee splitting. Billing engine tracks metered usage and generates invoices with proration. Dispute handler automates evidence collection and submission.

How to Use It?

Basic Usage

import stripe
import os

stripe.api_key = os.environ[
    'STRIPE_SECRET_KEY']

class PaymentManager:
    def create_payment_intent(
            self, amount: int,
            currency: str = 'usd',
            customer_id: str = None
            ) -> dict:
        params = {
            'amount': amount,
            'currency': currency,
            'automatic_payment_methods': {
                'enabled': True}}
        if customer_id:
            params['customer'] = (
                customer_id)
        intent = stripe.PaymentIntent\
            .create(**params)
        return {
            'id': intent.id,
            'client_secret':
                intent.client_secret,
            'status': intent.status}

    def confirm_payment(
            self, intent_id: str,
            payment_method: str) -> dict:
        intent = stripe.PaymentIntent\
            .confirm(intent_id,
                payment_method=(
                    payment_method))
        return {
            'status': intent.status,
            'requires_action':
                intent.status ==
                'requires_action'}

pm = PaymentManager()
result = pm.create_payment_intent(2000)
print(f"Secret: {result['client_secret']}")

Real-World Examples

import stripe

class ConnectPlatform:
    def create_connected_account(
            self, email: str) -> dict:
        account = stripe.Account.create(
            type='express',
            email=email,
            capabilities={
                'card_payments': {
                    'requested': True},
                'transfers': {
                    'requested': True}})
        link = stripe.AccountLink.create(
            account=account.id,
            refresh_url=(
                'https://app.com/refresh'),
            return_url=(
                'https://app.com/return'),
            type='account_onboarding')
        return {'account_id': account.id,
                'onboarding_url': link.url}

    def create_platform_charge(
            self, amount: int,
            connected_id: str,
            platform_fee: int) -> dict:
        intent = stripe.PaymentIntent\
            .create(
                amount=amount,
                currency='usd',
                application_fee_amount=(
                    platform_fee),
                transfer_data={
                    'destination':
                        connected_id},
                automatic_payment_methods={
                    'enabled': True})
        return {'intent_id': intent.id,
                'amount': amount,
                'fee': platform_fee}

platform = ConnectPlatform()
charge = platform.create_platform_charge(
    5000, 'acct_seller123', 500)
print(f"Charge: {charge}")

Advanced Tips

Use Payment Intent metadata to store order IDs and user references for reconciliation between your database and Stripe records. Implement retry logic with exponential backoff for idempotent API calls using Stripe idempotency keys. Configure Stripe Radar rules to automatically block suspicious transactions based on custom risk scoring.

When to Use It?

Use Cases

Build a marketplace where buyers pay through the platform and funds are split between sellers and the platform automatically. Create a SaaS billing system with metered API usage tracking and overage charges. Implement a multi-currency checkout that accepts local payment methods based on customer geography.

Related Topics

Payment processing, marketplace payments, Stripe Connect, subscription billing, and PCI compliance.

Important Notes

Requirements

Stripe account with appropriate Connect and billing capabilities enabled. Python with the stripe package installed. HTTPS webhooks for receiving asynchronous payment events.

Usage Recommendations

Do: use idempotency keys on all payment creation and confirmation requests to prevent duplicate charges. Store Payment Intent IDs alongside order records for payment tracking. Test all payment flows with Stripe test mode and test card numbers.

Don't: store or log raw card numbers anywhere in your application infrastructure. Process payments without webhook confirmation as client-side redirects can be unreliable. Skip 3D Secure handling which is required in many regions for regulatory compliance.

Limitations

Stripe Connect Express accounts have limited customization for the onboarding flow compared to Custom accounts. Platform fees on Connect charges cannot exceed the total payment amount. Some payment methods have delayed settlement and may require additional handling for refund timing.