From fe2b6aa264c3b9ccff51eeede47aa9ea4219aefb Mon Sep 17 00:00:00 2001 From: Fadli Date: Tue, 28 Feb 2023 15:13:31 +0700 Subject: [PATCH] - log digiflazz supplier --- src/helper/irs-api.ts | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index 03b1cc1..0aa20a7 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -77,6 +77,31 @@ export const doTransaction = async ( return res.data; } else { + // const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; + // var md5Hash = require("md5-hash"); + // console.log('testmd5', md5HashDigiflazz); + // console.log('hashmd5', md5Hash.default("String")); + // const options = { + // headers: {'Content-Type': 'application/json'}, + // }; + // const data = { + // username: supplier.irs_user, + // customer_no: `${destination}`, + // buyer_sku_code: `${productCode}`, + // ref_id: `${idtrx}`, + // sign: md5Hash.default(`${supplier.irs_user}${supplier.irs_pass}${idtrx}`), + // testing: true, + // }; + // const res = await axios.post( + // `${supplier.url}/transaction`, + // data, + // options, + // ); + // + // console.log('resdigiflazz', res); + // return res.data; + + const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; var md5Hash = require("md5-hash"); console.log('testmd5', md5HashDigiflazz); @@ -85,15 +110,12 @@ export const doTransaction = async ( headers: {'Content-Type': 'application/json'}, }; const data = { + cmd: 'deposit', username: supplier.irs_user, - customer_no: `${destination}`, - buyer_sku_code: `${productCode}`, - ref_id: `${idtrx}`, - sign: md5Hash.default(`${supplier.irs_user}${supplier.irs_pass}${idtrx}`), - testing: true, + sign: md5Hash.default(`${supplier.irs_user}${supplier.irs_pass}depo`), }; const res = await axios.post( - `${supplier.url}/transaction`, + `${supplier.url}/cek-saldo`, data, options, );