- log digiflazz supplier
This commit is contained in:
parent
62593684f6
commit
e7e3e09d88
|
@ -1,5 +1,5 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import md5 from 'md5-hash';
|
import cryptoMd5 from "crypto";
|
||||||
|
|
||||||
const irs_url = 'http://h2h.elangpixiu.com/api/h2h';
|
const irs_url = 'http://h2h.elangpixiu.com/api/h2h';
|
||||||
const irs_id = 'PT0005';
|
const irs_id = 'PT0005';
|
||||||
|
@ -32,6 +32,7 @@ export const doTransaction = async (
|
||||||
} else if (supplier.code == 'Digiflazz') {
|
} else if (supplier.code == 'Digiflazz') {
|
||||||
if (typePaid == 'INQUIRY') {
|
if (typePaid == 'INQUIRY') {
|
||||||
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
|
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
|
||||||
|
const cryptoMd5 = require('crypto');
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
@ -42,7 +43,7 @@ export const doTransaction = async (
|
||||||
customer_no: `${destination}`,
|
customer_no: `${destination}`,
|
||||||
buyer_sku_code: `${productCode}`,
|
buyer_sku_code: `${productCode}`,
|
||||||
ref_id: `${idtrx}`,
|
ref_id: `${idtrx}`,
|
||||||
sign: md5(md5HashDigiflazz),
|
sign: cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString(),
|
||||||
testing: true,
|
testing: true,
|
||||||
};
|
};
|
||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
|
@ -54,6 +55,7 @@ export const doTransaction = async (
|
||||||
return res.data;
|
return res.data;
|
||||||
} else if (typePaid == 'PAYMENT') {
|
} else if (typePaid == 'PAYMENT') {
|
||||||
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
|
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
|
||||||
|
const cryptoMd5 = require('crypto');
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
@ -64,7 +66,7 @@ export const doTransaction = async (
|
||||||
customer_no: `${destination}`,
|
customer_no: `${destination}`,
|
||||||
buyer_sku_code: `${productCode}`,
|
buyer_sku_code: `${productCode}`,
|
||||||
ref_id: `${billTrxId}`,
|
ref_id: `${billTrxId}`,
|
||||||
sign: md5(md5HashDigiflazz),
|
sign: cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString(),
|
||||||
testing: true,
|
testing: true,
|
||||||
};
|
};
|
||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
|
@ -76,7 +78,9 @@ export const doTransaction = async (
|
||||||
return res.data;
|
return res.data;
|
||||||
} else {
|
} else {
|
||||||
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
|
const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`;
|
||||||
|
const cryptoMd5 = require('crypto');
|
||||||
console.log('hashmd5', md5HashDigiflazz);
|
console.log('hashmd5', md5HashDigiflazz);
|
||||||
|
console.log('hashmd52', cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString());
|
||||||
const options = {
|
const options = {
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: {'Content-Type': 'application/json'},
|
||||||
};
|
};
|
||||||
|
@ -85,7 +89,7 @@ export const doTransaction = async (
|
||||||
customer_no: `${destination}`,
|
customer_no: `${destination}`,
|
||||||
buyer_sku_code: `${productCode}`,
|
buyer_sku_code: `${productCode}`,
|
||||||
ref_id: `${idtrx}`,
|
ref_id: `${idtrx}`,
|
||||||
sign: md5(md5HashDigiflazz),
|
sign: cryptoMd5.createHash('md5').update(md5HashDigiflazz).digest('hex').toString(),
|
||||||
testing: true,
|
testing: true,
|
||||||
};
|
};
|
||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user