CryptoPayr — World of Warcraft crypto donation module
=====================================================

Accept crypto (Bitcoin, Ethereum, USDT and 30+ coins) on your WoW private
server (TrinityCore / AzerothCore). Players buy "coins" on the CryptoPayr hosted
checkout and the purchased item is mailed to their character automatically once
the payment is confirmed on-chain — via a signed webhook.

How delivery works: the module runs the worldserver console command
`.send items "<char>" "<subject>" "<text>" <itemId>:<count>` over SOAP. This is
the officially supported way to grant items and does not require touching the
item/mail tables directly. The PHP `soap` extension is NOT needed (SOAP is sent
over cURL).


1. Enable SOAP on the worldserver
---------------------------------
In worldserver.conf set:  SOAP.Enabled = 1   (default SOAP.Port = 7878)
Create/choose an account with GM level 3 and SOAP access that the module will
use to issue the command.


2. 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.


3. Upload & install
--------------------
- Upload this folder to your web server (e.g. /donate), on a host that can reach
  both your characters MySQL database AND the worldserver SOAP port. The site
  must be reachable over HTTPS.
- chmod 666 config.php, then open /donate/install.php and follow the steps:
  database connection (the characters DB, e.g. acore_characters), table
  detection (characters), and settings — ITEM_ID, SOAP URL/user/password, SOAP
  namespace (AzerothCore: urn:AC, TrinityCore: urn:TC), mail subject, price,
  currency, minimum and API key.
- DELETE install.php when finished.


4. Add the donation form
------------------------
Link players to form_with_ajax.php (or embed your own form posting to
payment.php with `us_account` = character name and `sum` = number of coins).


Notes
-----
- Players enter their CHARACTER name; `.send items` queues the mail even if the
  character is offline.
- ITEM_ID is the item mailed; the count equals the number of coins (.send items
  splits into multiple mails automatically when needed).
- The DB connection should point at the characters database; the orders table
  cryptopayr_payments is created there.
- Orders are recorded in cryptopayr_payments (status 0/1/2) with the CryptoPayr
  transaction id. Delivery is at-most-once even if the webhook is retried.
- config.php (DB + SOAP credentials + API key) is protected by the bundled
  .htaccess.


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

MIT licensed. (c) CryptoPayr
