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/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
PaymentAccount. Called during registration or first payment.
Card management
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. KeyStripeService methods:
Subscriptions
Tutors pay a subscription fee to use the platform.subscription_products table with product_id, price_id, and trial_period.
Billing portal
Subscription statuses
Tracked in thesubscriptions 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
STRIPE_SUBSCRIPTION_SIGNING_SECRET. Updates subscription status in the database based on Stripe events.