Skip to content

feat(messaging): REGISTER, ONBOARD, UPDATE WhatsApp commands - #3

Merged
DevSolex merged 1 commit into
mainfrom
feat/whatsapp-onboarding-commands
Sep 27, 2026
Merged

DevSolex merged 1 commit into
mainfrom
feat/whatsapp-onboarding-commands

Conversation

@devkryssie

Copy link
Copy Markdown
Collaborator

Summary

Merchants can now complete the full onboarding flow directly from WhatsApp — no API calls or SQL inserts required.

New commands

Command What it does
REGISTER <business name> Creates a merchant account (pending verification)
ONBOARD <account number> <bank code> Verifies bank account via Paystack, creates subaccount, activates merchant
UPDATE <account number> <bank code> Requests a payout account change with Rule 5 cooling-off + immediate notification
CANCEL / STOP Cancels a pending UPDATE (existing)
PAY <amount> <description> Creates a payment link (existing)

Flow

  1. New merchant sends REGISTER Adaeze Fashion Store → account created
  2. Sends ONBOARD 0123456789 058 → Paystack verifies bank, creates subaccount, merchant activated
  3. Sends PAY 750 Ankara fabric x2 → gets checkout URL
  4. Later: UPDATE 9876543210 033 → 48h cooling-off, reply CANCEL to abort

Details

  • REGISTER works for unregistered senders (handled before merchant resolution)
  • Unregistered senders who send any other command now get the REGISTER prompt
  • ONBOARD/UPDATE both call Paystack bank/resolve before writing any DB rows
  • UPDATE uses the existing Rule 5 cooling-off path and RLS-protected cancellation
  • USAGE_MESSAGE updated to list all commands

Tests

105 passing, 0 failures.

Merchants can now complete the full onboarding flow from WhatsApp:

  REGISTER <business name>     — create merchant account
  ONBOARD <account> <bankcode> — verify bank account, create Paystack
                                  subaccount, activate merchant
  UPDATE <account> <bankcode>  — change payout account (Rule 5 cooling-off,
                                  immediate notification, reply CANCEL to abort)

Unregistered senders now receive the REGISTER prompt instead of a
generic 'contact support' message.

USAGE_MESSAGE updated to list all available commands.

@DevSolex DevSolex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approved.

REGISTER/ONBOARD/UPDATE parsers are clean with proper validation (10-digit account number, numeric bank code, 200-char business name limit). REGISTER correctly handled before merchant resolution so unregistered senders can onboard. UPDATE correctly uses the existing Rule 5 cooling-off path. All inline Paystack calls follow the same pattern as the onboarding endpoint. USAGE_MESSAGE updated. 105 tests passing.

@DevSolex
DevSolex merged commit 33510a2 into main Sep 27, 2026
4 of 5 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.

2 participants