CryptoPayr — MU Online crypto donation module
=============================================

Accept crypto (Bitcoin, Ethereum, USDT and 30+ coins) on your MU Online server.
Players buy WCoin on the CryptoPayr hosted checkout and it is credited to their
account automatically once the payment is confirmed on-chain — via a signed
webhook.

How delivery works: the module adds the purchased amount to the account's WCoin
column (WCoinC by default, or WCoinP / GoblinPoint) in the MEMB_INFO table.

IMPORTANT: MU Online runs on Microsoft SQL Server, so this module connects via
PHP PDO using either:
  - pdo_sqlsrv  (Microsoft driver, typical on Windows), or
  - pdo_dblib / FreeTDS (typical on Linux).
One of these PDO drivers must be installed/enabled in PHP.


1. CryptoPayr API key
---------------------
Sign up at https://cryptopayr.com, then Dashboard -> Developers and copy your
API key (sk_live_...). It is used both to create payments and to verify the
webhook signature.


2. Upload & install
--------------------
- Upload this folder to your web server (e.g. /donate), on a host that can reach
  your MU SQL Server (default port 1433). The site must be reachable over HTTPS.
- chmod 666 config.php, then open /donate/install.php and follow the steps:
  driver + database connection, table detection (MEMB_INFO + the WCoin column),
  and settings — the WCoin column, account table/column, price per WCoin,
  currency, minimum and API key.
- DELETE install.php when finished.


3. Add the donation form
------------------------
Link players to form_with_ajax.php (or embed your own form posting to
payment.php with `us_account` = account username and `sum` = amount of WCoin).


Notes
-----
- Players enter their ACCOUNT username (memb___id).
- 1 coin = 1 WCoin; the price per WCoin is set in the installer.
- WCoin column defaults to WCoinC; switch to WCoinP or GoblinPoint in the
  installer / config.php if your server credits a different column.
- Account table/column default to MEMB_INFO / memb___id; adjust in config.php for
  custom server files.
- Orders are recorded in cryptopayr_payments (status 0 pending, 1 completed,
  2 refunded) with the CryptoPayr transaction id. Delivery is at-most-once even
  if the webhook is retried.
- config.php (SQL Server credentials + API key) is protected by the bundled
  .htaccess.


Support
-------
Docs:  https://cryptopayr.com/docs
Email: support@cryptopayr.com

MIT licensed. (c) CryptoPayr
