Skip to main content

Overview

Stripe handles all payment processing. The integration uses Stripe Connect for marketplace-style payments: students pay the platform, the platform pays tutors. File: app/Models/Services/Payments/StripeService.php SDK: stripe/stripe-php v7.2

Configuration

Config file: config/services.php under stripe key.

Account types

Two types of Stripe accounts are used: Both stored in payment_accounts table, linked to payment_gateways.

Key operations

Customer management

Creates a Stripe Customer, stores the ID in PaymentAccount. Called during registration or first payment.

Card management

Cards stored in the cards table with card_id, brand, last_4, exp_month, exp_year, is_default. Soft-deleted when removed.

Charging & payment flow

The full charge → capture → receipt → payout flow is documented in Booking & Payments. Key StripeService methods:

Subscriptions

Tutors pay a subscription fee to use the platform.
Subscription products are defined in the subscription_products table with product_id, price_id, and trial_period.

Billing portal

Generates Stripe Customer Portal URLs for self-service subscription management.

Subscription statuses

Tracked in the subscriptions table:

Webhooks

Payment webhooks

Endpoint: POST /api/v1/payments/webhooks/accounts Validates webhook signature using STRIPE_SIGNING_SECRET.

Subscription webhooks

Endpoint: POST /api/subscriptions/webhooks
Validates signature using STRIPE_SUBSCRIPTION_SIGNING_SECRET. Updates subscription status in the database based on Stripe events.
Both webhook endpoints are public (no auth middleware). Security relies entirely on Stripe’s webhook signature verification.

Payment status flow

See Booking & Payments — Step 3 for the full payment flow with booking state transitions.