fix: post api transaction hemat
This commit is contained in:
parent
7cd52a5998
commit
4cf1454c2c
|
@ -29,7 +29,7 @@ export const doTransaction = async (
|
|||
return res.data;
|
||||
} else if (supplier.code == 'Hemat') {
|
||||
const options = {
|
||||
headers: { Authorization: `${authorization}` },
|
||||
headers: { 'Authorization': `${authorization.data}` },
|
||||
};
|
||||
const data = {
|
||||
idtransaction: idtrx,
|
||||
|
@ -37,7 +37,13 @@ export const doTransaction = async (
|
|||
code: `${productCode}`,
|
||||
type: `${typePaid}`,
|
||||
};
|
||||
const res = await axios.post(`${supplier.url}/v1/transaction/request`, data, options);
|
||||
|
||||
console.log(authorization.data, 'alskdlas')
|
||||
console.log(supplier.url)
|
||||
console.log(data, 'allData')
|
||||
const res = await axios.post(`${supplier.url}/v1/transaction/request`, data, options).catch((err) => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
|
|
@ -589,20 +589,26 @@ export class TransactionService {
|
|||
})
|
||||
.join('');
|
||||
|
||||
console.log('sebelum authorize')
|
||||
|
||||
const hitLoginHemat =
|
||||
supplier.code == 'Hemat' ?
|
||||
await doAuthorizeHemat('wndpt001', '3NHESIJ5', supplier) :
|
||||
'';
|
||||
|
||||
console.log('setelah authorize')
|
||||
console.log(hitLoginHemat.data, 'data')
|
||||
|
||||
let hitSupplier = await doTransaction(
|
||||
orderTransactionDto.productCode,
|
||||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
hitLoginHemat,
|
||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||
);
|
||||
// let hitSupplier;
|
||||
|
||||
console.log('setelah hit')
|
||||
|
||||
if (supplier.code != 'IRS') {
|
||||
const parsingResponse = hitSupplier.split(' ');
|
||||
|
@ -814,7 +820,7 @@ export class TransactionService {
|
|||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
hitLoginHemat,
|
||||
product
|
||||
);
|
||||
|
||||
|
@ -960,7 +966,7 @@ export class TransactionService {
|
|||
orderTransactionDto.destination,
|
||||
trxId,
|
||||
supplier,
|
||||
hitLoginHemat.data,
|
||||
hitLoginHemat,
|
||||
'INQUIRY'
|
||||
);
|
||||
const parsingResponse = hitSupplier.split(' ');
|
||||
|
|
Loading…
Reference in New Issue
Block a user