.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.- Disabled — Simple Payment Form
- Enabled — Forced Billing Address Form
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:- Initial Trial Period:
- Configurable duration (in days, e.g., 7, 14, 30 days).
- Configurable upfront trial price (e.g.,
$0.00for 100% Free Trials, or a nominal fee like$1.00for 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.
- 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
Theproduct_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:- Navigate to Admin → Products → Edit Product.
- Select or create a Product Variant.
- 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.00for free trial, or1.00for a $1 trial). - Display Label: Optional custom label (e.g.,
Free TrialorSpecial $1 Trial).
- Days: Number of trial days (e.g.,
- 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).
- Days:
-
Introductory Paid Trial:
- Days:
7 - Trial Price:
1.00 - Display Label:
$1 Trial - Customer sees:
$1 Trial(charged$1.00today; bills full subscription price after 7 days).
- 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).
- Days:
4. Customer-Facing Display Behavior
Whenstripe_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 withstripe_trial_enabledandstripe_trial_days > 0.getTrialPrice(): Returns(float) $this->stripe_trial_price.hasTrialLabel(): Returnstrueif a non-emptystripe_trial_labelexists.getTrialLabel(): Returns the string label ornull.getSubscriptionRecurringPrice($user): Returns the post-trial recurring price (wholesale, sale, or public price).
- [
app/Services/DiscountService.php]:- In
applyDiscountsToCart()andgetDiscountedPriceForVariant(): Resolves current trial price for the active cart.
- In
- [
app/Livewire/OrderReview.php]:preparePayment(): Forwards$subRecurringPrice,$trialPrice,$trialDays, and$trialLabelto the payment driver.
- [
app/Services/Payments/Processors/StripeProcessor.php]:createSubscription(): Attaches the payment method, creates an upfrontInvoiceItemiftrial_price > 0, and creates the subscription withtrial_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 toconfig/payment_processors.php are needed.
File location:
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.
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 tousers.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)
