HxConnect's payment integration brings Stripe's full payment infrastructure into Velaris case workflows as first-class step types. Collect payments, issue disbursements, process refunds, and maintain a complete HMAC-verified webhook audit trail — all anchored to case records.
STRIPE_WEBHOOK_SECRET before processing. Raw payload, verification status, and processing outcome are stored in payment_webhook_events for compliance and debugging.The Stripe integration exposes two step types. Add either to any stage in your case type via the Case Type Editor.
| Step Type | Work Center Panel | Panel Contents | Auto-Advance Trigger | DB Table |
|---|---|---|---|---|
payment_request |
PaymentRequestPanel | Amount field, currency selector, Generate Link button, copy-to-clipboard, payment status badge | Stripe webhook fires checkout.session.completed |
payment_requests |
payment_disbursement |
PaymentDisbursementPanel | Amount field, currency selector, bank reference field, Confirm Disbursement button (confirmation dialog) | Agent confirms disbursement (synchronous — no webhook) | payment_disbursements |
Follow these steps to connect Stripe to Velaris. Completing all steps is required for webhooks to work — skipping step 3 means payments will collect but cases will not auto-advance.
Get your Stripe API key. Log in to the Stripe Dashboard > Developers > API Keys. Copy the Secret key — it begins with sk_live_ in production or sk_test_ in test mode. Never use the publishable key (pk_) for server-side calls.
Create the Stripe webhook endpoint. In the Stripe Dashboard, go to Developers > Webhooks > Add endpoint. Set the endpoint URL to:
https://your-domain.com/api/payments/webhooks/stripe
Under Events to listen to, select checkout.session.completed. After saving, click the endpoint and copy the Signing secret — it begins with whsec_.
Set environment variables. Add the following to your deployment environment and restart the case-service:
STRIPE_SECRET_KEY=sk_live_your_key_here STRIPE_WEBHOOK_SECRET=whsec_your_signing_secret_here
Add the connector in Studio. Navigate to Studio > HxConnect > Payments and click Add Connector. Set the fields as follows:
StripeProduction){{env.STRIPE_SECRET_KEY}}{{env.STRIPE_WEBHOOK_SECRET}}GBP, USD, or EURSave. Velaris pings https://api.stripe.com/v1/balance to verify the key — a green tick confirms connectivity.
Add a step to your case type. Open the Case Type Editor for the target case type. Select the stage where payment collection should occur. Add a step, set Step Type to payment_request, select the connector you just created, and configure the default amount field mapping (e.g., map to case.data.claim_amount). Publish the case type.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/payments/cases/{id}/charge |
Creates a Stripe Checkout session for the case. Returns checkout_url, session_id, amount, currency. |
JWT |
POST |
/api/payments/requests/{id}/refund |
Issues a full or partial refund against a captured payment request. Body: {"amount": 5000} (in pence/cents; omit for full refund). |
JWT (Admin/Manager) |
POST |
/api/payments/webhooks/stripe |
Inbound Stripe webhook receiver. Verifies HMAC-SHA256 signature. Processes checkout.session.completed and advances the case. |
HMAC (no JWT) |
GET |
/api/payments/connectors |
Lists all configured StripeConnector instances with health status. Secret fields are redacted. | JWT (Admin) |
GET |
/api/payments/webhooks |
Returns the webhook event log from payment_webhook_events. Supports ?case_id= and ?status= filters. |
JWT (Admin/Manager) |
Use this request to generate a Stripe Checkout link for case c_01HZ... programmatically. The response checkout_url is the link the customer visits to pay.
curl -s -X POST https://your-domain.com/api/payments/cases/c_01HZ.../charge \ -H "Authorization: Bearer $VELARIS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "amount": 15000, "currency": "GBP", "description": "Application processing fee — Case #REF-2024-0087" }'
Example response:
{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_...",
"session_id": "cs_live_a1b2c3...",
"amount": 15000,
"currency": "GBP",
"payment_request_id": "pr_01HZ...",
"status": "pending"
}
STRIPE_SECRET_KEY=sk_test_... and use a test webhook secret. In the PaymentRequestPanel, generated links point to Stripe's test Checkout page. Use Stripe's test card 4242 4242 4242 4242 (any future expiry, any CVC) to simulate a successful payment. The webhook fires exactly as in production and the case auto-advances. Test events are labelled [TEST] in the payment_webhook_events table.
{{env.VAR}} reference, not the resolved value.
/api/payments/webhooks/stripe endpoint rejects any request that fails HMAC-SHA256 verification. Never disable signature verification even in development. Use Stripe's CLI (stripe listen --forward-to localhost:8200/api/payments/webhooks/stripe) to replay signed test events locally.