first commit

This commit is contained in:
2026-02-18 16:03:43 +07:00
commit c52ecd6514
54 changed files with 8270 additions and 0 deletions

22
app/config/midtrans.js Normal file
View File

@@ -0,0 +1,22 @@
const midtransClient = require('midtrans-client');
require('dotenv').config();
class MidtransConfig {
static getSnapClient() {
return new midtransClient.Snap({
isProduction: process.env.MIDTRANS_IS_PRODUCTION === 'true',
serverKey: process.env.MIDTRANS_SERVER_KEY,
clientKey: process.env.MIDTRANS_CLIENT_KEY
});
}
static getCoreApiClient() {
return new midtransClient.CoreApi({
isProduction: process.env.MIDTRANS_IS_PRODUCTION === 'true',
serverKey: process.env.MIDTRANS_SERVER_KEY,
clientKey: process.env.MIDTRANS_CLIENT_KEY
});
}
}
module.exports = MidtransConfig;