WIX FSFPAY PACKAGE

This package contains two parts:
A) Public/embed files that Wix users can add to their site (Custom Code or Embed Block).
B) Server backend (PHP) to host on your server - handles create-session and webhook logic.

Directory structure:
- public/embed.html       -> HTML snippet to embed in Wix (includes fsfpay.js)
- public/fsfpay.js        -> JavaScript to call your server's create-session endpoint
- public/style.css        -> Button styles
- server/config.php       -> Put your FSFPAY API credentials here (DO NOT upload to Wix)
- server/create_payment.php -> Server-side endpoint to call FSFPAY create-session (POST)
- server/webhook.php      -> Server-side webhook receiver for FSFPAY notifications

IMPORTANT:
- **Do NOT** put config.php or any server files into Wix. Wix cannot host server-side PHP.
- Host the server/ files on a secure HTTPS server you control (Heroku, Render, DigitalOcean, etc.).
- In Wix, insert the content of public/embed.html into a Code Block (or Settings > Advanced > Custom Code).
- Update fsfpay.js to point to your server create-session endpoint URL.

Quick start:
1. Upload server/ files to your HTTPS server and configure config.php.
2. Place the embed.html content into Wix (Custom Code). Update the data attributes (data-endpoint) to your server URL.
3. Test using the sample button. The flow: Wix (frontend) -> your server/create_payment.php -> FSFPAY API -> returns checkout_url -> user redirected to FSFPAY.

Security:
- Keep API_SECRET on server only. Never expose it in frontend.
- Validate webhook signatures using your API_SECRET in webhook.php.

If you want, I can also deploy the backend to a Heroku/Render template for you (instructions included).