From 64ae88357f8997f6505391b2c83e23a0b0fa50fa Mon Sep 17 00:00:00 2001 From: Fadli Date: Wed, 22 Feb 2023 23:42:16 +0700 Subject: [PATCH] - log digiflazz supplier --- src/helper/irs-api.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index 2a8354f..17f40d4 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -32,7 +32,7 @@ export const doTransaction = async ( } else if (supplier.code == 'Digiflazz') { if (typePaid == 'INQUIRY') { const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; - const cryptoMd5 = require('crypto'); + var md5Hash = require("md5-hash"); const options = { headers: { 'Content-Type': 'application/json' }, @@ -43,7 +43,7 @@ export const doTransaction = async ( customer_no: `${destination}`, buyer_sku_code: `${productCode}`, ref_id: `${idtrx}`, - sign: cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString(), + sign: md5Hash.default(md5HashDigiflazz), testing: true, }; const res = await axios.post( @@ -55,7 +55,7 @@ export const doTransaction = async ( return res.data; } else if (typePaid == 'PAYMENT') { const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; - const cryptoMd5 = require('crypto'); + var md5Hash = require("md5-hash"); const options = { headers: { 'Content-Type': 'application/json' }, @@ -66,7 +66,7 @@ export const doTransaction = async ( customer_no: `${destination}`, buyer_sku_code: `${productCode}`, ref_id: `${billTrxId}`, - sign: cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString(), + sign: md5Hash.default(md5HashDigiflazz), testing: true, }; const res = await axios.post( @@ -78,9 +78,8 @@ export const doTransaction = async ( return res.data; } else { const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; - const cryptoMd5 = require('crypto'); + var md5Hash = require("md5-hash"); console.log('hashmd5', md5HashDigiflazz); - console.log('hashmd52', cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString()); const options = { headers: {'Content-Type': 'application/json'}, }; @@ -89,7 +88,7 @@ export const doTransaction = async ( customer_no: `${destination}`, buyer_sku_code: `${productCode}`, ref_id: `${idtrx}`, - sign: cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString(), + sign: md5Hash.default(md5HashDigiflazz), testing: true, }; const res = await axios.post(