Skip to content

Add alfredpay support#1057

Open
gianfra-t wants to merge 14 commits intostagingfrom
add-alfredpay-support
Open

Add alfredpay support#1057
gianfra-t wants to merge 14 commits intostagingfrom
add-alfredpay-support

Conversation

@gianfra-t
Copy link
Contributor

@gianfra-t gianfra-t commented Feb 4, 2026

  • Integrates AlfredPay as a new fiat onramp provider for USD → EVM flows (via Polygon USDC + Squid Router)

    • Adds a full KYC lifecycle for AlfredPay: customer creation, redirect-based identity verification, status polling, and failure handling
    • Implements quoting pipeline (AlfredPay quote → fee calculation → Squid Router cross-chain route → finalize) and transaction
      preparation
      (approve + swap unsigned txs routed through Polygon)
    • Adds backend model, migration, controller, routes, and middleware for AlfredPay customer management
    • Adds frontend XState machine (alfredpayKycMachine), KYC flow UI component, ACH payment details display, and API service client
    • Extends shared package with AlfredPay types, API service singleton, and endpoint definitions
    • Includes minor non-AlfredPay cleanups: quote summary layout fix, email validation improvements, lint fixes, animation simplification

    New files

    Shared (packages/shared)

    • services/alfredpay/types.ts — Enums and request/response types for AlfredPay API
    • services/alfredpay/alfredpayApiService.ts — Singleton HTTP client for AlfredPay's penny API
    • endpoints/alfredpay.endpoints.ts — Frontend↔backend contract types

    Backend (apps/api)

    • migrations/023-create-alfredpay-customers-table.ts — DB table for AlfredPay customers
    • models/alfredPayCustomer.model.ts — Sequelize model
    • controllers/alfredpay.controller.ts — 6 endpoints (status, createCustomer, KYC link/opened/finished/status)
    • routes/v1/alfredpay.route.ts + middlewares/alfredpay.middleware.ts
    • services/quote/engines/ — Initialize, fee, and Squid Router engines for AlfredPay onramp
    • services/quote/routes/strategies/onramp-alfredpay-to-evm.strategy.ts
    • services/transactions/onramp/routes/alfredpay-to-evm.ts

    Frontend (apps/frontend)

    • machines/alfredpayKyc.machine.ts — XState machine for KYC flow
    • components/Alfredpay/AlfredpayKycFlow.tsx — KYC UI component
    • components/widget-steps/SummaryStep/USOnrampDetails.tsx — ACH payment details display
    • services/api/alfredpay.service.ts — API client

    Known TODOs

    • Hardcoded test email in createCustomer — needs to be restored to use SupabaseAuthService.getUserProfile()
    • UPDATE_REQUIRED KYC status is unhandled in mapKycStatus
    • Fee engine returns 0 fees — needs verification
    • alfredpayCustomer typed as any in RampContext
    • Leftover console.log statements in controller and USOnrampDetails.tsx
    • KYC failure retry not handled in its own state machine

    Test plan

    • Verify AlfredPay customer creation flow (create → get KYC link → complete KYC → poll until success)
    • Verify USD onramp quoting returns correct amounts from AlfredPay API
    • Verify transaction preparation builds correct Squid Router approve + swap txs
    • Verify ACH payment details are displayed correctly after ramp initiation
    • Verify KYC failure states are handled gracefully
    • Verify non-USD flows are unaffected by the changes
    • Run bun lint and bun typecheck to confirm no regressions

@netlify
Copy link

netlify bot commented Feb 4, 2026

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 99f3bd5
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/69853361e806f2000885685a
😎 Deploy Preview https://deploy-preview-1057--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 4, 2026

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 99f3bd5
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/698533615ecf5f0008781170
😎 Deploy Preview https://deploy-preview-1057--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ebma ebma changed the base branch from staging to 882-account-creation-on-vortex February 10, 2026 18:32
Base automatically changed from 882-account-creation-on-vortex to staging February 10, 2026 20:30
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.

1 participant