Skip to content

feat(notifications): add WhatsApp payment notifications (#958) - #1319

Merged
github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
livinalt:feat/958-whatsapp-payment-notifications
Oct 21, 2026
Merged

github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
livinalt:feat/958-whatsapp-payment-notifications

Conversation

@livinalt

Copy link
Copy Markdown
Contributor

What this PR does

  • Implements WhatsApp payment notifications for the AgenticPay platform (Add WhatsApp payment notifications #958).
  • Adds a new WhatsAppChannel for sending WhatsApp notifications with recipient normalization, message formatting, credential handling, and simulated delivery when API credentials are unavailable.
  • Adds WhatsAppNotificationChannel implementing the NotificationChannel interface for the plugin notification architecture, including priority-aware formatting and health checks.
  • Introduces WhatsAppPaymentNotificationService to handle payment success, payment failure, and refund notifications.
  • Adds support for WhatsApp notification preferences (whatsappEnabled and whatsappNumber).
  • Extends notification templates to support WhatsApp for payment-related notifications.
  • Adds REST API endpoints under /api/v1/notifications/whatsapp for triggering WhatsApp payment notifications.
  • Adds comprehensive unit tests covering the new functionality.
  • Breaking changes: None.
  • Migrations: None required.

Changes

New Files

  • backend/src/notifications/channels/__tests__/whatsapp-channel.test.ts
  • backend/src/notifications/channels/whatsapp-channel.ts
  • backend/src/routes/whatsapp.ts
  • backend/src/services/__tests__/whatsapp-notifications.test.ts
  • backend/src/services/notifications/channels/whatsapp.ts
  • backend/src/services/whatsapp-payment-notifications.ts

Updated Components

  • Registered the WhatsApp notification channel in the notification channel registry.
  • Updated NotificationPreferenceService to support:
    • whatsappEnabled
    • whatsappNumber
  • Updated NotificationTemplateService to include WhatsApp templates for:
    • payment_receipt
    • payment_confirmation
    • refund_notification
  • Updated DeliveryTracker to record WhatsApp notification deliveries.

Why

This PR implements the WhatsApp payment notification feature requested in Issue #958, enabling users to receive payment confirmations, failure alerts, and refund notifications via WhatsApp.

The implementation integrates with the existing notification architecture, respects user notification preferences, supports local development through simulated deliveries when API credentials are unavailable, and is fully backward compatible with existing notification channels.


How to test

  1. Run the WhatsApp channel tests:
npx vitest run backend/src/notifications/channels/__tests__/whatsapp-channel.test.ts
  1. Run the WhatsApp payment notification tests:
npx vitest run backend/src/services/__tests__/whatsapp-notifications.test.ts
  1. (Optional) Configure the following environment variables for live WhatsApp delivery:
  • TWILIO_ACCOUNT_SID
  • TWILIO_AUTH_TOKEN
  • WHATSAPP_FROM_NUMBER
  • WHATSAPP_API_URL
  1. Test the REST endpoints:
  • POST /api/v1/notifications/whatsapp/payment-success
  • POST /api/v1/notifications/whatsapp/payment-failed
  • POST /api/v1/notifications/whatsapp/payment-refunded

Notes

  • When WhatsApp API credentials are not configured, the channel automatically falls back to simulated delivery for local development and testing.
  • Existing notification functionality remains unchanged, and regression tests continue to pass.
  • Closes Add WhatsApp payment notifications #958

@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@livinalt 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 21, 2026

Copy link
Copy Markdown

@livinalt 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 695a0de into Smartdevs17:main Oct 21, 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.

Add WhatsApp payment notifications

1 participant