feat: Remove console logs from Mandiri payment processing functions

This commit is contained in:
faisolavolut 2025-10-24 10:58:12 +07:00
parent e76b1426c1
commit b26494d147
6 changed files with 2 additions and 19 deletions

View File

@ -112,7 +112,6 @@ export async function createSignature({
pattern: string; pattern: string;
passphrase?: string; passphrase?: string;
}) { }) {
console.log(data);
if (data?.accesstoken) { if (data?.accesstoken) {
const session = await db.sessions.findFirst({ const session = await db.sessions.findFirst({
where: { token_hash: hashToken(data.accesstoken) }, where: { token_hash: hashToken(data.accesstoken) },

View File

@ -21,10 +21,7 @@ export default async function ({ data }: { data: any }) {
Private_Key: getParameter(user, "private_key") || "", Private_Key: getParameter(user, "private_key") || "",
}; };
const mandiriUrl = String(get(user, "endpoint") || process.env.PAYMENT_URL); const mandiriUrl = String(get(user, "endpoint") || process.env.PAYMENT_URL);
console.log({
headers,
url: `${mandiriUrl}/api/v1.0/utilities/signature-auth`,
});
const resp = await axios.post( const resp = await axios.post(
`${mandiriUrl}/api/v1.0/utilities/signature-auth`, `${mandiriUrl}/api/v1.0/utilities/signature-auth`,
{}, {},

View File

@ -40,11 +40,6 @@ export default async function ({
AccessToken: accessToken, AccessToken: accessToken,
}; };
const mandiriUrl = String(get(user, "endpoint") || process.env.PAYMENT_URL); const mandiriUrl = String(get(user, "endpoint") || process.env.PAYMENT_URL);
console.log({
url: `${mandiriUrl}/api/v1.0/utilities/signature-service`,
headers,
body: { ...get(data, "body", {}) },
});
const resp = await axios.post( const resp = await axios.post(
`${mandiriUrl}/api/v1.0/utilities/signature-service`, `${mandiriUrl}/api/v1.0/utilities/signature-service`,
{ ...get(data, "body", {}) }, { ...get(data, "body", {}) },

View File

@ -21,7 +21,6 @@ export default async function ({
session: any; session: any;
data: any; data: any;
}) { }) {
console.log(user);
// sample implementation — adapt to real bank payload and API calls // sample implementation — adapt to real bank payload and API calls
const { invoiceId } = data || {}; const { invoiceId } = data || {};
if (!user.database) throw new Error("User database information is missing"); if (!user.database) throw new Error("User database information is missing");

View File

@ -45,9 +45,7 @@ export default async function ({
.replace("{accesstoken}", get(data, "accesstoken")) .replace("{accesstoken}", get(data, "accesstoken"))
.replace("{requestbody}", hashBody) .replace("{requestbody}", hashBody)
.replace("{timestamp}", get(data, "timestamp")); .replace("{timestamp}", get(data, "timestamp"));
console.log(stringToSign);
const pathPublicKey = user.public_key_file; const pathPublicKey = user.public_key_file;
console.log(user);
if (!pathPublicKey) { if (!pathPublicKey) {
throw new Error("No public key file associated with the user"); throw new Error("No public key file associated with the user");
} }
@ -63,11 +61,7 @@ export default async function ({
throw new Error("Public key file not found"); throw new Error("Public key file not found");
} }
const cerPem = readCertAsPEM(fullPath); const cerPem = readCertAsPEM(fullPath);
console.log({
stringToVerify: stringToSign,
signatureBase64: get(data, "signature"),
certPem: cerPem,
});
const result = verifyRsaSignature({ const result = verifyRsaSignature({
stringToVerify: stringToSign, stringToVerify: stringToSign,
signatureBase64: get(data, "signature"), signatureBase64: get(data, "signature"),

View File

@ -44,7 +44,6 @@ export async function vaMiddleware(
typeVerify: "transaction", typeVerify: "transaction",
}, },
}); });
console.log({ result });
if (!result) { if (!result) {
return res.status(401).json({ return res.status(401).json({
responseCode: "4012400", responseCode: "4012400",