Currently implemented:
Obtaining an authorization token from A-Bank using login and secret key (/auth/get-token)
Creating an invoice (payment links) through the /make-invoice method, passing the amount, description, order identifier, and callback addresses
Returning to the user the invoice_url link, which can be immediately sent to the client for payment
Receiving a webhook from A-Bank at /payments/callback — the server receives the payment result (status, amount, transaction identifier, etc.)
Outputting webhook requests to the console for debugging and confirming successful payments
Return page /payments/return, where the user is redirected after payment
Ready .env configuration with test keys that are already working (Node.js project structure (Express, dotenv, uuid, node-fetch) is set up — no need to install or configure anything manually)
what needs to be done
Insert this code on your server (or adapt it to the backend they are using)
Link invoice creation to website orders (pass amount, orderId, description)
Process webhook from /payments/callback: mark the order as paid based on the status paid
Replace test keys in .env with production keys (HOST, LOGIN, SECRET_KEY, COMM_UUID)
Replace temporary callback addresses (ngrok) with production addresses of the site
Instructions for running on the test server in the readme file at the root of the directory
Test working code
https://drive.google.com/file/d/1NP0OiMOW-b47RKwFWf5FqZUdrCv5Ynkp/view?usp=sharing
Main framework Next.js (React)
Language TypeScript
Server Node.js
Deployment PM2 + Shell Script (deploy.sh)
Build npm run build
Architecture Feature-Sliced Design (FSD)