Skip to content

Complete Stripe Dashboard and WordPress setup for hosted checkout and webhooks.

Stripe Checkout Setup

Complete guide to accepting subscription payments with Stripe Web Checkout (Phase 2A).

Prerequisites

  • WPST_SUBSCRIPTIONS_ENABLED set to true in wp-config.php
  • Enable REST/API access under Subscriptions → General
  • HTTPS recommended for production
  • Stripe account with Products and recurring Prices for each tier

Stripe Dashboard setup

1. API keys

In Stripe Dashboard → Developers → API keys:

  • Copy test publishable and secret keys into MediaBlaster → Subscriptions → Payment Providers
  • When ready for production, repeat with live keys and switch Mode to Live

2. Webhook endpoint

Add a webhook in Stripe Dashboard pointing to:

https://YOUR-SITE/wp-json/mediablaster/v3/payments/stripe/webhook

Subscribe to these events (test and live each need their own endpoint or secret):

  • checkout.session.completed
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_succeeded
  • invoice.payment_failed

Copy the signing secret into the matching test/live webhook secret field in MediaBlaster.

3. Products and Prices

Create a Stripe Product and recurring Price for each MediaBlaster tier. Copy each Price ID (price_...) into Subscription Tiers for the correct test or live mode.

Trial days configured on a tier are sent to Stripe as trial_period_days on checkout.

WordPress configuration

SettingExample
Checkout success URLhttps://yoursite.com/subscribe-success/?session_id={CHECKOUT_SESSION_ID}
Checkout cancel URLhttps://yoursite.com/subscribe/
Portal return URLhttps://yoursite.com/account/

Create WordPress pages:

[wpst_subscribe]
[wpst_account]

See Shortcodes for single-tier checkout with [wpst_stripe_checkout].

Checkout flow

  1. Logged-in user clicks Subscribe on your subscribe page
  2. Browser requests a checkout session from MediaBlaster REST API
  3. User completes payment on Stripe hosted checkout
  4. Stripe redirects to your success URL
  5. Webhooks update the internal subscription — premium access applies

Testing checklist

Use Stripe test card 4242 4242 4242 4242 with any future expiry and CVC.

  • Test keys saved; webhook secret configured
  • Tier has test Price ID mapped
  • Logged-out user sees login prompt on subscribe page
  • Logged-in user reaches Stripe Checkout
  • Success and cancel redirects work
  • Sub Logs show checkout.session.completed
  • Subscriber can play premium [tv-video-player] content
  • Manage Billing opens Stripe Customer Portal on account page

Troubleshooting

SymptomCheck
No Subscribe buttonUser logged in? Stripe enabled? Tier has Price ID for current mode?
Checkout REST errorSubscriptions and REST API enabled? User authenticated?
Webhook signature failureWebhook secret matches current test/live mode
Subscription not createdSub Logs for unmapped or error; Price ID matches Stripe subscription
Manage Billing missingUser needs Stripe customer ID from completed checkout

Security

  • Webhooks verify Stripe HMAC signatures only — no WordPress login
  • Secret keys never appear in public REST or page HTML
  • Redirect URLs must be same-site unless filtered for your domain

Headless apps

GET /wp-json/mediablaster/v3/app/config returns public Stripe config (publishable key, endpoints) without secrets. Authenticated apps use POST /wp-json/mediablaster/v3/payments/stripe/create-checkout-session with Bearer token.

For REST auth details see API/Auth settings.

Was this helpful?