-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: May 05, 2026 at 07:35 PM
-- Server version: 10.11.16-MariaDB-cll-lve
-- PHP Version: 8.4.20

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `ssteleco_hpay`
--

-- --------------------------------------------------------

--
-- Table structure for table `balance_log`
--

CREATE TABLE `balance_log` (
  `id` int(11) NOT NULL,
  `username` varchar(100) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- --------------------------------------------------------

--
-- Table structure for table `hotspot_payment_transactions`
--

CREATE TABLE `hotspot_payment_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `invoice` varchar(64) NOT NULL,
  `username` varchar(100) NOT NULL DEFAULT 'hotspot',
  `mac` varchar(80) DEFAULT NULL,
  `ip` varchar(80) DEFAULT NULL,
  `login_url` text DEFAULT NULL,
  `dst` text DEFAULT NULL,
  `package_key` varchar(30) NOT NULL,
  `package_label` varchar(100) DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `profile` varchar(80) NOT NULL,
  `days` int(11) NOT NULL DEFAULT 0,
  `status` varchar(30) NOT NULL DEFAULT 'created',
  `payment_id` varchar(160) DEFAULT NULL,
  `trx_id` varchar(120) DEFAULT NULL,
  `token` varchar(80) DEFAULT NULL,
  `raw_response` mediumtext DEFAULT NULL,
  `error_message` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `paid_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `hotspot_payment_transactions`
--

INSERT INTO `hotspot_payment_transactions` (`id`, `invoice`, `username`, `mac`, `ip`, `login_url`, `dst`, `package_key`, `package_label`, `amount`, `profile`, `days`, `status`, `payment_id`, `trx_id`, `token`, `raw_response`, `error_message`, `created_at`, `paid_at`) VALUES
(17, 'HS2605051303074552', 'hotspot', '42:91:4B:DD:B5:88', '10.5.50.34', 'http://hotspot.wifiapp.net/login', '', '1day', '1-Day', 14.00, '1', 1, 'paid', 'TR0011xYpMbmE1777986188414', 'DE50TYISUG', 'DE50TYISUG', '{\"paymentID\":\"TR0011xYpMbmE1777986188414\",\"trxID\":\"DE50TYISUG\",\"transactionStatus\":\"Completed\",\"amount\":\"14.00\",\"currency\":\"BDT\",\"intent\":\"sale\",\"paymentExecuteTime\":\"2026-05-05T19:03:35:162 GMT+0600\",\"merchantInvoiceNumber\":\"HS2605051303074552\",\"payerType\":\"Customer\",\"payerReference\":\"hotspot-HS2605051303074552\",\"customerMsisdn\":\"01711901209\",\"payerAccount\":\"01711901209\",\"maxRefundableAmount\":\"14.00\",\"statusCode\":\"0000\",\"statusMessage\":\"Successful\",\"_http_code\":200}', NULL, '2026-05-05 19:03:07', '2026-05-05 19:03:38'),
(18, 'HS2605051926104592', 'hotspot', 'D8:93:D4:EC:A1:87', '10.5.50.215', 'http://hotspot.wifiapp.net/login', '', '1day', '1-Day', 14.00, '1', 1, 'paid', 'TR0011bCZ4P1N1777987571693', 'DE51TZVYL1', 'DE51TZVYL1', '{\"paymentID\":\"TR0011bCZ4P1N1777987571693\",\"trxID\":\"DE51TZVYL1\",\"transactionStatus\":\"Completed\",\"amount\":\"14.00\",\"currency\":\"BDT\",\"intent\":\"sale\",\"paymentExecuteTime\":\"2026-05-05T19:26:42:155 GMT+0600\",\"merchantInvoiceNumber\":\"HS2605051926104592\",\"payerType\":\"Customer\",\"payerReference\":\"hotspot-HS2605051926104592\",\"customerMsisdn\":\"01711901209\",\"payerAccount\":\"01711901209\",\"maxRefundableAmount\":\"14.00\",\"statusCode\":\"0000\",\"statusMessage\":\"Successful\",\"_http_code\":200}', NULL, '2026-05-05 19:26:10', '2026-05-05 19:26:44');

-- --------------------------------------------------------

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` int(11) NOT NULL,
  `username` varchar(100) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `method` varchar(20) NOT NULL,
  `payment_id` varchar(100) NOT NULL,
  `trx_id` varchar(100) DEFAULT NULL,
  `status` varchar(20) DEFAULT 'pending',
  `raw_data` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(100) NOT NULL,
  `balance` decimal(10,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `balance_log`
--
ALTER TABLE `balance_log`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `hotspot_payment_transactions`
--
ALTER TABLE `hotspot_payment_transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_invoice` (`invoice`),
  ADD UNIQUE KEY `uniq_payment_id` (`payment_id`),
  ADD UNIQUE KEY `uniq_trx_id` (`trx_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_mac` (`mac`),
  ADD KEY `idx_created_at` (`created_at`);

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `payment_id_unique` (`payment_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `balance_log`
--
ALTER TABLE `balance_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `hotspot_payment_transactions`
--
ALTER TABLE `hotspot_payment_transactions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
