Skip to main content

Stripe

Stripe is RoundTrip's payment and subscription management platform. It handles subscription billing, payment collection, and webhook events that drive tenant lifecycle management (activation, suspension, cancellation).


What Stripe Handles

ResponsibilityDetails
Subscription billingMonthly/annual subscription charges per plan tier
Payment collectionCredit card processing, payment method management
Webhook eventsNotifies RoundTrip of subscription changes, payment success/failure
Customer portalSelf-service subscription management for tenants

Subscription Plans

RoundTrip has three subscription tiers. Each tier has a corresponding Stripe Price ID stored in Key Vault.

PlanKey Vault SecretConfig Key
StarterStripe--PriceId--StarterStripe:PriceId:Starter
StandardStripe--PriceId--StandardStripe:PriceId:Standard
ProfessionalStripe--PriceId--ProfessionalStripe:PriceId:Professional

:::info Founding Customer Pricing Early customers are offered a locked-in lower rate as founding customer pricing. This is configured at the Stripe subscription level using a discounted price or coupon — the Price IDs in Key Vault reflect the standard rates. Founding customer discounts are applied manually in the Stripe dashboard per customer. :::


Configuration

Key Vault Secrets

Secret NameConfig KeyPurpose
Stripe--SecretKeyStripe:SecretKeyServer-side API key for all Stripe API calls
Stripe--PublishableKeyStripe:PublishableKeyClient-side key exposed to the frontend
Stripe--WebhookSigningSecretStripe:WebhookSigningSecretValidates incoming webhook event signatures
Stripe--PriceId--StarterStripe:PriceId:StarterStripe Price ID for Starter plan
Stripe--PriceId--StandardStripe:PriceId:StandardStripe Price ID for Standard plan
Stripe--PriceId--ProfessionalStripe:PriceId:ProfessionalStripe Price ID for Professional plan

App Service Settings

Setting NameValue
Stripe__SecretKey@Microsoft.KeyVault(VaultName=kv-roundtrip-production;SecretName=Stripe--SecretKey)
Stripe__PublishableKey@Microsoft.KeyVault(VaultName=kv-roundtrip-production;SecretName=Stripe--PublishableKey)
Stripe__WebhookSigningSecret@Microsoft.KeyVault(VaultName=kv-roundtrip-production;SecretName=Stripe--WebhookSigningSecret)
Stripe__PriceId__Starter@Microsoft.KeyVault(VaultName=kv-roundtrip-production;SecretName=Stripe--PriceId--Starter)
Stripe__PriceId__Standard@Microsoft.KeyVault(VaultName=kv-roundtrip-production;SecretName=Stripe--PriceId--Standard)
Stripe__PriceId__Professional@Microsoft.KeyVault(VaultName=kv-roundtrip-production;SecretName=Stripe--PriceId--Professional)

Webhook Events

Stripe sends webhook events to RoundTrip when subscription or payment state changes. The webhook endpoint validates the event signature using the WebhookSigningSecret before processing.

Webhook Endpoint

POST /v1/billing/webhook

Key Events

Stripe EventWhat It MeansRoundTrip Action
customer.subscription.createdNew subscription activatedActivate tenant — allow full access
customer.subscription.updatedPlan changed or subscription modifiedUpdate tenant subscription tier
customer.subscription.deletedSubscription cancelledMark tenant as cancelled
invoice.payment_succeededPayment collected successfullyReinstate tenant if previously suspended
invoice.payment_failedPayment collection failedSuspend tenant after grace period
invoice.payment_action_required3D Secure or additional auth neededNotify tenant admin via email

:::warning Webhook Automation Not Yet Complete Automatic tenant suspension and reinstatement on payment failure/success is a known planned feature. Currently, subscription lifecycle management is handled manually in the Stripe dashboard and RoundTrip admin panel. See Planned Enhancements below. :::


Stripe Dashboard

ItemDetail
LoginBitwarden → "Stripe"
CustomersLists all RoundTrip tenants as Stripe customers
SubscriptionsActive, past due, cancelled subscriptions per tenant
PaymentsPayment history, refunds, disputes
WebhooksDevelopers → Webhooks — shows event delivery history and failures
API KeysDevelopers → API Keys — production and test keys

Verifying Webhook Delivery

If you suspect webhooks are not being processed:

  1. Go to Stripe Dashboard → Developers → Webhooks
  2. Find your webhook endpoint (/v1/billing/webhook)
  3. Click on it to see recent event delivery attempts
  4. Check the response code — 200 means RoundTrip received and processed it
  5. Non-200 responses indicate the endpoint rejected or failed to process the event
  6. Failed events can be resent manually from the Stripe dashboard

Test vs Production

Stripe has separate test and production modes. Test mode uses sk_test_ prefixed keys and does not process real payments.

ModeKey PrefixUse For
Testsk_test_ / pk_test_Local development and dev environment
Productionsk_live_ / pk_live_Production only — real payments

:::danger Never Use Production Keys in Development Production Stripe keys process real payments and can create real customer charges. Dev environment must always use test mode keys. Test keys are stored separately in kv-roundtrip-dev. :::

Test Card Numbers

Card NumberBehaviour
4242 4242 4242 4242Always succeeds
4000 0000 0000 0002Always declines
4000 0025 0000 3155Requires 3D Secure authentication

Planned Enhancements

EnhancementPriorityNotes
Automatic tenant suspension on payment failureHighWebhook handler for invoice.payment_failed → suspend tenant after grace period
Automatic tenant reinstatement on payment successHighWebhook handler for invoice.payment_succeeded → reinstate suspended tenant
Stripe Customer Portal integrationMediumSelf-service plan upgrades, payment method updates for tenant admins
Data retention job for cancelled tenantsMediumPurge cancelled tenant data after 30/90 days via Hangfire recurring job
Usage-based billingLowFuture — metered billing based on technician seat count