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.com working in parallel.
  • Main domain now mounts the same storefront routes and logic before the legacy proworkbench.com app 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

Main-domain mount point

- /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

Copied assets for main-domain rendering

Host-safe storefront adjustments

- /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

Order creation and fulfillment

- create_order()

- update_order_after_checkout_session()

- mark_order_paid_and_entitle()

- find_basic_entitlement_by_order_id()

- find_entitlement_by_token()

- serve_download()

- 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, and pbdownloads_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 /download in:

- /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

- /checkout/success

- /thank-you

  • Square admin/catalog tooling remains intact and untouched for now.

Analytics Dependencies Preserved

- 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 pbdownloads and proworkbench.com
  • pbdownloads_* tables for catalog, mappings, orders, entitlements, and webhooks
  • analytics_* tables and analytics_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