melody191-fetcher
v1.0.6
Published
TrueMoney Wallet voucher redemption library for Node.js
Maintainers
Readme
melody191-fetcher
Package สำหรับรับซองอั่งเปา TrueMoney Wallet ผ่าน Node.js
📦 Installation
npm install melody191-fetcher🚀 Usage
const { Melodyshop_Voucher } = require('melody191-fetcher');
async function redeemVoucher() {
const result = await Melodyshop_Voucher(
'https://gift.truemoney.com/campaign/?v=XXXXXXXX',
'0812345678'
);
if (result.ok === 'success') {
console.log('✅ รับซองสำเร็จ!');
console.log('💰 จำนวนเงิน:', result.amount, 'บาท');
console.log('👤 เจ้าของซอง:', result.name_owner);
console.log('📱 เบอร์ผู้รับ:', result.my_phone);
} else {
console.log('❌ เกิดข้อผิดพลาด:', result.mes_err);
console.log('Error Code:', result.errorData);
}
}
redeemVoucher();📋 Response Format
Success Response
{
ok: 'success',
message: 'ได้รับเงินจากซองอั่งเปาแล้วจำนวน 50',
amount: '50',
name_owner: 'ชื่อเจ้าของซอง',
my_phone: '0812345678',
code: 'https://gift.truemoney.com/campaign/?v=XXXXXXXX'
}Error Response
{
errorData: 1001,
mes_err: 'ไม่พบเบอร์นี้ในระบบ'
}🔢 Error Codes
| Code | ความหมาย | |------|----------| | 1000 | รับซองตัวเองไม่ได้ | | 1001 | ไม่พบเบอร์นี้ในระบบ | | 1002 | ไม่พบซองอั่งเปาในระบบ | | 1003 | ซองวอเลทนี้หมดอายุแล้ว | | 1004 | มีคนรับซองอั่งเปาไปแล้ว | | 1005 | ไม่พบซองนี้ในระบบ หรือ URL ผิด | | 1006 | เบอร์โทรศัพท์ผู้รับเงินไม่ถูกต้อง | | -1 | เกิดข้อผิดพลาดที่ไม่รู้จัก |
⚙️ Requirements
- Node.js >= 14.0.0
- NPM Dependencies:
axios
⚠️ Disclaimer
- Package นี้สร้างขึ้นเพื่อการศึกษาเท่านั้น
- การใช้งานอาจขัดต่อข้อกำหนดของ TrueMoney
- ผู้พัฒนาไม่รับผิดชอบต่อความเสียหายใดๆ
- ควรใช้เฉพาะกับซองที่ได้รับอย่างถูกต้องเท่านั้น
📄 License
MIT
👨💻 Author
Melody191
