mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 11:16:28 +00:00
26 lines
712 B
JavaScript
26 lines
712 B
JavaScript
// GET PARTNER, MERCHANT, TERMINAL FROM TID
|
|
const generateInvoice = (invoiceDate, trx) => {
|
|
|
|
let invoice = trx.select(trx.raw(`payment.sp_payment_req_topup_online('${invoiceDate}')`)).get()
|
|
|
|
invoice.forEach(function (item) {
|
|
const url = 'http://piqas.kereta-api.co.id:51500/XISOAPAdapter/MessageServlet?senderParty=&senderService=KCI_ETICKETING_2&receiverParty=&receiverService=&interface=SI_KCI_CMS_FI01&interfaceNamespace=urn:Posting_ETicketing_2'
|
|
|
|
const response = await fetch(url, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'text/xml'
|
|
},
|
|
body: xmlRequest
|
|
});
|
|
|
|
console.log(item);
|
|
});
|
|
|
|
return result;
|
|
};
|
|
|
|
module.exports = {
|
|
generateInvoice,
|
|
};
|