CryptoPayr — Ragnarok Online crypto donation module
====================================================

Accept crypto (Bitcoin, Ethereum, USDT and 30+ coins) on your Ragnarok Online
server (rAthena / Hercules). Players buy Cash Points on the CryptoPayr hosted
checkout and the points are credited to their account automatically once the
payment is confirmed on-chain — via a signed webhook. The points are then
spendable in the in-game Cash Shop.

How delivery works: the module adds the purchased amount to the account's
`#CASHPOINTS` variable in the `acc_reg_num` table (the same value FluxCP uses).


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 rAthena MySQL database. The site must be reachable over HTTPS.
- chmod 666 config.php, then open /donate/install.php and follow the steps:
  database connection, table detection (login + acc_reg_num), and settings
  (price per cash point, currency, minimum, API key, optional public URL).
- 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` = number of cash
points).


Notes
-----
- Players enter their ACCOUNT username (not the character name).
- 1 coin = 1 cash point; the price per point is set in the installer.
- Cash point variable defaults to #CASHPOINTS; change CASHPOINT_VAR in config.php
  if your server uses a different account variable.
- Orders are recorded in the cryptopayr_payments table (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 (DB credentials + API key) is protected by the bundled .htaccess.


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

MIT licensed. (c) CryptoPayr
