mistKET crypto payment gateway for WHMCS
=========================================

Install
1. Upload the "modules" folder to your WHMCS root directory (it merges into the existing modules/ folder):
     modules/gateways/mistket.php
     modules/gateways/mistket/lib.php
     modules/gateways/callback/mistket.php
2. WHMCS admin > System Settings > Payment Gateways > All Payment Gateways > "mistKET (Crypto)".
3. In the mistKET merchant dashboard open "API & webhook":
     API keys > New key: copy API Key and API Secret (the secret is shown only once).
     Webhook > Signing secret: copy the signing secret (whsec_...).
4. Paste them into the gateway settings and save.
   The webhook URL (https://your-whmcs/modules/gateways/callback/mistket.php) is sent with every invoice
   automatically. You can also set it as the project webhook URL in the dashboard and use "Send test notification".

Status mapping
  confirmed / overpaid  -> payment added to the WHMCS invoice (transaction ID = mistKET invoice uuid).
  paid                  -> logged: payment seen, waiting for confirmations (invoice stays Unpaid).
  underpaid             -> logged with received/remaining amount; accept or refund in the mistKET dashboard.
  expired / cancelled   -> logged; the client can click "Pay with crypto" again to get a new payment.
Every webhook is verified with the signing secret; the module re-reads the invoice from the API and checks
the amount and currency before adding a payment. See Billing > Gateway Log for details.

Supported invoice currencies: USD, EUR, TRY, RUB, GBP, AED (use "Convert To For Processing" for others).
The module creates the table mod_mistket_invoices on first use.

Kurulum (TR)
1. "modules" klasörünü WHMCS kök dizinine yükleyin.
2. Yönetim > Sistem Ayarları > Ödeme Yöntemleri > "mistKET (Crypto)" yöntemini etkinleştirin.
3. mistKET panelinde "API & webhook" > "API anahtarları" > "Yeni anahtar" ile API Key ve API Secret'ı,
   "Webhook" > "İmza anahtarı" ile imza anahtarını kopyalayıp ayarlara yapıştırın ve kaydedin.
4. Webhook adresi her faturayla otomatik gönderilir; panelde ayrıca girmeniz gerekmez.
Docs: https://mistket.com/docs
