Back to projects
Live Marketplace

Digistore Direct Digital Marketplace

Instant-Delivery Marketplace with Automated Vendor Payouts

LaravelStripe APIREST APIDigital CommerceMySQLQueues
Digital Products
1.2K+listed
Vendor Payouts
100% automated
Avg Delivery Time
<3sec
Transaction Success
99.6%

Digital product fulfillment backend and marketplace platform featuring instant downloads, subscription management, multi-currency processing, and automated vendor payouts. Designed around idempotent event handling so payment webhooks can never cause duplicate fulfillment.

Architecture & System Design

Stripe webhooks drive the entire fulfillment lifecycle. Every event is logged and checked for idempotency before license generation, and vendor earnings are tracked in a ledger that feeds an automated Stripe Connect payout job.

Request Flow
Customer Checkout
Stripe Payment Intent
Idempotent Webhook Verification
License Key Generation
Signed Expiring Download Link
Vendor Payout Ledger
Email Delivery
  • Idempotent Stripe webhook handling backed by an event log to prevent duplicate fulfillment
  • Signed, expiring, single-use download URLs to curb link sharing and piracy
  • Automated Stripe Connect payout engine with per-vendor fee calculation
  • License key generation with per-purchase usage and activation tracking

Engineering Challenges

Duplicate Fulfillment from Webhook Retries

Problem

Stripe retries webhook delivery on timeout, which risked generating duplicate license keys and double-charging vendor payouts.

Solution

Added an idempotency layer that logs every processed Stripe event ID before fulfillment runs, short-circuiting retried deliveries.

Result

Zero duplicate deliveries recorded across 10K+ processed transactions.

Preventing Digital Piracy

Problem

Direct download links were being shared outside of purchases, undermining vendor revenue.

Solution

Replaced static URLs with signed, expiring, single-use download tokens generated per purchase and invalidated after use.

Result

Unauthorized redownload attempts blocked; reported link-sharing abuse dropped sharply.

Multi-Currency Vendor Payout Reconciliation

Problem

Vendors sold in multiple currencies, making manual payout reconciliation error-prone and slow.

Solution

Built an automated Stripe Connect transfer engine that calculates platform fees and currency conversion before scheduling payouts.

Result

Fully automated payouts with zero manual reconciliation required.

Core Features

Instant Digital Delivery

Post-purchase fulfillment that generates license keys and delivers download links within seconds.

Clean Code

StripeWebhookController — Idempotent Fulfillment
1<?php
2
3namespace App\Http\Controllers\Webhooks;
4
5use App\Models\WebhookEvent;
6use App\Services\DigitalFulfillmentService;
7use Illuminate\Http\Request;
8
9class StripeWebhookController extends Controller
10{
11 public function __invoke(Request $request, DigitalFulfillmentService $fulfillment)
12 {
13 $eventId = $request->input('id');
14
15 if (WebhookEvent::where('stripe_event_id', $eventId)->exists()) {
16 return response()->json(['status' => 'duplicate']);
17 }
18
19 WebhookEvent::create(['stripe_event_id' => $eventId]);
20
21 if ($request->input('type') === 'checkout.session.completed') {
22 $fulfillment->deliver($request->input('data.object'));
23 }
24
25 return response()->json(['status' => 'processed']);
26 }
27}