- added digiflazz supplier

This commit is contained in:
Fadli
2023-02-22 20:48:34 +07:00
parent 5463d1b12b
commit cfb7d035f6
4 changed files with 28 additions and 12 deletions

View File

@@ -32,9 +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');
cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex');
var cryptoMd5 = require('md5');
const options = {
headers: { 'Content-Type': 'application/json' },
@@ -45,7 +43,7 @@ export const doTransaction = async (
customer_no: `${destination}`,
buyer_sku_code: `${productCode}`,
ref_id: `${idtrx}`,
sign: cryptoMd5,
sign: cryptoMd5(md5HashDigiflazz, 'hex'),
testing: true,
};
const res = await axios.post(
@@ -57,9 +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');
cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex');
var cryptoMd5 = require('md5');
const options = {
headers: { 'Content-Type': 'application/json' },
@@ -70,7 +66,7 @@ export const doTransaction = async (
customer_no: `${destination}`,
buyer_sku_code: `${productCode}`,
ref_id: `${billTrxId}`,
sign: cryptoMd5,
sign: cryptoMd5(md5HashDigiflazz, 'hex'),
testing: true,
};
const res = await axios.post(
@@ -82,9 +78,7 @@ export const doTransaction = async (
return res.data;
} else {
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
const cryptoMd5 = require('crypto');
cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex');
var cryptoMd5 = require('md5');
const options = {
headers: {'Content-Type': 'application/json'},
@@ -94,7 +88,7 @@ export const doTransaction = async (
customer_no: `${destination}`,
buyer_sku_code: `${productCode}`,
ref_id: `${idtrx}`,
sign: cryptoMd5,
sign: cryptoMd5(md5HashDigiflazz, 'hex'),
testing: true,
};
const res = await axios.post(
@@ -103,6 +97,7 @@ export const doTransaction = async (
options,
);
console.log('resdigiflazz', res);
return res.data;
}
} else if (supplier.code == 'Hemat') {