NAYAPAY AUTOMATIC WALLET TOP-UP
===============================

FLOW
----
TOPUP -> customer enters amount -> bot shows NayaPay details -> customer pays exact amount -> sends screenshot -> bot sends waiting message -> screenshot sender name + screenshot amount are OCR-read -> bot matches both with a NEW NayaPay Gmail receipt -> wallet is credited -> success WhatsApp message is sent.

1) Admin Panel > Payment Methods
   - Add/enable NayaPay
   - Set Account Title: Muhammad Shoaib (or your actual NayaPay title)
   - Set your NayaPay account number

2) Gmail
   - NayaPay receipt mailbox: shoaibraja2917@gmail.com
   - NayaPay receipt sender: service@nayapay.com
   - This Gmail must remain connected through the bot's existing Google OAuth flow.
   - The verifier scans connected google_token_*.json accounts.
   - Only NEW emails from service@nayapay.com arriving after the customer's TOPUP request are eligible.
   - Bot reads Source Acc. Title, Amount Received and Transaction ID from the NayaPay receipt.
   - Screenshot sender name must match Source Acc. Title and screenshot amount must match Amount Received.
   - Once a Gmail message ID or NayaPay Transaction ID credits a wallet, it can never be used again.

3) Cron (REQUIRED for automatic success within about one minute if the email arrives after the screenshot)
   Run every minute from cPanel Cron Jobs, for example:
   * * * * * /usr/local/bin/php /FULL/PATH/TO/bot.shoaibsubscription.pk/cron/nayapay_verify.php >/dev/null 2>&1

4) Screenshot OCR (REQUIRED for automatic screenshot verification)
   - The payment screenshot is required, validated as an image, SHA-256 hashed and stored securely.
   - Server must have the `tesseract` binary available to PHP for local OCR.
   - The bot reads sender name + paid amount from the screenshot.
   - Screenshot amount must equal the amount the customer entered before payment.
   - Screenshot sender name + amount must both match the NayaPay email receipt.
   - If OCR cannot read the sender name or amount, no wallet balance is added automatically.

5) Duplicate / fake top-up protection
   - A successfully used screenshot hash cannot be reused.
   - A successfully used Gmail message ID cannot be reused.
   - A successfully used NayaPay Transaction ID cannot be reused.
   - Receipt must be new for the active top-up request and must come from service@nayapay.com.
   - Requested amount = screenshot amount = email receipt amount.
   - Screenshot sender name must match Source Acc. Title in the email receipt.
