Skip to content

feat: implement 3DS authentication flow for card payments - #1310

Merged
github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
WallexCoder:feature/3ds-authentication-flow
Oct 19, 2026
Merged

github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
WallexCoder:feature/3ds-authentication-flow

Conversation

@WallexCoder

Copy link
Copy Markdown
Contributor

Summary

Implements the 3D Secure (3DS) card-payment authentication flow requested in issue #925.

What's added

File Purpose
backend/src/services/3ds.ts Core service: session lifecycle (initiate, verify, cancel, purge), in-memory store, BIN-based enrolment heuristic, HMAC auth-value generation
backend/src/schemas/3ds.ts Zod schemas + TypeScript types for all four endpoints
backend/src/routes/3ds.ts Express router wiring validation → service
backend/src/index.ts Mounts the new router under /api/v1/3ds
backend/src/services/__tests__/3ds.test.ts 24 service unit tests
backend/src/routes/__tests__/3ds.test.ts 21 schema + integration tests

Endpoints

POST  /api/v1/3ds/initiate      – begin a 3DS session (returns ACS URL / CReq / PAReq)
POST  /api/v1/3ds/verify        – submit challenge result (transStatus / PARes)
GET   /api/v1/3ds/status/:id    – poll session state
POST  /api/v1/3ds/cancel        – cancel an active session

Spec versions supported

  • 3DS 1.0.2 – PAReq/PARes redirect flow
  • EMV 3DS 2.1 / 2.2 – frictionless + challenge flows (CReq/CRes)

Tests

45 tests, all passing:

Test Files  2 passed (2)
     Tests  45 passed (45)

Closes #925

…7#925)

Add full 3D Secure (3DS 1.0.2 and EMV 3DS 2.1/2.2) authentication flow:

- backend/src/services/3ds.ts: in-memory 3DS session service with
  initiate, verify, status, cancel, and purge operations; supports
  frictionless sandbox mode and deterministic BIN-based enrolment
- backend/src/schemas/3ds.ts: Zod validation schemas and TypeScript
  types for all four endpoints
- backend/src/routes/3ds.ts: Express router exposing
    POST /api/v1/3ds/initiate
    POST /api/v1/3ds/verify
    GET  /api/v1/3ds/status/:id
    POST /api/v1/3ds/cancel
- backend/src/index.ts: mount threeDSRouter under /api/v1/3ds
- backend/src/services/__tests__/3ds.test.ts: 24 unit tests
- backend/src/routes/__tests__/3ds.test.ts: 21 schema + integration tests
  (45 tests total, all passing)

Closes Smartdevs17#925
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

@WallexCoder is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@WallexCoder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@github-actions
github-actions Bot merged commit a015a2d into Smartdevs17:main Oct 19, 2026
2 of 3 checks passed
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.

Implement 3DS authentication flow for card payments

1 participant