Devil HunterDevil Docs
Payment In Game

ช่องทางเติมเงิน

ตั้งค่าช่องทางเติมเงินทั้งหมด (config_topup.lua)

ไฟล์ config_topup.lua รวมการตั้งค่าทุกช่องทางเติมเงินและตารางเวลาเปิด-ปิดให้บริการ

ข้อมูลบัญชี

config_topup.lua
Config_Topup.bankInfo = {
    bankName = "พร้อมเพย์",
    accountName = "ชื่อบัญชีผู้รับเงิน"
}

ข้อมูลนี้จะแสดงในหน้า UI ให้ผู้เล่นเห็น

ช่องทางเติมเงินที่รองรับ

ระบบรองรับช่องทางเติมเงิน 7 ช่องทาง สามารถเปิด-ปิดแต่ละช่องทางได้อิสระ

1. Discord Upload

ผู้เล่นอัปโหลดสลิปผ่าน UI แล้วระบบส่งต่อไปยัง Discord/API

config_topup.lua
discordUpload = {
    enabled = true,
    apiUrl = "http://localhost:30000",

    schedule = {
        enabled = false,                  -- true = เปิดตามตารางเวลา
        times = {
            { startTime = "00:00", endTime = "23:59" },
        },
        closedMessage = "ข้อความแจ้งเมื่อปิด",
    }
}

2. Auto Slip Verification

ตรวจสลิปอัตโนมัติจาก Thunder API แล้วเติม Point ให้ผู้เล่นทันที

config_topup.lua
autoVerify = {
    enabled = true,
    apiUrl = "http://localhost:30000",
    allowClientVerifiedSlip = false,    -- ค่า false = ปลอดภัย ไม่รับข้อมูลที่ client ยืนยันเอง

    receiverName = {
        th = "ชื่อภาษาไทยที่คาดหวัง",
        en = "ชื่อภาษาอังกฤษที่คาดหวัง",
    },

    exchangeRate = 1,                   -- 1 บาท = 1 Point
    autoAddPoints = true,               -- เติม Point อัตโนมัติเมื่อสลิปผ่าน

    minSlipDate = "",                   -- จำกัดสลิปตั้งแต่วันที่ (YYYY-MM-DD) | "" = ไม่จำกัด
    slipMaxAgeMinutes = 15,             -- อายุสลิปสูงสุด (นาที) | 0 = ไม่จำกัด

    preventDuplicate = true,            -- ป้องกันสลิปซ้ำ
    saveToHistory = true,               -- บันทึกประวัติ
    notifyAdmin = true,                 -- แจ้งแอดมิน
    notifyPlayer = true,                -- แจ้งผู้เล่น
}

การตั้งค่า Thunder API

ใส่ในไฟล์ devil_marketaddons/.env:

.env
THUNDER_API_URL=https://api.thunder.in.th/v2/verify/bank
THUNDER_API_KEY=thunder_live_xxxxx

3. Mobile Upload Session

ผู้เล่นสร้าง session ในเกม แล้วใช้มือถือสแกน QR เพื่ออัปโหลดสลิปผ่านเว็บ

config_topup.lua
mobileUpload = {
    enabled = true,
    minAmount = 10,
    maxAmount = 100000,

    pollingInterval = 3000,             -- ความถี่เช็คสถานะ (milliseconds)
    sessionTimeout = 900000,            -- อายุ session 15 นาที (milliseconds)

    apiUrl = "http://localhost:30000",
    instructionText = "1. กดเริ่มรายการ\n2. สแกน QR เพื่อชำระเงิน\n3. ส่งสลิปผ่านมือถือ\n4. รอผลตรวจสอบ",
}

4. PromptPay (Stripe)

สร้าง QR ผ่าน Stripe API ระบบ poll สถานะอัตโนมัติ เติม Point เมื่อจ่ายสำเร็จ ไม่ต้องส่งสลิป

config_topup.lua
promptPay = {
    enabled = true,
    minAmount = 10,
    maxAmount = 100000,
    exchangeRate = 1,

    pollingInterval = 3000,
    sessionTimeout = 900000,

    autoAddPoints = true,
    saveToHistory = true,
    notifyPlayer = true,

    apiUrl = "http://localhost:30000",
}

ตั้งค่า Stripe Key

ใส่ใน devil_marketaddons/.env:

.env
STRIPE_SECRET_KEY=sk_test_xxxxx

ใช้ sk_test_xxxxx สำหรับทดสอบ หรือ sk_live_xxxxx สำหรับ production

5. PromptPay QR (Static)

สร้าง QR รูปธรรมดาจากหมายเลข PromptPay ผู้เล่นต้องอัปโหลดสลิปยืนยันเอง

config_topup.lua
promptPayQR = {
    enabled = true,
    replaceDiscord = true,              -- true = ใช้แทน Discord Upload
    replaceAutoVerify = true,           -- true = ใช้แทน Auto Verify

    minAmount = 10,
    maxAmount = 100000,
    exchangeRate = 1,

    apiUrl = "http://localhost:30000",
    instructionText = "1. กรอกจำนวนเงิน\n2. สแกน QR\n3. โอนเงิน\n4. อัปโหลดสลิป",
}

6. TrueMoney Gift Voucher (ซองอั่งเปา)

config_topup.lua
twVoucher = {
    enabled = true,
    exchangeRate = 1,
    apiUrl = "http://localhost:30000",
    phoneNumber = "0812345678",         -- เบอร์ที่ใช้รับซอง

    schedule = {
        enabled = true,
        times = {
            { startTime = "22:45", endTime = "19:59" },  -- รองรับข้ามวัน
        },
        closedMessage = "ระบบปิดให้บริการชั่วคราว",
    }
}

7. PromptPay (TMWeasyAPI)

สร้าง QR ผ่าน TMWeasyAPI ระบบ poll สถานะอัตโนมัติ

config_topup.lua
tmweasyapi = {
    enabled = true,
    minAmount = 1,
    maxAmount = 100000,
    exchangeRate = 1,

    pollingInterval = 5000,
    sessionTimeout = 900000,

    autoAddPoints = true,
    saveToHistory = true,
    notifyPlayer = true,
    allowCancel = false,

    apiUrl = "http://localhost:30000",
    tabLabel = "TMWeasyAPI",
    tabIcon = "qrcode",
    description = "ชำระเงินผ่าน PromptPay (TMWeasyAPI)",
}

ตารางเวลาเปิด-ปิดบริการ

ทุกช่องทางรองรับตารางเวลาเปิด-ปิด:

config_topup.lua
schedule = {
    enabled = true,
    times = {
        {
            startTime = "09:00",
            endTime = "18:00",
            days = {2, 3, 4, 5, 6}     -- จันทร์-ศุกร์
        },
        {
            startTime = "10:00",
            endTime = "16:00",
            days = {1, 7}              -- อาทิตย์, เสาร์
        }
    },
    closedMessage = "ระบบปิดให้บริการชั่วคราว"
}

ค่า days: 1=อาทิตย์, 2=จันทร์, 3=อังคาร, 4=พุธ, 5=พฤหัส, 6=ศุกร์, 7=เสาร์

หากไม่ระบุ days ระบบจะเปิดทุกวัน

ตัวอย่างการตั้งค่าตามสถานการณ์

เปิดให้บริการตลอด 24 ชั่วโมง

config_topup.lua
schedule = {
    enabled = true,
    times = {
        { startTime = "00:00", endTime = "23:59" }
    },
    closedMessage = "ปิดให้บริการชั่วคราว"
}

เปิดเฉพาะกลางคืน

config_topup.lua
schedule = {
    enabled = true,
    times = {
        { startTime = "20:00", endTime = "02:00" }  -- ข้ามเที่ยงคืนได้
    }
}

เปิดเฉพาะวันธรรมดา

config_topup.lua
schedule = {
    enabled = true,
    times = {
        {
            startTime = "09:00",
            endTime = "21:00",
            days = {2, 3, 4, 5, 6}
        }
    }
}

ปิดใช้งานตารางเวลา (เปิดตลอด)

config_topup.lua
schedule = {
    enabled = false,
    times = {},
    closedMessage = ""
}

On this page