Security & Digital Services

UseSSL

A digital services platform integrating SSL certificate provisioning, external vendor APIs, customer accounts, idempotent payment webhooks (Stripe & Khalti), and automated billing.

UseSSL project
01 — Overview

Project details

UseSSL is a specialized digital services platform engineered to simplify SSL/TLS certificate procurement, domain validation workflows, certificate issuance, and automated billing. The platform connects customer purchasing workflows with upstream Certificate Authority (CA) vendor APIs.

As a Full-Stack Engineer on this project, I worked on the external API integration layer, order state machines, payment gateway webhooks, automated invoice generation, and customer dashboards. My primary engineering focus was coordinating multi-step certificate lifecycles while keeping payment verification decoupled from third-party vendor fulfillment.

Year2025–2026
RoleFull-Stack Engineer
TypeSecurity & Digital Services
02 — The problem

The challenge

Purchasing an SSL certificate is fundamentally different from buying a standard digital download. After payment is collected, the service cannot immediately dispense the certificate. The customer must submit a Certificate Signing Request (CSR), select a domain validation method (DNS TXT record, HTTP file challenge, or email validation), and await verification from upstream Certificate Authorities before the certificate is signed and issued.

This multi-step workflow introduced distributed state challenges. Payment webhooks from Stripe and Khalti arrive asynchronously and may retry multiple times over unstable network links. If a payment webhook delivers twice, the system must never create duplicate certificate orders or emit duplicate invoices. Furthermore, if an upstream vendor API experiences temporary latency or downtime, the platform must preserve order state without leaving customers in the dark.

03 — The approach

How I approached it

I decoupled payment state from certificate fulfillment state. When a payment webhook is verified, the order is marked as PAID, but the technical provisioning process is governed by an independent lifecycle state machine (PENDING_CSR, VALIDATION_IN_PROGRESS, ISSUED, EXPIRED, CANCELLED).

To handle payment reliability, I implemented idempotent webhook handlers that verify gateway signatures, record external transaction IDs, and execute state transitions inside atomic database transactions. I also integrated Resend for automated transactional invoice delivery and validation alert dispatch.

UseSSL system preview and architecture overview
04 — Engineering

Engineering breakdown

The important parts of the project were not just the interface, but the systems and decisions behind it.

01

Upstream certificate vendor API integration and CSR processing

The platform translates customer certificate configurations—domain names, Subject Alternative Names (SANs), validity terms, and validation methods—into structured API payloads required by external certificate providers.

I implemented server-side CSR parsing and pre-submission validation. By verifying key lengths, domain common names, and cryptographic formats before dispatching payloads upstream, we catch formatting errors immediately in the user interface rather than waiting for asynchronous upstream rejection.

The system tracks validation challenges, providing customers with exact DNS TXT records or HTTP verification files to deploy, along with polling mechanisms to check validation status against vendor endpoints.

02

Idempotent payment webhook processing for Stripe and Khalti

To accommodate both international and domestic customers, the application supports dual payment gateways: Stripe for international credit cards and Khalti for digital wallet transactions in Nepal.

Payment providers guarantee at-least-once delivery, meaning webhooks are frequently resent when network acknowledgments are delayed. A naive handler that simply processes every incoming event will inevitably trigger duplicate business mutations.

I engineered webhook handlers that verify provider signatures and query for existing transaction records within database transactions. If an event has already been processed, the system returns an immediate HTTP 200 acknowledgment without re-running order fulfillment or duplicating invoices.

03

Automated billing, sequential invoice generation, and Resend email delivery

Financial compliance requires reliable, auditable invoice records for every paid transaction. I built an automated billing pipeline that generates sequential invoice numbers and itemized breakdown snapshots upon verified payment.

The system connects with Resend to dispatch transactional emails: purchase receipts, domain validation instructions, issuance notifications, and certificate download links with private key handling warnings.

Email delivery events are logged to ensure customer support visibility when transactional notifications are delayed or blocked by customer mail filters.

04

Customer self-service portal and administrative operations tooling

Customers need clear visibility into where their certificate order stands in the issuance pipeline. I developed a self-service dashboard displaying certificate expiration countdowns, DNS validation verification states, and one-click certificate/bundle downloads.

For the operations team, I built administrative tooling to inspect stuck vendor orders, review payment gateway logs, manually re-trigger domain validation checks, and assist customers who encounter DNS verification hurdles.

05

Key engineering work

  • Upstream certificate authority vendor API integration coordinating multi-step issuance
  • Idempotent payment webhook architecture supporting Stripe and Khalti gateways
  • Decoupled state machines separating financial payment from technical service fulfillment
  • Server-side CSR validation catching cryptographic formatting errors before upstream submission
  • Automated sequential invoice generation and transactional email pipelines via Resend
  • Customer portal displaying real-time domain validation challenges and certificate downloads
  • Administrative tooling for vendor order monitoring, payment reconciliation, and validation debugging
06

Key decisions

  • Decoupled payment state from certificate fulfillment state so vendor delays never block payment confirmation.
  • Enforced idempotency using database transaction-id constraints to safely handle duplicate webhook retries.
  • Pre-validated CSR formatting and common names on the server before transmitting requests upstream.
  • Automated invoice creation and transactional email dispatch upon verified payment state transitions.
07

Results

  • Connected customer purchasing with upstream SSL certificate authority APIs in a cohesive digital workflow.
  • Eliminated manual payment verification through reliable, idempotent webhook handlers for Stripe and Khalti.
  • Provided customers with transparent self-service guidance throughout the technical domain validation process.
08

What I learned

  • In integration-heavy systems, payment completion and technical service fulfillment are two distinct lifecycles that must never be conflated.
  • Webhook endpoints must always be designed on the assumption that external providers will resend events.
  • Providing clear, self-service domain validation instructions directly in the user interface drastically reduces technical support tickets.
09 — Stack

Technologies

Next.js App RouterTypeScriptReactPrisma ORMMySQLStripe APIKhalti APIResendDockerREST APIs
Next project

Have a problem
worth solving?

Whether you're building something new or improving an existing system, let's talk about the problem and what it would take to build it well.

Start a conversation