AlixFast module for PerfectPanel — Install Guide
================================================

Files: config.php, alixfast_lib.php, pay.php, return.php, callback.php

STEP 1 — Upload
Upload all 5 files into ONE folder on your panel hosting, e.g.
  public_html/alixfast-pay/
(koi bhi folder chalega — bas teeno php files sath rakhein)

STEP 2 — Keys
config.php kholein aur bharein:
  - AFX_PUBLIC_KEY / AFX_SECRET_KEY
    (AlixFast merchant panel -> Integration page se)
  - AFX_DB_HOST / NAME / USER / PASS
    (aapke PerfectPanel ki database details — aksar wohi jo panel
     ki apni config mein hain)
  - AFX_RETURN_PAGE: payment ke baad user kahan jaye
    (default /add_funds)

STEP 3 — Webhook
AlixFast merchant panel -> Integration -> Webhook URL mein dein:
  https://YOURPANEL.pk/alixfast-pay/callback.php

STEP 4 — Add-funds button
Panel ke add-funds page par AlixFast ka option jodein — ek simple
form jo pay.php ko amount bhejta hai:

  <form method="post" action="/alixfast-pay/pay.php">
    <input type="number" name="amount" min="10" required>
    <button type="submit">Pay with AlixFast</button>
  </form>

(Agar aapke PerfectPanel version mein payment-methods ki list admin
se banti hai to wahan "Custom / External link" wale method mein ye
form ka URL use karein.)

STEP 5 — Test
Test keys se ek choti payment karein. Payment verify hote hi user
ka balance khud barh jata hai (webhook se; agar webhook late ho to
return.php par bhi credit check hota hai — double credit NAHI hota).

TROUBLESHOOTING
- Balance credit na ho: callback.php ka URL browser mein kholein —
  "bad signature" ana chahiye (matlab file chal rahi hai).
- Database error: config.php ki DB details aur users table mapping
  (AFX_USERS_TABLE / AFX_BALANCE_COL) apne version ke hisab se check
  karein — bas yehi lines version ke hisab se badal sakti hain.
- Session user id na mile: pay.php mein $_SESSION wali line apne
  panel ke hisab se badlein (wahan comment laga hai).

Support: AlixFast panel se ticket kholein.
