const http = require('http');
const server = http.createServer((req, res) => {
let body = '';
req.on('data', (chunk) => {
body += chunk;
});
req.on('end', () => {
console.log('request to '+req.url)
console.log(body)
console.log(' ')
if (req.url === '/dummy-pdam-inquiry-1002' && req.method === 'POST') {
const xmlPdamResponse = `
03031177
M RIZA FACHRIZI
Jl.Martapura Lama KOMP KARYA BUDI 3 BLKA No.45 Rt.-
201801
822
835
13
76551
A2-2
0
0
0
0
0
0
89051
false
00
success inquiry
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=ISO-8859-1' });
res.end(xmlPdamResponse);
console.log('response from '+req.url);
console.log(xmlPdamResponse);
} else if (req.url === '/dummy-pdam-inquiry-1005' && req.method === 'POST') {
const xmlPamResponse = `
000
Success
Success
ESB064205863
3051564
JEMMY ISKANDAR
JL. SIMPANG LIMAU KOMP. GRAHA RLAND NO. 11 ALEXANDRIT
1225-1225
0
0
5.0
5.0
1.0
20802
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPamResponse);
console.log('response from '+req.url);
console.log(xmlPamResponse);
} else if (req.url === '/dummy-pdam-inquiry-1009' && req.method === 'POST') {
const xmlPdam1009Response = `
1120300071794
MUSLIM
KUBANG SEPAT RT 03/07
2018
01-RB
1841
1868
BL0
108700
0
0
102200
5000
0
0
0
1500
0
0
27
false
00
sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1009Response);
console.log('response from '+req.url);
console.log(xmlPdam1009Response);
} else if (req.url === '/dummy-pdam-inquiry-1012' && req.method === 'POST') {
const xmlPdam1012Response = `
077633
RISMAWATI
SRI REZEKI PESONA BERLIAN No. 3 RT. 17 RW. - Lrg. MANGGA II Perum. - Kel. MAYANG MENGURAI
105513
202601
R2
740
764
BL0
156400
0
0
134400
0
0
5000
0
0
17000
0
24
0
0
false
00
sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1012Response);
console.log('response from '+req.url);
console.log(xmlPdam1012Response);
} else if (req.url === '/dummy-pdam-inquiry-1018' && req.method === 'POST') {
const xmlPdam1018Response = `
08070390061
MUH.TAUKHID
PRM.CANDRABAGA B.AS7 NO.02
052026
37
397400
0
0
0
397400
397400
4917
4954
00
Request Sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1018Response);
console.log('response from '+req.url);
console.log(xmlPdam1018Response);
} else if (req.url === '/dummy-pdam-pay-1002' && req.method === 'POST') {
const xmlPdam1002Response = `
03031177
8,905.10
false
00
success payment
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1002Response);
console.log('response from '+req.url);
console.log(xmlPdam1002Response);
}
else if (req.url === '/dummy-pdam-pay-1012' && req.method === 'POST') {
const xmlPdam1012Response = `
false
00
success payment
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1012Response);
console.log('response from '+req.url);
console.log(xmlPdam1012Response);
}
else if (req.url === '/dummy-pdam-pay-1005' && req.method === 'POST') {
const xmlPdam1005Response = `
000
PAYMENT SUCCESS
Success
ESB064205863
3051564
JEMMY ISKANDAR
JL. SIMPANG LIMAU KOMP. GRAHA RLAND NO. 11 ALEXANDRIT
1225-1225
0
0
4.65
5.41
0.76
20802
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1005Response);
console.log('response from '+req.url);
console.log(xmlPdam1005Response);
}
// Endpoint 1009 - PDAM (btn.co.id)
else if (req.url === '/dummy-pdam-pay-1009' && req.method === 'POST') {
const xmlPdam1009Response = `
1120300071794
MUSLIM
KUBANG SEPAT RT 03/07
false
00
Sukses Payment
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1009Response);
console.log('response from '+req.url);
console.log(xmlPdam1009Response);
}
// Endpoint 1018 - PDAM Bekasi
else if (req.url === '/dummy-pdam-pay-1018' && req.method === 'POST') {
const xmlPdam1018Response = `
08070390061
0
0
0
0
0
0
0
0
0
00
Request Sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1018Response);
console.log('response from '+req.url);
console.log(xmlPdam1018Response);
}
// Endpoint 1084 - PDAM Mamuju Inquiry
else if (req.url === '/dummy-pdam-inquiry-1084' && req.method === 'POST') {
const xmlPdam1084InquiryResponse = `
000
Transaction Sukses
13
ESTAMP20260602093326
005-00001
10200409457
FERRY HOEIDJAYA
JL KS TUBUN
N3
202605
35
1
365000
0
365000
202605;365000
202605
2182.0
2217.0
35.0
365000
5
ADMINISTRASI;2500
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1084InquiryResponse);
console.log('response from '+req.url);
console.log(xmlPdam1084InquiryResponse);
}
// Endpoint 1084 - PDAM Mamuju Payment
else if (req.url === '/dummy-pdam-pay-1084' && req.method === 'POST') {
const xmlPdam1084PaymentResponse = `
000
Transaction Sukses
14
ESTAMP20260602093436
005-00001
10200409457
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1084PaymentResponse);
console.log('response from '+req.url);
console.log(xmlPdam1084PaymentResponse);
}
// Endpoint 1011 - PDAM Makassar Inquiry
else if (req.url === '/dummy-pdam-inquiry-1011' && req.method === 'POST') {
const xmlPdam1011InquiryResponse = `
AHMAD YANI
JL. SULTAN ALAUDDIN NO. 123
199802098
152800
00
Sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1011InquiryResponse);
console.log('response from '+req.url);
console.log(xmlPdam1011InquiryResponse);
}
else if (req.url === '/dummy-pdam-inquiry-1012' && req.method === 'POST') {
const xmlPdam1012InquiryResponse = `
00
Sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1012InquiryResponse);
console.log('response from '+req.url);
console.log(xmlPdam1012InquiryResponse);
}
// Endpoint 1011 - PDAM Makassar Payment
else if (req.url === '/dummy-pdam-pay-1011' && req.method === 'POST') {
const xmlPdam1011PaymentResponse = `
199802098
152800
false
00
Sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1011PaymentResponse);
console.log('response from '+req.url);
console.log(xmlPdam1011PaymentResponse);
}
// Endpoint 1008 - PDAM Intan Banjar Inquiry
else if (req.url === '/dummy-pdam-inquiry-1008' && req.method === 'POST') {
const xmlPdam1008InquiryResponse = `
0000
Successful
6VRSE87BFCCF36M882P55ICQH4ENZSS1
168000
2110
49005284
SINTA NUR AULIA
PERUM. NUR AISYA LESTARI IV NO. 25 RT. RW.
05-RT.A3
0
0426-0426
14
168000
6017
PIB008
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1008InquiryResponse);
console.log('response from '+req.url);
console.log(xmlPdam1008InquiryResponse);
}
//aa
// Endpoint 1008 - PDAM Intan Banjar Payment
else if (req.url === '/dummy-pdam-pay-1008' && req.method === 'POST') {
const xmlPdam1008PaymentResponse = `
0000
Successful
6VRSE87BFCCF36M882P55ICQH4ENZSS1
168000
12000
2210
49005284
SINTA NUR AULIA
PERUM. NUR AISYA LESTARI IV NO. 25 RT. RW.
05-RT.A3
0
0426-0426
14
168000
6017
PIB008
001
DIHIMBAU Pelanggan agar secara berkala memeriksa INSTALASI DALAM utk menghindari kebocoran yg mengakibatkan TAGIHAN MELONJAK. Terimakasih
101
115
136000
20000
12000
0
0
0
20260521163334
Saldo:
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1008PaymentResponse);
console.log('response from '+req.url);
console.log(xmlPdam1008PaymentResponse);
}
// Endpoint 1023 - PDAM Bandung Inquiry
else if (req.url === '/dummy-pdam-inquiry-1023' && req.method === 'POST') {
const xmlPdam1023InquiryResponse = `
BUDI SANTOSO
JL. SOEKARNO HATTA NO. 456
202501
25
125000
10
10
125000
000
Sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1023InquiryResponse);
console.log('response from '+req.url);
console.log(xmlPdam1023InquiryResponse);
}
// Endpoint 1023 - PDAM Bandung Payment
else if (req.url === '/dummy-pdam-pay-1023' && req.method === 'POST') {
const xmlPdam1023PaymentResponse = `
125000
000
Sukses
`;
res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
res.end(xmlPdam1023PaymentResponse);
console.log('response from '+req.url);
console.log(xmlPdam1023PaymentResponse);
}
else {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end('Not found');
}
});
});
server.listen(3004, () => {
console.log('SOAP dummy running at http://localhost:3004/dummy-pemko-inquiry-4020');
});