Skip to main content
Stripe is a built-in payment processor in Site Store Pro (processor ID 1) supporting one-time payments and recurring subscriptions via Stripe Elements. Setup requires installing the Stripe PHP SDK, adding your API keys to .env, and registering a webhook endpoint in the Stripe Dashboard.

Setup

Step 1 — Install the SDK

Step 2 — Add Credentials to .env

The webhook secret is required for both sandbox and production environments. See Webhook Registration below.

Step 3 — Activate in Admin

Navigate to Admin → Checkout → Processors, set Stripe as the Primary processor, and toggle Production ON or OFF depending on your environment.

Stripe-Specific Options

The Stripe Address Requirement Toggle is found in the Processors list under the Stripe Specific Settings card. It controls which Stripe Elements are rendered at checkout.
Renders a PaymentElement with billing address collection set to never.
  • Shows only payment method fields (card number, expiry, CVC)
  • Fastest checkout experience
  • Use when you collect billing details separately or don’t need them

Stripe Subscription Trial Periods & Custom Pricing Guide


1. Overview & Architecture

SiteStorePro supports a flexible dual-tier pricing model for recurring subscription products powered by Stripe:
  1. Initial Trial Period:
    • Configurable duration (in days, e.g., 7, 14, 30 days).
    • Configurable upfront trial price (e.g., $0.00 for 100% Free Trials, or a nominal fee like $1.00 for introductory paid trials).
    • Optional Display Label (e.g., Free Trial, 7-Day Free Trial, or $1 Intro Offer) that replaces the numeric price display throughout the customer storefront.
  2. Post-Trial Recurring Subscription:
    • Automatically begins when the trial period concludes on Stripe.
    • Billed at the variant’s regular Public Price (or wholesale/discounted price as applicable) on the chosen billing interval (monthly, yearly, or weekly).

2. Database Schema

The product_variants table contains the following columns for Stripe trial management:

3. Admin Configuration Guide

To enable and configure a Stripe trial for a product variant:
  1. Navigate to Admin → Products → Edit Product.
  2. Select or create a Product Variant.
  3. Under the Payment Processor IDs → Stripe panel:
    • Ensure the variant is configured as a subscription (e.g., by selecting a Billing Interval such as Monthly or specifying a Stripe Price ID).
    • Toggle Trial Period & Pricing to On.
    • Set the following fields:
      • Days: Number of trial days (e.g., 14).
      • Trial Price: Amount charged today (e.g., 0.00 for free trial, or 1.00 for a $1 trial).
      • Display Label: Optional custom label (e.g., Free Trial or Special $1 Trial).
  4. Click Update Variant or Save Product.

Configuration Examples

  • Standard Free Trial:
    • Days: 14
    • Trial Price: 0.00
    • Display Label: Free Trial
    • Customer sees: Free Trial (with notes indicating 14 days, followed by $29.99/month).
  • Introductory Paid Trial:
    • Days: 7
    • Trial Price: 1.00
    • Display Label: $1 Trial
    • Customer sees: $1 Trial (charged $1.00 today; bills full subscription price after 7 days).
  • Numeric-Only Display (No Custom Label):
    • Days: 30
    • Trial Price: 0.00
    • Display Label: (leave blank)
    • Customer sees: $0.00 (with notes indicating 30 Day Trial, then recurring price).

4. Customer-Facing Display Behavior

When stripe_trial_enabled is active on a variant:

5. Checkout & Stripe Payment Processing Workflow


6. Key Code Reference

  • [app/Models/ProductVariant.php]:
    • hasStripeTrial(): Checks if the variant is a subscription with stripe_trial_enabled and stripe_trial_days > 0.
    • getTrialPrice(): Returns (float) $this->stripe_trial_price.
    • hasTrialLabel(): Returns true if a non-empty stripe_trial_label exists.
    • getTrialLabel(): Returns the string label or null.
    • getSubscriptionRecurringPrice($user): Returns the post-trial recurring price (wholesale, sale, or public price).
  • [app/Services/DiscountService.php]:
    • In applyDiscountsToCart() and getDiscountedPriceForVariant(): Resolves current trial price for the active cart.
  • [app/Livewire/OrderReview.php]:
    • preparePayment(): Forwards $subRecurringPrice, $trialPrice, $trialDays, and $trialLabel to the payment driver.
  • [app/Services/Payments/Processors/StripeProcessor.php]:
    • createSubscription(): Attaches the payment method, creates an upfront InvoiceItem if trial_price > 0, and creates the subscription with trial_period_days.

Stripe Payments Plugin Extension Override

To customize Stripe behavior without editing the built-in class, create an extension file. The platform auto-detects it — no changes to config/payment_processors.php are needed. File location:
The payment-processors/ directory sits outside app/ by design. Its contents are never overwritten by platform updates.

Webhook Registration

1

Register the endpoint in Stripe Dashboard

Go to Stripe Dashboard → Developers → Webhooks → Add endpoint and enter:
2

Set the webhook secret in .env

3

Verify events are received

Use the Stripe Dashboard’s “Send test webhook” feature to confirm your endpoint is reachable and the signature is verified correctly.
Signature verification uses Stripe\Webhook::constructEvent() with the Stripe-Signature header. All webhook routes are CSRF-exempt via the webhooks/* wildcard in bootstrap/app.php.

Handled Events

Subscription lifecycle events (customer.subscription.*, invoice.*) are currently logged. To act on these events — for example, granting or revoking subscription access — use the Extension Override pattern to add your business logic.

Stripe Customer ID Persistence

When a Stripe Subscription is created, the Stripe Customer ID is saved to users.stripe_customer_id. This ID is reused for:
  • Future subscription renewals (avoids duplicate customer records)
  • Webhook linkage (maps incoming events back to a Site Store Pro user)