Menu

Accept crypto payments in NestJS
📰

Accept crypto payments in NestJS

DEV Community: nestjs·Moonvex News·2 days ago
#Lw9a9cjL
#devtonestjs#devto#dev#moonvex#payment
Reading 0:00
15s threshold

How to accept USDT, BTC and other coins in a NestJS app: a provider wrapping the SDK, a controller that redirects to the checkout page where the customer picks the coin, and a webhook controller that reads req.rawBody and verifies the HMAC signature.

Step by step

1. Get an API key and a webhook secret

In the Moonvex dashboard go to “Integration” → “Create key” → type “Secret” (sk_live_…). The key is shown only once: store it on your server as MOONVEX_SECRET_KEY. On the same page add a webhook pointing to an https URL on your server and store its signing secret as MOONVEX_WEBHOOK_SECRET. In NestJS you would normally read them through ConfigModule; the example uses process.env for brevity.

npm install @moonvex/node

# .env MOONVEX_SECRET_KEY = sk_live_... MOONVEX_WEBHOOK_SECRET = whsec_...

Enter fullscreen mode

Exit fullscreen mode

2.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.