first commit
This commit is contained in:
22
app/config/midtrans.js
Normal file
22
app/config/midtrans.js
Normal 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;
|
||||
Reference in New Issue
Block a user