Skip to main content

Payments

PointNXT talks to payment gateways for two unrelated reasons. Do not mix them up:

PointNXT's own accountThe tenant's own gateway accounts
PurposeWallet top-ups, WhatsApp checkoutReconciling the tenant's D2C sales
CredentialsRAZORPAY_KEY_ID etc. in .envPer payment account, encrypted IntegrationConnection; connected from Integrations → Payments
CodeRazorpayPaymentAdapter, wallet portPaymentAccount records (finance/payment-account), PaymentGatewayRegistry and adapters, PAYMENT_GATEWAY_PORT
DocsThis pagePayment gateway settlements

Both live in PaymentsModule (payments.module.ts). The module imports DatabaseModule and IntegrationConnectionModule; dropping either breaks boot (see Application will not start).

Razorpay​

Whererazorpay package, src/integrations/payments, WhatsApp adapter
AuthRAZORPAY_KEY_ID, secret, webhook secret. Setting the key id makes the other two mandatory at boot
WebhooksWhatsApp payment webhook is @PublicRoute and reads Stripe or Razorpay signatures
ScopeWallet payment intents and WhatsApp checkout

Wallet debit on order.confirmed is an internal ledger movement (deductToken). It is not itself a Razorpay charge. See Wallet.

Stripe​

Whereautomation/whatsapp-agent/payments/adapters/stripe.adapter.ts
AuthSecret read from agent configuration. No STRIPE_ block in the first 250 lines of .env.example
ScopeCheckout Sessions for WhatsApp

Idempotency​

Payment event tables exist (PaymentEvent, PaymentIntent). Whether webhook handlers dedupe on a provider event id was not line-read. Do not assume they do.

Failure​

A failed Razorpay call on a webhook follows that controller. The order token debit failure mode is the outbox retry, which is a different path.