Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Lock the Files That Charge Customers

Описание и применение

Разделение публичного каталога и stub‑обработчика платежей позволяет безопасно демонстрировать функциональность без реальных транзакций.

Задача

Ensuring that only authorized code paths handle real payments while keeping a safe, testable stub for development and demo purposes.

Результат

A clear separation between public catalog and charge logic prevents accidental real payments while allowing safe demos and development.

Рабочий процесс

  • 1. Create two separate Node services: one for the public catalog, one for the charge stub.
  • 2. In the catalog service, expose a listSkus function that returns demo SKUs.
  • 3. In the money-path module, implement verifyWebhook to check HMAC signatures and recordIntent to log charge intents.
  • 4. In the server module, route GET /health for health checks, and POST /webhook to process incoming events using verifyWebhook and recordIntent.
  • 5. Set the WEBHOOK_SECRET environment variable for signature verification.
  • 6. Deploy the catalog service publicly; keep the charge stub service isolated for internal use.
  • 7. Use the stub to record intents during demos, ensuring no real charges are made.
  • 8. When ready for production, replace the stub with a real payment processor integration.
  • 9. Test the entire flow locally before deployment.

Доказательства

Create a tiny Node service with two rooms. One room holds public catalog chrome only. The other room holds the charge stub.

Источник

The stub does not talk to a processor. It records intent and refuses extra cleverness.

Источник

  • Дата записи: 2026-09-22T12:15:45.684Z