Back to projects
Live Store

NutriNaturals — Health & Supplement E-Commerce

Subscription-Based Supplement Store with Recurring Billing

PHPLaravelMySQLE-CommerceHealth TechPayment Gateway
Products Listed
500+SKUs
Subscription Orders
1.2K+active
Recurring Retention
78%
Payment Success
99.3%

Organic health and wellness supplement e-commerce store with product filtering, recurring subscription orders, verified customer reviews, and payment gateway integration. Built around a resilient recurring billing engine that recovers gracefully from failed charges.

Architecture & System Design

Subscriptions run through an explicit state machine handling pause, resume, and cancellation with prorated billing. Failed recurring payments enter a dunning workflow instead of silently cancelling the subscription.

Request Flow
Product Browse
Subscription Plan Selection
Checkout
Recurring Billing Scheduler
Order Fulfillment
Verified Review Gate
Renewal Reminder
  • Subscription state machine handling pause, resume, cancel, and prorated billing
  • Dunning management with automated retry schedule for failed recurring charges
  • Verified-purchase-only review system to prevent review spam
  • Product filtering by health category and ingredient

Engineering Challenges

Managing Subscription Lifecycle Changes

Problem

Customers pausing, resuming, or changing plans mid-cycle created inconsistent billing amounts and dates.

Solution

Built a subscription state machine that calculates prorated charges for pause/resume/upgrade transitions explicitly.

Result

Subscription retention held at 78% with consistent, predictable billing.

Failed Recurring Payments Causing Churn

Problem

A single failed recurring charge would silently cancel a subscription, losing customers who simply had a temporary card issue.

Solution

Implemented dunning management with a scheduled retry sequence and proactive customer notifications before cancellation.

Result

Recovered roughly 25% of failed payment attempts that would otherwise have churned.

Review Authenticity

Problem

Open review submission was attracting spam and unverified reviews that undermined customer trust.

Solution

Restricted review submission to accounts with a confirmed purchase record tied to the specific product.

Result

Review spam eliminated and customer trust in ratings improved.

Core Features

Recurring Subscription Billing

State-machine-driven subscriptions supporting pause, resume, and prorated plan changes.

Clean Code

SubscriptionBillingService — Resilient Recurring Charges
1<?php
2
3namespace App\Services;
4
5use App\Models\Subscription;
6use App\Contracts\PaymentGateway;
7use Illuminate\Support\Facades\DB;
8
9class SubscriptionBillingService
10{
11 public function __construct(private PaymentGateway $gateway) {}
12
13 public function processRenewal(Subscription $subscription): void
14 {
15 DB::transaction(function () use ($subscription) {
16 $charge = $this->gateway->charge(
17 $subscription->customer,
18 $subscription->plan->price
19 );
20
21 if (! $charge->successful()) {
22 $subscription->increment('failed_attempts');
23 $subscription->update(['status' => 'past_due']);
24 return;
25 }
26
27 $subscription->update([
28 'failed_attempts' => 0,
29 'status' => 'active',
30 'next_billing_at' => now()->addDays($subscription->plan->interval_days),
31 ]);
32 });
33 }
34}