- push digiflazz supplier add md5 lib

This commit is contained in:
Fadli
2023-03-01 01:33:22 +07:00
parent b1c2afe555
commit 4ce15f7499
4 changed files with 23 additions and 7 deletions

View File

@@ -1,5 +1,4 @@
import axios from 'axios';
import cryptoMd5 from "crypto";
const irs_url = 'http://h2h.elangpixiu.com/api/h2h';
const irs_id = 'PT0005';
@@ -32,7 +31,7 @@ export const doTransaction = async (
} else if (supplier.code == 'Digiflazz') {
if (typePaid == 'INQUIRY') {
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
var md5Hash = require("md5-hash");
const md5Hash = require("blueimp-md5");
const options = {
headers: { 'Content-Type': 'application/json' },
@@ -43,7 +42,7 @@ export const doTransaction = async (
customer_no: `${destination}`,
buyer_sku_code: `${productCode}`,
ref_id: `${idtrx}`,
sign: md5Hash.default(`${supplier.irs_user}${supplier.irs_pass}${idtrx}`),
sign: md5Hash(md5HashDigiflazz),
testing: true,
};
const res = await axios.post(
@@ -55,7 +54,7 @@ export const doTransaction = async (
return res.data;
} else if (typePaid == 'PAYMENT') {
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
var md5Hash = require("md5-hash");
const md5Hash = require("blueimp-md5");
const options = {
headers: { 'Content-Type': 'application/json' },
@@ -66,7 +65,7 @@ export const doTransaction = async (
customer_no: `${destination}`,
buyer_sku_code: `${productCode}`,
ref_id: `${billTrxId}`,
sign: md5Hash.default(`${supplier.irs_user}${supplier.irs_pass}${idtrx}`),
sign: md5Hash(md5HashDigiflazz),
testing: true,
};
const res = await axios.post(
@@ -78,7 +77,7 @@ export const doTransaction = async (
return res.data;
} else {
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
var md5Hash = require("md5-hash");
const md5Hash = require("blueimp-md5");
console.log('testmd5', md5HashDigiflazz);
const options = {
headers: {'Content-Type': 'application/json'},
@@ -88,7 +87,7 @@ export const doTransaction = async (
customer_no: `${destination}`,
buyer_sku_code: `${productCode}`,
ref_id: `${idtrx}`,
sign: md5Hash.default(md5HashDigiflazz),
sign: md5Hash(md5HashDigiflazz),
testing: true,
};
const res = await axios.post(