๐ฎ๐ฉ Bahasa Indonesia | ๐ฌ๐ง English
Contoh Discord bot yang menggunakan mutasiku-sdk untuk payment.
- Tombol payment dengan QRIS di Discord
- Webhook untuk notifikasi payment
- Lihat akun dan transaksi (admin only)
npm install
cp .env.example .env
# Edit .env dengan credentials AndaDISCORD_TOKEN=your-discord-bot-token
ADMIN_ROLE_ID=your-admin-role-id
MUTASIKU_API_KEY=your-api-key
MUTASIKU_WEBHOOK_SECRET=your-webhook-secret
MUTASIKU_WALLET_ID=your-wallet-account-id
WEBHOOK_PORT=3000# Development
npm run dev
# Production
npm run build && npm start| Command | Deskripsi | Permission |
|---|---|---|
!pay |
Tampilkan tombol payment | Everyone |
!accounts |
Lihat connected accounts | Admin Role |
!transactions |
Transaksi terbaru | Admin Role |
- User ketik
!pay - Bot tampilkan tombol jumlah payment
- User klik tombol โ Bot create QRIS payment via SDK
- QRIS code tampil di Discord
- User scan & bayar
- Webhook notify bot โ User dapat DM konfirmasi
import MutasikuSDK from 'mutasiku-sdk';
const mutasiku = new MutasikuSDK({
apiKey: 'your-api-key'
});
// Create QRIS payment
const payment = await mutasiku.createPayment({
type: 'QRIS-DYNAMIC',
walletAccountId: 'wallet-id',
amount: 50000,
externalId: 'order-123',
customerName: 'John'
});
// Get accounts
const accounts = await mutasiku.getAccounts();
// Get transactions
const transactions = await mutasiku.getMutasi({ days: 7 });
// Check payment status
const status = await mutasiku.getPaymentStatus('payment-id');payment.completed
{
"type": "payment.completed",
"data": {
"id": "payment-id",
"amount": 50000,
"status": "PAID"
}
}payment.expired
{
"type": "payment.expired",
"data": {
"id": "payment-id",
"amount": 50000,
"status": "EXPIRED"
}
}MIT License
Copyright (c) 2026 PT. Cobra Code Indonesia
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Example Discord bot using mutasiku-sdk for payments.
- Payment buttons with QRIS displayed in Discord
- Webhook handling for payment notifications
- Account and transaction viewing (admin only)
npm install
cp .env.example .env
# Edit .env with your credentialsDISCORD_TOKEN=your-discord-bot-token
ADMIN_ROLE_ID=your-admin-role-id
MUTASIKU_API_KEY=your-api-key
MUTASIKU_WEBHOOK_SECRET=your-webhook-secret
MUTASIKU_WALLET_ID=your-wallet-account-id
WEBHOOK_PORT=3000# Development
npm run dev
# Production
npm run build && npm start| Command | Description | Permission |
|---|---|---|
!pay |
Show payment buttons | Everyone |
!accounts |
View connected accounts | Admin Role |
!transactions |
Recent transactions | Admin Role |
- User types
!pay - Bot shows payment amount buttons
- User clicks button โ Bot creates QRIS payment via SDK
- QRIS code displayed in Discord
- User scans & pays
- Webhook notifies bot โ User gets DM confirmation
import MutasikuSDK from 'mutasiku-sdk';
const mutasiku = new MutasikuSDK({
apiKey: 'your-api-key'
});
// Create QRIS payment
const payment = await mutasiku.createPayment({
type: 'QRIS-DYNAMIC',
walletAccountId: 'wallet-id',
amount: 50000,
externalId: 'order-123',
customerName: 'John'
});
// Get accounts
const accounts = await mutasiku.getAccounts();
// Get transactions
const transactions = await mutasiku.getMutasi({ days: 7 });
// Check payment status
const status = await mutasiku.getPaymentStatus('payment-id');payment.completed
{
"type": "payment.completed",
"data": {
"id": "payment-id",
"amount": 50000,
"status": "PAID"
}
}payment.expired
{
"type": "payment.expired",
"data": {
"id": "payment-id",
"amount": 50000,
"status": "EXPIRED"
}
}MIT License
Copyright (c) 2026 PT. Cobra Code Indonesia
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.