PAYBYTE COFFEE MUG CHECKOUT DEMO
================================

Purpose
-------
This is a small real PBE-PAY checkout example. It creates a unique payment
reference, opens the Paybyte wallet, and watches the exact reference + recipient
+ amount until the requested confirmation depth is reached.

Default demo values
-------------------
Product: Paybyte Coffee Mug
Price: 50.00 PBE
Confirmations: 12

Configuration
-------------
Edit config.js to change the product label, receiving address, amount,
confirmation policy, node URL or wallet URL.

Set merchantAddress to your own pbe1... mainnet receiving address before use.
The included defaults use the current page origin as the PBE node and /wallet/
on that origin as the wallet handoff.

Database
--------
This polling checkout demo does not require merchant database tables.
database.sql is included so every downloadable Paybyte example has the same
installation shape; for this example it intentionally contains no CREATE TABLE
statements.

Install
-------
Place the complete folder under your PBE /web directory, for example:

D:\xampp\htdocs\paybyte.org\web\Paybyte-Coffee-Mug-Checkout-Test\

Then open:
https://your-domain.example/web/Paybyte-Coffee-Mug-Checkout-Test/

Expected flow
-------------
1. Browser creates a unique opaque order reference.
2. POST /rpc/commerce/payment-request creates a PBE-PAY request.
3. Pay by Paybyte opens /wallet/?pay=... with the payment tuple locked.
4. Customer signs locally and broadcasts.
5. Checkout polls GET /rpc/commerce/payment/{reference}.
6. UI moves unpaid -> pending -> confirming -> confirmed.

Important
---------
This is a REAL mainnet payment demo. Confirming the wallet transaction moves
real PBE to the configured receiving address plus the normal fee. Use a small
amount while adapting the example and verify the receiving address carefully.

For production automatic fulfilment, use the Golden Sword webhook example or
the Commerce webhooks documentation instead of trusting browser polling alone.

Documentation
-------------
Current Paybyte developer documentation and refreshed example downloads live at:
https://paybyte.org/web/developers/
