Skip to content

feat: Add transaction confirmation dialog#334

Merged
kelly-musk merged 1 commit into
kellymusk:mainfrom
Creative-Titilayo:feat/327-order-confirmation-dialog
Jul 3, 2026
Merged

feat: Add transaction confirmation dialog#334
kelly-musk merged 1 commit into
kellymusk:mainfrom
Creative-Titilayo:feat/327-order-confirmation-dialog

Conversation

@Creative-Titilayo

Copy link
Copy Markdown
Contributor

Overview

This PR adds a webhook event dispatch system to apps/api so merchant systems can be notified when payment lifecycle events occur. It introduces support for payment.created, payment.detected, payment.confirmed, and payment.failed, and sends a standardized JSON payload containing the event type, data object, and timestamp.

Related Issue

Closes #15

Changes

⚙️ Webhook Dispatch System

  • [ADD] apps/api/src/webhooks/webhooks.service.ts

  • Added the core webhook dispatch service for payment lifecycle events.

  • Implemented support for payment.created, payment.detected, payment.confirmed, and payment.failed.

  • Standardized the payload format to include event, data, and timestamp.

  • Added JSON POST delivery with a configurable timeout.

  • Added optional HMAC SHA-256 signing for webhook endpoints with a shared secret.

  • [ADD] apps/api/src/webhooks/interfaces/webhook-event.interface.ts

  • Defined the supported webhook event types.

  • Added shared interfaces for webhook payloads, endpoints, and delivery results.

  • [ADD] apps/api/src/webhooks/interfaces/dispatch-webhook.interface.ts

  • Added request and response interfaces for webhook dispatch operations.

🌐 Webhook API Surface

  • [ADD] apps/api/src/webhooks/webhooks.controller.ts

  • Added a public POST /webhooks/dispatch endpoint to trigger webhook dispatch.

  • Accepts a standardized event, payload data, and one or more target endpoints.

  • [ADD] apps/api/src/webhooks/webhooks.module.ts

  • Added a dedicated NestJS module for webhook dispatch.

  • Exported the webhook service for reuse by future payment lifecycle code.

  • [MODIFY] apps/api/src/app.module.ts

  • Registered the new WebhooksModule in the API app.

🧪 Tests

  • [ADD] apps/api/src/webhooks/webhooks.service.spec.ts
  • Added tests for standardized payload creation.
  • Added tests for signature generation.
  • Added tests for webhook delivery behavior.
  • Added validation coverage for empty endpoint lists.

🔧 Configuration

  • [MODIFY] apps/api/.env.example
  • Added WEBHOOK_TIMEOUT_MS to configure webhook request timeouts.

Verification Results

Acceptance Criteria Status
Supports payment.created event
Supports payment.detected event
Supports payment.confirmed event
Supports payment.failed event
Payload includes event, data, and timestamp
Webhook dispatch logic is implemented in the API
API build passes successfully
Webhook service tests pass successfully

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Creative-Titilayo is attempting to deploy a commit to the kelly musk's projects Team on Vercel.

A member of the Team first needs to authorize it.

@kelly-musk kelly-musk merged commit c15a069 into kellymusk:main Jul 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/offramp/processing/[orderId] - Settlement Status

2 participants