惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News: Ask HN
Hacker News: Ask HN
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Schneier on Security
Schneier on Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Full Disclosure
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
罗磊的独立博客
S
Schneier on Security
H
Hacker News: Front Page
H
Heimdal Security Blog
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
P
Privacy International News Feed
博客园 - 三生石上(FineUI控件)
P
Palo Alto Networks Blog
PCI Perspectives
PCI Perspectives
NISL@THU
NISL@THU
T
Troy Hunt's Blog
Project Zero
Project Zero
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
小众软件
小众软件
月光博客
月光博客
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
C
Cisco Blogs
腾讯CDC
Blog — PlanetScale
Blog — PlanetScale
I
Intezer
I
InfoQ
WordPress大学
WordPress大学
F
Fortinet All Blogs
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
T
Tor Project blog
N
News | PayPal Newsroom
A
Arctic Wolf
有赞技术团队
有赞技术团队
博客园 - Franky
Vercel News
Vercel News
宝玉的分享
宝玉的分享
Application and Cybersecurity Blog
Application and Cybersecurity Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Building a Reliable Payment Tracker with Daya's API and AWS
Emidowojo · 2026-06-22 · via DEV Community

One thing I have learned from working around payment systems is that collecting money is usually the easy part.

The harder problem is knowing, with confidence, that the money arrived and that your system accounted for it correctly.

At first glance, the flow seems straightforward:

  1. Generate payment details.
  2. Give those details to a customer.
  3. Wait for payment.
  4. Update your records.

In reality, payment systems operate in a world of retries, network failures, duplicate events, and downstream services that occasionally decide today is not their day.

That was the problem I wanted to explore when I built this payment tracker.

Instead of focusing only on payment collection, I wanted to build something that could safely handle the full lifecycle of a payment event, from payment creation to reconciliation, while remaining reliable when parts of the system fail.

For payment collection, I used Daya. For reliability and operational infrastructure, I used AWS.

Daya provides the payment infrastructure: funding accounts, bank-transfer collection, crypto-address collection, and deposit webhook events. AWS provides the backbone that lets the application process those events reliably: webhook endpoints, queues, workers, durable storage, secrets management, monitoring, and alerts.

The result is a simple payment tracker that can:

  • Create NGN bank-transfer payment details.
  • Create crypto deposit addresses.
  • Receive and verify signed Daya webhooks.
  • Queue payment events before processing them.
  • Process Daya deposit events asynchronously.
  • Reconcile those events into application payment records.
  • Run entirely on AWS serverless infrastructure.

More importantly, it demonstrates a pattern that shows up in many real-world fintech systems: collect payment events quickly, process them safely, and ensure every payment is accounted for.


Live Demo

I deployed the application publicly so you can explore the flow yourself:

Live Application: http://bit.ly/3Qzpd7G

Source Code: https://github.com/Emidowojo/Daya-Payments-Tracker


The public deployment runs in a safe demonstration mode and showcases the payment lifecycle, webhook handling, event processing, and reconciliation workflow described throughout this article.


The Problem

Imagine a customer pays into your application.

What happens next?

Many first implementations look something like this:

Webhook arrives
↓
Process payment immediately
↓
Update database
↓
Return success

It works until something goes wrong.

What if:

  • Your database is temporarily unavailable?
  • A downstream API times out?
  • The webhook gets delivered twice?
  • Processing takes longer than the provider expects?

Now you're dealing with failed reconciliations, duplicate records, and support tickets.

The goal of this project was to avoid those problems from the beginning.


The Architecture

The architecture separates payment collection from payment processing.

Browser Payment Tracker
        |
        v
Lambda Function URL  <--------  Daya Webhook
        |
        v
Amazon SQS Queue
        |
        v
Worker Lambda
        |
        v
DynamoDB

Secrets Manager -> API Lambda and Worker Lambda

SQS Dead-Letter Queue -> CloudWatch Alarm

The core idea is simple:

The webhook endpoint should acknowledge events quickly.

Actual reconciliation happens later.

In this architecture, Daya is the source of payment events. AWS is the reliability layer that helps the application process those events safely.


Why Daya?

I chose Daya because this project needed a payment layer that could support both local currency and stablecoin collection through an API.

Daya Funding Accounts make that possible.

A funding account represents payment details a business can give to a customer to receive funds. Depending on the rail, that could be an NGN virtual account for bank-transfer collection or a crypto deposit address for stablecoin deposits.

For this project, Daya provides the collection infrastructure and deposit events that make reconciliation possible. The application then uses AWS to process those events safely and turn them into durable payment records.

For this implementation, I used:

Resource Purpose
NGN_VIRTUAL_ACCOUNT Bank-transfer collection
CRYPTO_ADDRESS Stablecoin deposits
deposit.completed Payment notification
X-Daya-Signature Webhook verification

The flow begins by creating payment details through Daya.

Customers receive those payment details and make deposits through their preferred payment rail.

Once funds arrive, Daya emits a webhook event.

That event becomes the starting point for the application's reconciliation workflow.

Relevant Documentation


Creating Payment Details

The application supports both bank-transfer collection and crypto collection.

For bank transfers:

Create Funding Account
↓
NGN_VIRTUAL_ACCOUNT
↓
Receive account number
↓
Display to customer

For crypto deposits:

Create Funding Account
↓
CRYPTO_ADDRESS
↓
Receive deposit address
↓
Display to customer

At this stage, no money has moved yet.

The application is simply preparing a destination where funds can be received.


Receiving Webhooks

When a customer completes a payment, Daya sends a webhook event.

One mistake I see often is treating webhooks as workflows.

They are not.

Webhooks are notifications.

If there is one lesson I would carry into any payment integration, it is this:

Never make the webhook handler do too much.

The webhook endpoint should:

  1. Verify authenticity.
  2. Persist the event.
  3. Return success.

Everything else can happen later.

For this project, the webhook handler follows this flow:

Receive webhook
↓
Verify X-Daya-Signature
↓
Push event to SQS
↓
Return HTTP 200

That's it.

No reconciliation.

No heavy database operations.

No external calls.

Just verification and persistence.

A simplified version of the webhook handler looks like this:

app.post("/webhooks/daya", async (request, response) => {
  const signature = request.header("X-Daya-Signature");
  const rawBody = JSON.stringify(request.body);

  const isValid = verifyDayaSignature(rawBody, signature, webhookSecret);

  if (!isValid) {
    return response.status(401).json({ error: "Invalid webhook signature" });
  }

  await queue.send({
    id: request.body.id,
    type: request.body.type,
    payload: request.body,
  });

  return response.status(200).json({ received: true });
});

In the real application, the queue is backed by Amazon SQS in AWS and by a local queue during development.


Why Queue the Webhook?

Once a webhook has been verified, the event is pushed into Amazon SQS.

This provides several benefits.

Faster Responses

Webhook providers expect a quick response.

The API no longer waits for reconciliation logic to finish.

Retryability

If processing fails, SQS can retry automatically.

Failure Isolation

A temporary database issue should not cause webhook delivery failures.

Traffic Buffering

Large bursts of payment activity can be absorbed without overwhelming workers.

Dead-Letter Queues

Failed events can be isolated and investigated later.

The queue acts as a safety layer between incoming payment events and business logic.


Processing Payments Safely

A worker Lambda consumes events from SQS.

This is where the application reconciliation happens.

SQS Event
↓
Validate payload
↓
Check idempotency
↓
Store payment record
↓
Mark event processed

The worker becomes responsible for turning Daya payment notifications into durable application records.

This separation makes the system significantly easier to reason about.


Handling Duplicate Events

Payment systems should assume every event can arrive more than once.

Not because something is broken.

Because retries are a feature of reliable systems.

To avoid duplicate processing, the worker stores processed webhook IDs.

Before handling an event, it checks whether that ID already exists.

Webhook Event
↓
Has event been processed?
 ├─ Yes → Skip
 └─ No → Process

This property is known as idempotency.

Without it, duplicate webhook deliveries could create duplicate payment records.

With it, the same event can safely be delivered multiple times.

That is the difference between:

"We received a webhook"

and

"We safely reconciled a payment."


Storing Payment State

DynamoDB serves as the application's reconciliation store, not as a replacement for Daya's payment records.

The application stores:

  • Funding accounts
  • Payment records
  • Processed webhook IDs

Having a dedicated record of processed events makes idempotent processing straightforward.

It also provides a clear audit trail when troubleshooting payment issues.


Managing Secrets

Payment systems inevitably require credentials.

For this build, I used AWS Secrets Manager to store:

  • Daya API keys
  • Daya webhook secrets

Neither the application code nor deployment artifacts contain sensitive values.

Both the API Lambda and worker Lambda retrieve secrets at runtime.


Monitoring and Operations

Reliable systems need visibility.

CloudWatch provides:

  • Application logs
  • Worker logs
  • Error tracking
  • Dead-letter queue alarms

If events begin accumulating in the dead-letter queue, CloudWatch can raise an alert so operators know reconciliation requires attention.

This is one of those operational details that rarely appears in architecture diagrams but becomes invaluable in production.


Deployment

The project is deployed using AWS CDK and a serverless architecture built around Lambda, SQS, DynamoDB, Secrets Manager, and CloudWatch.

The deployment process provisions:

  • Application endpoints
  • Webhook endpoints
  • Event queues
  • Dead-letter queues
  • DynamoDB tables
  • Secrets storage
  • Monitoring resources

One of the goals of the project was to demonstrate that reliable payment processing does not require managing servers. By combining event-driven AWS services, the operational burden remains low while reliability remains high.


What About Containers?

Because I am also active in the AWS Containers community, I included an ECS Fargate deployment path in the project as well.

Functionally, both deployments achieve the same outcome.

The difference is operational.

The serverless version is cheaper and simpler to maintain.

The ECS version provides a stronger container-focused architecture and may fit teams already standardizing on containers.

For educational projects, I would start with serverless and treat the container deployment as an advanced follow-up.


Lessons Learned

Building this project reinforced a few lessons that apply far beyond this payment tracker.

1. Webhook Handlers Should Be Boring

When I first started working with event-driven systems, I was tempted to do all the work inside the webhook handler.

That approach works until something downstream becomes unavailable.

The more responsibility a webhook endpoint has, the more opportunities it has to fail.

In this project, the webhook handler has one job:

  1. Verify the request.
  2. Persist the event.
  3. Return success.

Everything else happens asynchronously.

Keeping the handler simple makes the system more reliable and easier to troubleshoot.

2. Queues Are an Investment in Reliability

It's easy to look at SQS and think it adds complexity.

In reality, it removes complexity from the parts of the system that matter most.

The queue absorbs traffic spikes, handles retries, and creates a buffer between incoming payment events and business logic.

Without the queue, every temporary downstream failure becomes a payment-processing problem.

With the queue, failures become manageable.

3. Idempotency Is Not Optional

One of the most important lessons in payment systems is that duplicate events are normal.

Providers retry webhooks.

Networks fail.

Clients reconnect.

The question is not whether duplicates will happen.

The question is whether your system can handle them safely.

Designing for idempotency from the start is much easier than trying to retrofit it later.

4. Reliability Is an Architecture Decision

Reliable systems are rarely the result of a single service or framework.

Reliability comes from the choices made between components.

The queue, the worker, the dead-letter queue, the monitoring, and the idempotency checks all contribute to a system that can recover gracefully when things go wrong.

5. Observability Matters More Than Expected

One thing that became clear while building this project is that debugging payment systems without visibility is frustrating.

Logs, metrics, and alerts are not features users see, but they are often the difference between quickly resolving an issue and spending hours trying to understand what happened.

CloudWatch ended up being just as important as the business logic itself because it provided confidence that payment events were flowing through the system correctly.


Before Production

Before adapting this pattern for a real customer-facing product, I would recommend adding:

  • Authentication and authorization
  • Custom domains and TLS management
  • Structured tracing
  • CI/CD pipelines
  • Alarm notifications
  • Production reconciliation queries
  • Rate limiting
  • Audit logging
  • Separation of testing and production environments

The architecture is intentionally simple, but the reliability patterns scale well beyond this example.


Final Thoughts

Building payment systems taught me that reliability rarely comes from a single API call.

It comes from the decisions made around that call.

How events are received.

How failures are handled.

How retries are processed.

How operators gain confidence that the system reflects reality.

Daya makes it possible to create payment destinations and receive deposit events.

AWS helps the application process those events reliably and reconcile them into its own records.

Together, they provide a practical blueprint for building payment systems that users and operators can trust.