INVOZO FOR A CUSTOM SHOP, NODE 20 OR NEWER

invozo.mjs    the client, no other package is needed
connect.mjs   checks the key and sets the confirmations
server.mjs    two addresses: POST /invozo/pay and POST /invozo/webhook
orders.mjs    an example kept in memory: replace its functions with your database

1. Set INVOZO_API_KEY with the key from your Invozo account, Shops.
2. node connect.mjs https://your-shop.com/invozo/webhook
   Set INVOZO_WEBHOOK_SECRET with the secret it shows.
3. node server.mjs, then node connect.mjs
   It has to say: Webhook: works.
4. Replace the functions in orders.mjs with your own database. If they become asynchronous, add await where server.mjs calls them.
5. In your checkout: <form method="post" action="/invozo/pay"><input type="hidden" name="order" value="1042"><button>Pay by card</button></form>

Read the webhook body raw, before any JSON parser: the signature is made over the raw text.
Full guide: https://install.invozo.eu/developers/
