Internal / Proworkbench Stripe Migration Map
ProWorkbench Stripe Migration Map
Goal
Reuse the live pbdownloads Stripe storefront on proworkbench.com so the main domain owns the ProWorkbench desktop purchase flow while the legacy pbdownloads host continues working in parallel during rollout.
Rollout Choice
- Selected approach: Option A, keep
pbdownloads.proworkbench.comworking in parallel. - Main domain now mounts the same storefront routes and logic before the legacy
proworkbench.comapp boots. - Legacy Square checkout code remains present for non-migrated flows and historical verification routes, but the exposed ProWorkbench desktop CTAs are moved to Stripe.
Source Of Truth
Reused storefront routes and handlers from pbdownloads
- Source router: /var/www/pbdownloads/app/router.php
- Source Stripe client: /var/www/pbdownloads/app/stripe.php
- Source repository/order logic: /var/www/pbdownloads/app/repository.php
- Source helpers/config/bootstrap: /var/www/pbdownloads/app/helpers.php, /var/www/pbdownloads/app/config.php, /var/www/pbdownloads/app/bootstrap.php
Main-domain mount point
- Target router entry: /var/www/proworkbench.com/public/index.php
- Mounted routes on
proworkbench.com:
- /download
- /windows
- /linux
- /macos
- /checkout/windows
- /checkout/linux
- /checkout/macos
- /success
- /cancel
- /access
- POST /webhooks/stripe
- Added aliases on main domain:
- /platforms -> /download
- /get -> /download
View / Asset Reuse
Reused storefront views
- Platform selection: /var/www/pbdownloads/views/home.php
- Platform detail pages: /var/www/pbdownloads/views/platform.php
- Pre-checkout/cart pages: /var/www/pbdownloads/views/checkout.php
- Success page: /var/www/pbdownloads/views/success.php
- Cancel page: /var/www/pbdownloads/views/cancel.php
- Shared storefront layout: /var/www/pbdownloads/views/layout.php
Copied assets for main-domain rendering
- Source CSS: /var/www/pbdownloads/assets/app.css
- Source JS: /var/www/pbdownloads/assets/app.js
- Target CSS copy: /var/www/proworkbench.com/public/assets/pbdownloads-app.css
- Target JS copy: /var/www/proworkbench.com/public/assets/pbdownloads-app.js
Host-safe storefront adjustments
- Storefront asset helper added in /var/www/pbdownloads/app/helpers.php
- Platform-selection back links normalized to
/downloadfor both hosts in:
- /var/www/pbdownloads/views/platform.php
- /var/www/pbdownloads/views/checkout.php
- /var/www/pbdownloads/views/success.php
- /var/www/pbdownloads/views/cancel.php
Stripe / Order / Entitlement Flow Preserved
Stripe session creation
- Checkout session creation remains in /var/www/pbdownloads/app/stripe.php
- Success/cancel URLs continue to derive from request host via /var/www/pbdownloads/app/config.php
Order creation and fulfillment
- Order creation: /var/www/pbdownloads/app/repository.php
- create_order()
- update_order_after_checkout_session()
- Paid fulfillment and entitlement creation: /var/www/pbdownloads/app/repository.php
- mark_order_paid_and_entitle()
- find_basic_entitlement_by_order_id()
- find_entitlement_by_token()
- Download delivery: /var/www/pbdownloads/app/router.php
- serve_download()
- Stripe webhook processing: /var/www/pbdownloads/app/router.php
- handle_stripe_webhook()
Product/platform mapping
- Platform product lookup remains in:
- /var/www/pbdownloads/app/helpers.php
- /var/www/pbdownloads/app/repository.php
- Mapping still resolves through
pbdownloads_catalog_products,pbdownloads_stripe_mappings, andpbdownloads_builds. - This preserves Windows/Linux/macOS-specific unlock behavior without introducing a second mapping layer in
proworkbench.com.
Main-Site CTA Rewire
- Main desktop CTA updates:
- /var/www/proworkbench.com/views/desktop.php
- ProWorkbench platform product pages now route to Stripe checkout instead of Square when the cached product is a ProWorkbench desktop platform item:
- /var/www/proworkbench.com/views/product.php
- Main navbar already used
/downloadin:
- /var/www/proworkbench.com/views/layout.php
Legacy Square Status
Hidden/de-emphasized for the migrated desktop flow
- Legacy ProWorkbench desktop CTAs changed away from Square:
- /var/www/proworkbench.com/views/desktop.php
- /var/www/proworkbench.com/views/product.php
Still present for safety / non-migrated paths
- Square billing API: /var/www/proworkbench.com/public/api/index.php
- Square verification + entitlements: /var/www/proworkbench.com/app/billing.php
- Legacy Square success flow: /var/www/proworkbench.com/public/index.php
- /checkout/success
- /thank-you
- Square admin/catalog tooling remains intact and untouched for now.
Analytics Dependencies Preserved
- Shared analytics runtime used by both apps: /var/www/proworkbench.com/app/analytics_port.php
pbdownloadsstorefront already emits:
- platform_selection_view
- platform_selected
- checkout_page_view
- checkout_started
- checkout_completed
- purchase_paid
- download_delivered
- Main-domain analytics reporting updated to treat both:
- pbdownloads.proworkbench.com
- proworkbench.com funnel routes
as part of the same commercial download funnel.
- Updated reporting files:
- /var/www/proworkbench.com/app/analytics_port.php
- /var/www/proworkbench.com/app/admin_workspace.php
- /var/www/proworkbench.com/views/admin_workspace_analytics.php
- /var/www/proworkbench.com/views/admin_workspace_insights.php
Dependencies That Must Be Preserved
- Shared database access used by
pbdownloadsandproworkbench.com pbdownloads_*tables for catalog, mappings, orders, entitlements, and webhooksanalytics_*tables andanalytics_port.php- Existing Stripe payment settings in
pbdownloads_payment_settings - Existing active build assignments in
pbdownloads_builds - Existing Stripe price mappings per platform
- Existing webhook endpoint support on both hosts during transition
Summary
- Reused directly:
- storefront routes
- checkout/session logic
- success/cancel flow
- order + entitlement fulfillment
- analytics event emission
- Copied:
- storefront CSS/JS assets for main-domain static delivery
- Deferred cleanup:
- full Square code removal
- Square admin retirement
- any pbdownloads-to-main-domain redirect cutover