Stripe Deep Integration
I korthet
Stripe Deep Integration models the full Stripe surface natively — Payment Intents with 3D Secure, Stripe Connect for federation/club/org_node payouts, signed and idempotent webhooks, refunds with reason tracking, and per-tenant Tax configuration with multi-jurisdiction VAT — so booking, license, and POS payments settle directly with platform fees and per-country tax behaviour.
Så fungerar det
StripePaymentIntent persists every intent the platform creates with stripe_payment_intent_id, client_secret, status (requires_payment_method, requires_confirmation, requires_action, processing, succeeded, canceled, requires_capture), capture_method (automatic or manual), payment_method_types, application_fee_amount, connected_account_id, and a structured StripePaymentIntentMetadata block (invoice_id, debtor_id, debtor_type, fee_category, season_id, custom). CRUD lives under /stripe/payment-intents/ with status and invoice_id filters and dedicated confirm, capture, cancel, and sync endpoints. StripeTenantConnectAccount onboards federations, clubs, and org_nodes via standard, express, or custom account types; the document tracks onboarding requirements_due, payouts_enabled, charges_enabled, details_submitted, country, default_currency, and platform_fee_percent, exposed through /stripe/connect/ with account-link, refresh, and disable endpoints.
Inbound webhooks land at POST /stripe/webhooks/, where a StripeWebhookEvent verifies the signature against STRIPE_WEBHOOK_SECRET, applies an idempotency_key check, and dispatches verified events to typed handlers (payment_intent.succeeded/failed/canceled/requires_action, charge.refunded, refund.updated, account.updated); failed verifications are recorded with status=failed_verification for audit. StripeScaChallenge mirrors the 3DS flow with status (not_required, required, initiated, succeeded, failed), three_ds_version, authentication_flow (challenge or frictionless), and timestamps so SCA outcomes are fully reconcilable. StripeRefund tracks full or partial refunds keyed by stripe_refund_id and stripe_payment_intent_id with reason (duplicate, fraudulent, requested_by_customer).
StripeTaxConfig stores per-country tax_behavior (inclusive or exclusive), tax_code, automatic_tax_enabled, a list of StripeTaxRate entries, tax_registrations, and head_office_address; calculate, sync-rates, and registrations endpoints maintain the per-tenant VAT model (Sweden 25% exclusive, France 20% inclusive, Germany 19% exclusive).
Centrala funktioner
- StripePaymentIntent with full status, capture mode, application fees, and structured metadata
- Stripe Connect onboarding for federation/club/org_node with platform_fee_percent
- Signature-verified, idempotent webhook handling with audit trail
- StripeScaChallenge tracking of 3DS flows (challenge/frictionless) for reconciliation
- StripeRefund with reason codes and per-intent linkage
- Per-tenant Stripe Tax with country-specific behavior and automatic VAT calculation
- Confirm, capture, cancel, sync endpoints for full intent lifecycle
I praktiken
A club admin enables card payments for tournament entries. They open Stripe Connect onboarding, the platform creates a StripeTenantConnectAccount in pending, redirects them through Stripe's hosted onboarding, and Stripe posts back via webhook with details_submitted=true and charges_enabled=true. The platform sets status=active.
A player checks out a 250 SEK entry; the API creates a StripePaymentIntent with application_fee_amount=12 (5% platform fee) and capture_method=automatic. The card requires SCA, so a StripeScaChallenge is recorded as initiated; the player completes the challenge in their bank app, Stripe sends payment_intent.succeeded, the webhook is verified and dispatched, the intent flips to succeeded, and the platform marks the invoice paid. A week later the player requests a refund — the admin issues a partial 100 SEK refund with reason=requested_by_customer, the StripeRefund syncs back, and Stripe Tax recalculates the VAT line automatically.
Features i detta subsystem
6| ID | Status | Funktioner |
|---|---|---|
| F14.07.01 | Levererad | Stripe Payment Intents — StripePaymentIntent-samling tenant-scopad med stripe_payment_intent_id/stripe_client_secret/invoice_id/payment_id/amount/currency/status (requires_payment_method/requires_confirmation/requires_action/processing/succeeded/canceled/requires_capture)/payment_method_types/capture_method (automatic/manual)/metadata (StripePaymentIntentMetadata invoice_id/debtor_id/debtor_type/fee_category/season_id/custom)/connected_account_id/application_fee_amount/requires_action/description/stripe_customer_id; CRUD /stripe/payment-intents/ med filtrering status/invoice_id, confirm/capture/cancel/sync-endpoints ✅ PL-F1407 |
| F14.07.02 | Levererad | Stripe Connect — StripeTenantConnectAccount-samling tenant-scopad med stripe_account_id/account_type (standard/express/custom)/status (pending/onboarding/active/restricted/disabled)/entity_type (federation/club/org_node)/entity_id/country/default_currency/display_name/onboarding (StripeConnectOnboarding requirements_due/payouts_enabled/charges_enabled/details_submitted)/platform_fee_percent; CRUD /stripe/connect/ med filtrering status/entity_type, account-link/refresh/disable-endpoints ✅ PL-F1407 |
| F14.07.03 | Levererad | Stripe Webhooks — StripeWebhookEvent-samling tenant-scopad med stripe_event_id/event_type/status (received/verified/failed_verification/processed/processing_failed)/signature_valid/idempotency_key/payload/processing_error; POST /stripe/webhooks/ med signaturverifiering mot STRIPE_WEBHOOK_SECRET, idempotens-kontroll, dispatch till handlers (payment_intent.succeeded/failed/canceled/requires_action, charge.refunded, refund.updated, account.updated); GET /stripe/webhooks/events för audit-loggning ✅ PL-F1407 |
| F14.07.04 | Levererad | Stripe SCA / 3D Secure — StripeScaChallenge-samling tenant-scopad med stripe_payment_intent_id/status (not_required/required/initiated/succeeded/failed)/three_ds_version/authentication_flow (challenge/frictionless)/failure_reason/initiated_at/completed_at; CRUD /stripe/sca/, POST /stripe/sca/{stripe_pi_id}/complete med success/failure_reason ✅ PL-F1407 |
| F14.07.05 | Levererad | Stripe Refunds — StripeRefund-samling tenant-scopad med stripe_refund_id/stripe_payment_intent_id/invoice_id/refund_type (full/partial)/amount/currency/status (pending/succeeded/failed/canceled/requires_action)/reason (duplicate/fraudulent/requested_by_customer)/description; CRUD /stripe/refunds/ med filtrering status/invoice_id/payment_intent_id, sync-endpoint ✅ PL-F1407 |
| F14.07.06 | Levererad | Stripe Tax — StripeTaxConfig-samling tenant-scopad med country/tax_behavior (inclusive/exclusive)/tax_code/tax_id/tax_id_type/automatic_tax_enabled/tax_rates[StripeTaxRate display_name/percentage/inclusive/country/tax_type/stripe_tax_rate_id]/tax_registrations[]/head_office_address/status (active/inactive/deleted); CRUD /stripe/tax/configs, registrations/sync-rates/calculate-endpoints med per-tenant momsberäkning (SE 25% exclusive, FR 20% inclusive, DE 19% exclusive) ✅ PL-F1407 |
Intressenter som behöver detta subsystem
Förekommer i 3 intressentanalyser