@agung96tm/adonis-midtrans
Version:
Midtrans Payment Gateway for Adonis Framework
22 lines (21 loc) • 724 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const midtrans_node_client_1 = require("midtrans-node-client");
class MidtransProvider {
constructor(app) {
this.app = app;
}
async register() {
this.app.container.singleton("Agung96tm/Midtrans", () => {
const { isProduction, serverKey, clientKey } = this.app.container
.use("Adonis/Core/Config")
.get("midtrans");
return new midtrans_node_client_1.MidtransClient.Snap({
isProduction: isProduction,
serverKey: serverKey,
clientKey: clientKey,
});
});
}
}
exports.default = MidtransProvider;