- fix check-bill for si hemat
This commit is contained in:
parent
5f8212e5c5
commit
634f7946e5
|
@ -589,16 +589,29 @@ export class TransactionService {
|
|||
})
|
||||
.join('');
|
||||
|
||||
const hitLoginHemat = await doAuthorizeHemat('wndpt001', '3NHESIJ5', supplier);
|
||||
let hitLoginHemat;
|
||||
|
||||
if (supplier.code == 'Hemat') {
|
||||
hitLoginHemat = await doAuthorizeHemat('wndpt001', '3NHESIJ5', supplier);
|
||||
}
|
||||
|
||||
let hitSupplier = supplier.code == 'Hemat' ?
|
||||
await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||
) : await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
"",
|
||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||
);
|
||||
|
||||
let hitSupplier = await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||
);
|
||||
// let hitSupplier;
|
||||
|
||||
console.log('iniresponsupplierharga', hitSupplier)
|
||||
|
@ -623,7 +636,7 @@ export class TransactionService {
|
|||
if (orderTransactionDto.bill_trx_id !== null) {
|
||||
hitSupplier.harga = product_price.price;
|
||||
}
|
||||
} else if (supplier.code == 'hemat') {
|
||||
} else if (supplier.code == 'Hemat') {
|
||||
const newHitSupplier = {
|
||||
success: hitSupplier.success,
|
||||
harga: product_price.price,
|
||||
|
@ -823,16 +836,28 @@ export class TransactionService {
|
|||
})
|
||||
.join('');
|
||||
|
||||
const hitLoginHemat = await doAuthorizeHemat('wndpt001', '3NHESIJ5', supplier);
|
||||
let hitLoginHemat;
|
||||
|
||||
let hitSupplier = await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
product
|
||||
);
|
||||
if (supplier.code == 'Hemat') {
|
||||
hitLoginHemat = await doAuthorizeHemat('wndpt001', '3NHESIJ5', supplier);
|
||||
}
|
||||
|
||||
let hitSupplier = supplier.code == 'Hemat' ?
|
||||
await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||
) : await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
"",
|
||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||
);
|
||||
|
||||
if (supplier.code != 'IRS') {
|
||||
const parsingResponse = hitSupplier.split(' ');
|
||||
|
@ -966,23 +991,41 @@ export class TransactionService {
|
|||
let status;
|
||||
|
||||
try {
|
||||
const hitLoginHemat = await doAuthorizeHemat('wndpt001', '3NHESIJ5', supplier);
|
||||
|
||||
let hitSupplier = await doTransaction(
|
||||
`CEK${orderTransactionDto.productCode.slice(3)}`,
|
||||
let hitLoginHemat;
|
||||
|
||||
if (supplier.code == 'Hemat') {
|
||||
hitLoginHemat = await doAuthorizeHemat('wndpt001', '3NHESIJ5', supplier);
|
||||
}
|
||||
|
||||
let hitSupplier = supplier.code == 'Hemat' ? await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
'INQUIRY'
|
||||
) : await doTransaction(
|
||||
`CEK${orderTransactionDto.productCode.slice(3)}`,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
"",
|
||||
'INQUIRY'
|
||||
);
|
||||
const parsingResponse = hitSupplier.split(' ');
|
||||
|
||||
hitSupplier = {
|
||||
success: hitSupplier.includes('diproses'),
|
||||
msg: hitSupplier,
|
||||
};
|
||||
|
||||
if (supplier.code == 'Hemat') {
|
||||
hitSupplier = {
|
||||
success: hitSupplier.success == true,
|
||||
msg: hitSupplier.msg,
|
||||
};
|
||||
} else {
|
||||
hitSupplier = {
|
||||
success: hitSupplier.includes('diproses'),
|
||||
msg: hitSupplier,
|
||||
};
|
||||
}
|
||||
if (!hitSupplier.success) {
|
||||
status = statusTransaction[statusTransaction.FAILED];
|
||||
throw new HttpException(
|
||||
|
|
Loading…
Reference in New Issue
Block a user