-fix transaction api error 401 for hemat
This commit is contained in:
@@ -28,18 +28,21 @@ export const doTransaction = async (
|
||||
|
||||
return res.data;
|
||||
} else if (supplier.code == 'Hemat') {
|
||||
const options = {
|
||||
headers: { Authorization: `${authorization}` },
|
||||
};
|
||||
const data = {
|
||||
idtransaction: idtrx,
|
||||
destination: `${destination}`,
|
||||
code: `${productCode}`,
|
||||
type: `${typePaid}`,
|
||||
};
|
||||
const res = await axios.post(`${supplier.url}/v1/transaction/request`, data, options);
|
||||
if (authorization != "") {
|
||||
console.log("initoken", authorization)
|
||||
const options = {
|
||||
headers: {'Authorization': 'Bearer ' + authorization}
|
||||
};
|
||||
const data = {
|
||||
idtransaction: idtrx,
|
||||
destination: `${destination}`,
|
||||
code: `${productCode}`,
|
||||
type: `${typePaid}`,
|
||||
};
|
||||
const res = await axios.post(`${supplier.url}/v1/transaction/request`, data, options);
|
||||
|
||||
return res.data;
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
|
||||
const res = await axios.get(
|
||||
@@ -47,7 +50,9 @@ export const doTransaction = async (
|
||||
);
|
||||
|
||||
return res.data;
|
||||
console.log('restranshemat', res)
|
||||
} catch (err) {
|
||||
console.log('errtranshemat', err)
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,6 +10,7 @@ export const doAuthorizeHemat = async (user, pass, supplier) => {
|
||||
|
||||
return res.data;
|
||||
} catch (err) {
|
||||
console.log('errauthhemat', err)
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user