====================================================================
 SecurePay for SMM Panel - optional admin upgrade (method id 69)
====================================================================
Apply these 3 small edits so the admin can set the SecurePay
gateway URL, API key and exchange rate from the panel.

BACKUP the edited files before making changes.

--------------------------------------------------------------------
1) app/controller/payment.php  - FIX THE CALLBACK ROUTING BUG
--------------------------------------------------------------------
Stock SMM routes the "securepaybd" callback to the wrong file.
Find this block:

    if ($callbackSlug == "securepaybd") {
        require("payment/tuktakpay.php");
        exit;
    }

Replace it with:

    if ($callbackSlug == "securepaybd") {
        require("payment/securepaybd.php");
        exit;
    }

--------------------------------------------------------------------
2) admin/controller/settings/paymentMethods/getForm.php
--------------------------------------------------------------------
Find the methodId 69 block (near the end of the file):

    if ($method["methodId"] == 69) {
        $form .= '<div class="form-group mb-3"><label class="form-label">API Key</label>
        <input type="text"  name="api_key" class="form-control" value="' . $methodExtras["api_key"] . '"/></div>';
        $form .= '<div class="form-group mb-3"><label class="form-label">Exchange Rate [1 USD = ? BDT]</label>
        <input type="text"  name="exchange_rate" class="form-control" value="' . $methodExtras["exchange_rate"] . '"/></div>';
    }

Replace it with:

    if ($method["methodId"] == 69) {
        $form .= '<div class="form-group mb-3"><label class="form-label">Gateway URL</label>
        <input type="text" name="api_url" class="form-control" placeholder="https://payment.example.com" value="' . $methodExtras["api_url"] . '"/></div>';
        $form .= '<div class="form-group mb-3"><label class="form-label">API Key</label>
        <input type="text" name="api_key" class="form-control" value="' . $methodExtras["api_key"] . '"/></div>';
        $form .= '<div class="form-group mb-3"><label class="form-label">Exchange Rate (1 unit = ? Taka)</label>
        <input type="text" name="exchange_rate" class="form-control" value="' . $methodExtras["exchange_rate"] . '"/></div>';
        $form .= '<div class="form-group mb-3"><label class="form-label">Instructions</label>
        <div class="text-muted small">Leave Gateway URL empty only if you are reusing a previously filled URL.</div></div>';
    }

--------------------------------------------------------------------
3) admin/controller/settings/paymentMethods/editMethodExtras.php
--------------------------------------------------------------------
Find the methodId 69 block:

    if ($methodId == 69) {
        $apiKey = htmlspecialchars($_POST["api_key"]);
        $exchangeRate = htmlspecialchars($_POST["exchange_rate"]);
        $methodExtras = [
            "api_key" => $apiKey,
            "exchange_rate" => $exchangeRate
        ];
    }

Replace it with:

    if ($methodId == 69) {
        $apiUrl = rtrim(trim(htmlspecialchars($_POST["api_url"])), '/');
        $apiKey = htmlspecialchars($_POST["api_key"]);
        $exchangeRate = htmlspecialchars($_POST["exchange_rate"]);
        $methodExtras = [
            "api_url" => $apiUrl,
            "api_key" => $apiKey,
            "exchange_rate" => $exchangeRate
        ];
    }