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