feat: Remove console logs from Mandiri payment processing functions
This commit is contained in:
parent
e76b1426c1
commit
b26494d147
|
|
@ -112,7 +112,6 @@ export async function createSignature({
|
|||
pattern: string;
|
||||
passphrase?: string;
|
||||
}) {
|
||||
console.log(data);
|
||||
if (data?.accesstoken) {
|
||||
const session = await db.sessions.findFirst({
|
||||
where: { token_hash: hashToken(data.accesstoken) },
|
||||
|
|
|
|||
|
|
@ -21,10 +21,7 @@ export default async function ({ data }: { data: any }) {
|
|||
Private_Key: getParameter(user, "private_key") || "",
|
||||
};
|
||||
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(
|
||||
`${mandiriUrl}/api/v1.0/utilities/signature-auth`,
|
||||
{},
|
||||
|
|
|
|||
|
|
@ -40,11 +40,6 @@ export default async function ({
|
|||
AccessToken: accessToken,
|
||||
};
|
||||
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(
|
||||
`${mandiriUrl}/api/v1.0/utilities/signature-service`,
|
||||
{ ...get(data, "body", {}) },
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ export default async function ({
|
|||
session: any;
|
||||
data: any;
|
||||
}) {
|
||||
console.log(user);
|
||||
// sample implementation — adapt to real bank payload and API calls
|
||||
const { invoiceId } = data || {};
|
||||
if (!user.database) throw new Error("User database information is missing");
|
||||
|
|
|
|||
|
|
@ -45,9 +45,7 @@ export default async function ({
|
|||
.replace("{accesstoken}", get(data, "accesstoken"))
|
||||
.replace("{requestbody}", hashBody)
|
||||
.replace("{timestamp}", get(data, "timestamp"));
|
||||
console.log(stringToSign);
|
||||
const pathPublicKey = user.public_key_file;
|
||||
console.log(user);
|
||||
if (!pathPublicKey) {
|
||||
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");
|
||||
}
|
||||
const cerPem = readCertAsPEM(fullPath);
|
||||
console.log({
|
||||
stringToVerify: stringToSign,
|
||||
signatureBase64: get(data, "signature"),
|
||||
certPem: cerPem,
|
||||
});
|
||||
|
||||
const result = verifyRsaSignature({
|
||||
stringToVerify: stringToSign,
|
||||
signatureBase64: get(data, "signature"),
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ export async function vaMiddleware(
|
|||
typeVerify: "transaction",
|
||||
},
|
||||
});
|
||||
console.log({ result });
|
||||
if (!result) {
|
||||
return res.status(401).json({
|
||||
responseCode: "4012400",
|
||||
|
|
|
|||
Loading…
Reference in New Issue