dummyPDAM.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. const http = require('http');
  2. const server = http.createServer((req, res) => {
  3. let body = '';
  4. req.on('data', (chunk) => {
  5. body += chunk;
  6. });
  7. req.on('end', () => {
  8. console.log('request to '+req.url)
  9. console.log(body)
  10. console.log(' ')
  11. if (req.url === '/dummy-pdam-inquiry-1002' && req.method === 'POST') {
  12. const xmlPdamResponse = `<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  13. <SOAP-ENV:Body>
  14. <InquiryResponse xmlns="http://BTN-PDAM_BANJARMASIN/">
  15. <InquiryResult>
  16. <id_Pelanggan>03031177</id_Pelanggan>
  17. <nama_Pelanggan>M RIZA FACHRIZI</nama_Pelanggan>
  18. <alamat_Pelanggan>Jl.Martapura Lama KOMP KARYA BUDI 3 BLKA No.45 Rt.-</alamat_Pelanggan>
  19. <tagihan_Bulan>201801</tagihan_Bulan>
  20. <stand_Awal>822</stand_Awal>
  21. <stand_Akhir>835</stand_Akhir>
  22. <pemakaian_Akhir>13</pemakaian_Akhir>
  23. <harga_Air>76551</harga_Air>
  24. <golongan>A2-2</golongan>
  25. <biaya_GantiMeter>0</biaya_GantiMeter>
  26. <biaya_Denda>0</biaya_Denda>
  27. <biaya_Materai>0</biaya_Materai>
  28. <biaya_Abonemen>0</biaya_Abonemen>
  29. <biaya_Limbah>0</biaya_Limbah>
  30. <biaya_Sampah>0</biaya_Sampah>
  31. <total_Tagihan>89051</total_Tagihan>
  32. <status>
  33. <Status>
  34. <isError>false</isError>
  35. <errorCode>00</errorCode>
  36. <statusDescription>success inquiry</statusDescription>
  37. </Status>
  38. </status>
  39. </InquiryResult>
  40. </InquiryResponse>
  41. </SOAP-ENV:Body>
  42. </SOAP-ENV:Envelope>`;
  43. res.writeHead(200, { 'Content-Type': 'text/xml; charset=ISO-8859-1' });
  44. res.end(xmlPdamResponse);
  45. console.log('response from '+req.url);
  46. console.log(xmlPdamResponse);
  47. } else if (req.url === '/dummy-pdam-inquiry-1005' && req.method === 'POST') {
  48. const xmlPamResponse = `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:btn="http://BTN-PAMBANDARMASIH/">
  49. <soapenv:Body>
  50. <btn:InquiryResponse>
  51. <btn:rsp>000</btn:rsp>
  52. <btn:rspdesc>Success</btn:rspdesc>
  53. <btn:status>Success</btn:status>
  54. <btn:ref>ESB064205863</btn:ref>
  55. <btn:idPelanggan>3051564</btn:idPelanggan>
  56. <btn:nama>JEMMY ISKANDAR</btn:nama>
  57. <btn:alamat>JL. SIMPANG LIMAU KOMP. GRAHA RLAND NO. 11 ALEXANDRIT</btn:alamat>
  58. <btn:tahunBulan>1225-1225</btn:tahunBulan>
  59. <btn:admin>0</btn:admin>
  60. <btn:denda>0</btn:denda>
  61. <btn:standAwal>5.0</btn:standAwal>
  62. <btn:standAkhir>5.0</btn:standAkhir>
  63. <btn:pemakaian>1.0</btn:pemakaian>
  64. <btn:totalBayar>20802</btn:totalBayar>
  65. </btn:InquiryResponse>
  66. </soapenv:Body>
  67. </soapenv:Envelope>`;
  68. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  69. res.end(xmlPamResponse);
  70. console.log('response from '+req.url);
  71. console.log(xmlPamResponse);
  72. } else if (req.url === '/dummy-pdam-inquiry-1009' && req.method === 'POST') {
  73. const xmlPdam1009Response = `<?xml version="1.0" encoding="utf-8"?>
  74. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  75. <soap:Body>
  76. <InquiryResponse xmlns="http://btn.co.id/">
  77. <InquiryResult>
  78. <ID_Pelanggan_pdam>1120300071794</ID_Pelanggan_pdam>
  79. <nama_pelanggan_pdam>MUSLIM</nama_pelanggan_pdam>
  80. <alamat_pelanggan>KUBANG SEPAT RT 03/07</alamat_pelanggan>
  81. <id_rayon></id_rayon>
  82. <billdetails>
  83. <BillDetail>
  84. <billyear>2018</billyear>
  85. <billbulan>01-RB</billbulan>
  86. <std_awal>1841</std_awal>
  87. <std_akhir>1868</std_akhir>
  88. <billName>BL0</billName>
  89. <reference1></reference1>
  90. <TotalAmount>108700</TotalAmount>
  91. <billAmount1>0</billAmount1>
  92. <billAmount2>0</billAmount2>
  93. <billAmount3>102200</billAmount3>
  94. <billAmount4>5000</billAmount4>
  95. <billAmount5>0</billAmount5>
  96. <billAmount6>0</billAmount6>
  97. <billAmount7>0</billAmount7>
  98. <billAmount8>1500</billAmount8>
  99. <billAmount9>0</billAmount9>
  100. <billAmount10>0</billAmount10>
  101. <pemakaian>27</pemakaian>
  102. </BillDetail>
  103. </billdetails>
  104. <status>
  105. <Status>
  106. <isError>false</isError>
  107. <ErrorCode>00</ErrorCode>
  108. <StatusDescription>sukses</StatusDescription>
  109. </Status>
  110. </status>
  111. </InquiryResult>
  112. </InquiryResponse>
  113. </soap:Body>
  114. </soap:Envelope>`;
  115. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  116. res.end(xmlPdam1009Response);
  117. console.log('response from '+req.url);
  118. console.log(xmlPdam1009Response);
  119. } else if (req.url === '/dummy-pdam-inquiry-1012' && req.method === 'POST') {
  120. const xmlPdam1012Response = `<?xml version="1.0" encoding="utf-8"?>
  121. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  122. <soap:Body>
  123. <InquiryResponse xmlns="http://btn.co.id/">
  124. <InquiryResult>
  125. <ID_Pelanggan_pdam>077633</ID_Pelanggan_pdam>
  126. <nama_pelanggan_pdam>RISMAWATI</nama_pelanggan_pdam>
  127. <alamat_pelanggan>SRI REZEKI PESONA BERLIAN No. 3 RT. 17 RW. - Lrg. MANGGA II Perum. - Kel. MAYANG MENGURAI</alamat_pelanggan>
  128. <id_zona>105513</id_zona>
  129. <billdetails>
  130. <BillDetail>
  131. <tahunbulan>202601</tahunbulan>
  132. <gol>R2</gol>
  133. <std_awal>740</std_awal>
  134. <std_akhir>764</std_akhir>
  135. <billName>BL0</billName>
  136. <notrace></notrace>
  137. <TotalAmount>156400</TotalAmount>
  138. <billAmount1>0</billAmount1>
  139. <billAmount2>0</billAmount2>
  140. <uangair>134400</uangair>
  141. <pmeter>0</pmeter>
  142. <denda>0</denda>
  143. <retribusi>5000</retribusi>
  144. <materai>0</materai>
  145. <adm>0</adm>
  146. <abodemen>17000</abodemen>
  147. <leges>0</leges>
  148. <pemakaian>24</pemakaian>
  149. <gm_kini>0</gm_kini>
  150. <gm_lalu>0</gm_lalu>
  151. </BillDetail>
  152. </billdetails>
  153. <status>
  154. <Status>
  155. <isError>false</isError>
  156. <ErrorCode>00</ErrorCode>
  157. <StatusDescription>sukses</StatusDescription>
  158. </Status>
  159. </status>
  160. </InquiryResult>
  161. </InquiryResponse>
  162. </soap:Body>
  163. </soap:Envelope>`;
  164. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  165. res.end(xmlPdam1012Response);
  166. console.log('response from '+req.url);
  167. console.log(xmlPdam1012Response);
  168. } else if (req.url === '/dummy-pdam-inquiry-1018' && req.method === 'POST') {
  169. const xmlPdam1018Response = `<?xml version="1.0" encoding="utf-8"?>
  170. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  171. <soap:Body>
  172. <InquiryResponse xmlns="http://BTN-PDAMBEKASI/">
  173. <InquiryResult>
  174. <Idpelanggan>08070390061</Idpelanggan>
  175. <Namapelanggan>MUH.TAUKHID</Namapelanggan>
  176. <Alamatpelanggan>PRM.CANDRABAGA B.AS7 NO.02</Alamatpelanggan>
  177. <Tagihanbulan>052026</Tagihanbulan>
  178. <Pemakaianair>37</Pemakaianair>
  179. <Tagihanair>397400</Tagihanair>
  180. <Biayadenda>0</Biayadenda>
  181. <Tagihannonair>0</Tagihannonair>
  182. <Tagihanlalu>0</Tagihanlalu>
  183. <Totaltagihan>397400</Totaltagihan>
  184. <Tagihan>397400</Tagihan>
  185. <Stawal>4917</Stawal>
  186. <Stakhir>4954</Stakhir>
  187. <Status>
  188. <errorCode>00</errorCode>
  189. <statusDescription>Request Sukses</statusDescription>
  190. </Status>
  191. </InquiryResult>
  192. </InquiryResponse>
  193. </soap:Body>
  194. </soap:Envelope>`;
  195. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  196. res.end(xmlPdam1018Response);
  197. console.log('response from '+req.url);
  198. console.log(xmlPdam1018Response);
  199. } else if (req.url === '/dummy-pdam-pay-1002' && req.method === 'POST') {
  200. const xmlPdam1002Response = `<?xml version="1.0" encoding="utf-8"?>
  201. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  202. <soap:Body>
  203. <PaymentResponse xmlns="http://BTN-PDAM_BANJARMASIN/">
  204. <PaymentResult>
  205. <id_Pelanggan>03031177</id_Pelanggan>
  206. <ppn>8,905.10</ppn>
  207. <status>
  208. <Status>
  209. <isError>false</isError>
  210. <errorCode>00</errorCode>
  211. <statusDescription>success payment</statusDescription>
  212. </Status>
  213. </status>
  214. </PaymentResult>
  215. </PaymentResponse>
  216. </soap:Body>
  217. </soap:Envelope>`;
  218. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  219. res.end(xmlPdam1002Response);
  220. console.log('response from '+req.url);
  221. console.log(xmlPdam1002Response);
  222. }
  223. else if (req.url === '/dummy-pdam-pay-1012' && req.method === 'POST') {
  224. const xmlPdam1012Response = `<?xml version="1.0" encoding="utf-8"?>
  225. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  226. <soap:Body>
  227. <PaymentResponse xmlns="http://BTN-PDAM_BANJARMASIN/">
  228. <PaymentResult>
  229. <status>
  230. <Status>
  231. <isError>false</isError>
  232. <ErrorCode>00</ErrorCode>
  233. <StatusDescription>success payment</StatusDescription>
  234. </Status>
  235. </status>
  236. </PaymentResult>
  237. </PaymentResponse>
  238. </soap:Body>
  239. </soap:Envelope>`;
  240. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  241. res.end(xmlPdam1012Response);
  242. console.log('response from '+req.url);
  243. console.log(xmlPdam1012Response);
  244. }
  245. else if (req.url === '/dummy-pdam-pay-1005' && req.method === 'POST') {
  246. const xmlPdam1005Response = `<?xml version="1.0" encoding="utf-8"?>
  247. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:btn="http://BTN-PAMBANDARMASIH/">
  248. <soapenv:Body>
  249. <btn:PaymentResponse>
  250. <btn:rsp>000</btn:rsp>
  251. <btn:rspdesc>PAYMENT SUCCESS</btn:rspdesc>
  252. <btn:status>Success</btn:status>
  253. <btn:ref>ESB064205863</btn:ref>
  254. <btn:idPelanggan>3051564</btn:idPelanggan>
  255. <btn:nama>JEMMY ISKANDAR</btn:nama>
  256. <btn:alamat>JL. SIMPANG LIMAU KOMP. GRAHA RLAND NO. 11 ALEXANDRIT</btn:alamat>
  257. <btn:tahunBulan>1225-1225</btn:tahunBulan>
  258. <btn:admin>0</btn:admin>
  259. <btn:denda>0</btn:denda>
  260. <btn:standAwal>4.65</btn:standAwal>
  261. <btn:standAkhir>5.41</btn:standAkhir>
  262. <btn:pemakaian>0.76</btn:pemakaian>
  263. <btn:totalBayar>20802</btn:totalBayar>
  264. </btn:PaymentResponse>
  265. </soapenv:Body>
  266. </soapenv:Envelope>`;
  267. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  268. res.end(xmlPdam1005Response);
  269. console.log('response from '+req.url);
  270. console.log(xmlPdam1005Response);
  271. }
  272. // Endpoint 1009 - PDAM (btn.co.id)
  273. else if (req.url === '/dummy-pdam-pay-1009' && req.method === 'POST') {
  274. const xmlPdam1009Response = `<?xml version="1.0" encoding="utf-8"?>
  275. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  276. <soap:Body>
  277. <PaymentResponse xmlns="http://btn.co.id/">
  278. <PaymentResult>
  279. <ID_Pelanggan_pdam>1120300071794</ID_Pelanggan_pdam>
  280. <nama_pelanggan_pdam>MUSLIM</nama_pelanggan_pdam>
  281. <alamat_pelanggan>KUBANG SEPAT RT 03/07</alamat_pelanggan>
  282. <status>
  283. <Status>
  284. <isError>false</isError>
  285. <ErrorCode>00</ErrorCode>
  286. <StatusDescription>Sukses Payment</StatusDescription>
  287. </Status>
  288. </status>
  289. </PaymentResult>
  290. </PaymentResponse>
  291. </soap:Body>
  292. </soap:Envelope>`;
  293. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  294. res.end(xmlPdam1009Response);
  295. console.log('response from '+req.url);
  296. console.log(xmlPdam1009Response);
  297. }
  298. // Endpoint 1018 - PDAM Bekasi
  299. else if (req.url === '/dummy-pdam-pay-1018' && req.method === 'POST') {
  300. const xmlPdam1018Response = `<?xml version="1.0" encoding="utf-8"?>
  301. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  302. <soap:Body>
  303. <PaymentResponse xmlns="http://BTN-PDAMBEKASI/">
  304. <PaymentResult>
  305. <Idpelanggan>08070390061</Idpelanggan>
  306. <Namapelanggan></Namapelanggan>
  307. <Alamatpelanggan></Alamatpelanggan>
  308. <Tagihanbulan></Tagihanbulan>
  309. <Pemakaianair>0</Pemakaianair>
  310. <Tagihanair>0</Tagihanair>
  311. <Biayadenda>0</Biayadenda>
  312. <Tagihannonair>0</Tagihannonair>
  313. <Tagihanlalu>0</Tagihanlalu>
  314. <Totaltagihan>0</Totaltagihan>
  315. <Tagihan>0</Tagihan>
  316. <Stawal>0</Stawal>
  317. <Stakhir>0</Stakhir>
  318. <Status>
  319. <errorCode>00</errorCode>
  320. <statusDescription>Request Sukses</statusDescription>
  321. </Status>
  322. </PaymentResult>
  323. </PaymentResponse>
  324. </soap:Body>
  325. </soap:Envelope>`;
  326. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  327. res.end(xmlPdam1018Response);
  328. console.log('response from '+req.url);
  329. console.log(xmlPdam1018Response);
  330. }
  331. // Endpoint 1084 - PDAM Mamuju Inquiry
  332. else if (req.url === '/dummy-pdam-inquiry-1084' && req.method === 'POST') {
  333. const xmlPdam1084InquiryResponse = `<?xml version="1.0" encoding="utf-8"?>
  334. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:btn="http://BTN-PDAM-MAMUJU/">
  335. <soapenv:Body>
  336. <btn:InquiryResponse>
  337. <btn:rsp>000</btn:rsp>
  338. <btn:rspdesc>Transaction Sukses</btn:rspdesc>
  339. <btn:ref>13</btn:ref>
  340. <btn:sysReferenceNo>ESTAMP20260602093326</btn:sysReferenceNo>
  341. <btn:kodePDAM>005-00001</btn:kodePDAM>
  342. <btn:noSambungan>10200409457</btn:noSambungan>
  343. <btn:nama>FERRY HOEIDJAYA</btn:nama>
  344. <btn:alamat>JL KS TUBUN</btn:alamat>
  345. <btn:golongan>N3</btn:golongan>
  346. <btn:periode>202605</btn:periode>
  347. <btn:kubikase>35</btn:kubikase>
  348. <btn:jumlahRekening>1</btn:jumlahRekening>
  349. <btn:totalTagihan>365000</btn:totalTagihan>
  350. <btn:totalDenda>0</btn:totalDenda>
  351. <btn:grandTotal>365000</btn:grandTotal>
  352. <btn:periodeRekeningDibayar>202605;365000</btn:periodeRekeningDibayar>
  353. <btn:tagihan>
  354. <btn:periode>202605</btn:periode>
  355. <btn:stanAwal>2182.0</btn:stanAwal>
  356. <btn:stanAkhir>2217.0</btn:stanAkhir>
  357. <btn:kubikase>35.0</btn:kubikase>
  358. <btn:subtotal>365000</btn:subtotal>
  359. <btn:jumlahItem>5</btn:jumlahItem>
  360. <btn:items>ADMINISTRASI;2500</btn:items>
  361. </btn:tagihan>
  362. </btn:InquiryResponse>
  363. </soapenv:Body>
  364. </soapenv:Envelope>`;
  365. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  366. res.end(xmlPdam1084InquiryResponse);
  367. console.log('response from '+req.url);
  368. console.log(xmlPdam1084InquiryResponse);
  369. }
  370. // Endpoint 1084 - PDAM Mamuju Payment
  371. else if (req.url === '/dummy-pdam-pay-1084' && req.method === 'POST') {
  372. const xmlPdam1084PaymentResponse = `<?xml version="1.0" encoding="utf-8"?>
  373. <soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:btn="http://BTN-PDAM-MAMUJU/">
  374. <soapenv:Body>
  375. <btn:PaymentResponse>
  376. <btn:rsp>000</btn:rsp>
  377. <btn:rspdesc>Transaction Sukses</btn:rspdesc>
  378. <btn:ref>14</btn:ref>
  379. <btn:sysReferenceNo>ESTAMP20260602093436</btn:sysReferenceNo>
  380. <btn:kodePDAM>005-00001</btn:kodePDAM>
  381. <btn:noSambungan>10200409457</btn:noSambungan>
  382. </btn:PaymentResponse>
  383. </soapenv:Body>
  384. </soapenv:Envelope>`;
  385. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  386. res.end(xmlPdam1084PaymentResponse);
  387. console.log('response from '+req.url);
  388. console.log(xmlPdam1084PaymentResponse);
  389. }
  390. // Endpoint 1011 - PDAM Makassar Inquiry
  391. else if (req.url === '/dummy-pdam-inquiry-1011' && req.method === 'POST') {
  392. const xmlPdam1011InquiryResponse = `<?xml version="1.0" encoding="utf-8"?>
  393. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  394. <soap:Body>
  395. <InquiryResponse xmlns="http://BTN-PDAM_MAKASAR/">
  396. <InquiryResult>
  397. <billinfo6>AHMAD YANI</billinfo6>
  398. <billinfo8>JL. SULTAN ALAUDDIN NO. 123</billinfo8>
  399. <billinfo9>199802098</billinfo9>
  400. <totalAmount>152800</totalAmount>
  401. <status>
  402. <Status>
  403. <errorCode>00</errorCode>
  404. <errorDescription>Sukses</errorDescription>
  405. </Status>
  406. </status>
  407. </InquiryResult>
  408. </InquiryResponse>
  409. </soap:Body>
  410. </soap:Envelope>`;
  411. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  412. res.end(xmlPdam1011InquiryResponse);
  413. console.log('response from '+req.url);
  414. console.log(xmlPdam1011InquiryResponse);
  415. }
  416. else if (req.url === '/dummy-pdam-inquiry-1012' && req.method === 'POST') {
  417. const xmlPdam1012InquiryResponse = `<?xml version="1.0" encoding="utf-8"?>
  418. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  419. <soap:Body>
  420. <InquiryResponse xmlns="http://btn.co.id/">
  421. <InquiryResult>
  422. <status>
  423. <Status>
  424. <errorCode>00</errorCode>
  425. <statusDescription>Sukses</statusDescription>
  426. </Status>
  427. </status>
  428. </InquiryResult>
  429. </InquiryResponse>
  430. </soap:Body>
  431. </soap:Envelope>`;
  432. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  433. res.end(xmlPdam1012InquiryResponse);
  434. console.log('response from '+req.url);
  435. console.log(xmlPdam1012InquiryResponse);
  436. }
  437. // Endpoint 1011 - PDAM Makassar Payment
  438. else if (req.url === '/dummy-pdam-pay-1011' && req.method === 'POST') {
  439. const xmlPdam1011PaymentResponse = `<?xml version="1.0" encoding="utf-8"?>
  440. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  441. <soap:Body>
  442. <PaymentResponse xmlns="http://BTN-PDAM_MAKASAR/">
  443. <PaymentResult>
  444. <billinfo1>199802098 </billinfo1>
  445. <billinfo2>152800</billinfo2>
  446. <status>
  447. <Status>
  448. <isError>false</isError>
  449. <ErrorCode>00</ErrorCode>
  450. <StatusDescription>Sukses</StatusDescription>
  451. </Status>
  452. </status>
  453. </PaymentResult>
  454. </PaymentResponse>
  455. </soap:Body>
  456. </soap:Envelope>`;
  457. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  458. res.end(xmlPdam1011PaymentResponse);
  459. console.log('response from '+req.url);
  460. console.log(xmlPdam1011PaymentResponse);
  461. }
  462. // Endpoint 1008 - PDAM Intan Banjar Inquiry
  463. else if (req.url === '/dummy-pdam-inquiry-1008' && req.method === 'POST') {
  464. const xmlPdam1008InquiryResponse = `<?xml version="1.0" encoding="utf-8"?>
  465. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:btn="http://BTN-PDAM-INTANBANJAR/">
  466. <soapenv:Header/>
  467. <soapenv:Body>
  468. <Inquiry_response>
  469. <status>0000</status>
  470. <statusdesc>Successful</statusdesc>
  471. <reference>6VRSE87BFCCF36M882P55ICQH4ENZSS1</reference>
  472. <totalTagihan>168000</totalTagihan>
  473. <MTI>2110</MTI>
  474. <id>49005284</id>
  475. <name>SINTA NUR AULIA</name>
  476. <address>PERUM. NUR AISYA LESTARI IV NO. 25 RT. RW.</address>
  477. <tariffCode>05-RT.A3</tariffCode>
  478. <creditBalance>0</creditBalance>
  479. <month>0426-0426</month>
  480. <waterUsage>14</waterUsage>
  481. <amount>168000</amount>
  482. <merchantCategory>6017</merchantCategory>
  483. <partnerid>PIB008</partnerid>
  484. </Inquiry_response>
  485. </soapenv:Body>
  486. </soapenv:Envelope>`;
  487. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  488. res.end(xmlPdam1008InquiryResponse);
  489. console.log('response from '+req.url);
  490. console.log(xmlPdam1008InquiryResponse);
  491. }
  492. //aa
  493. // Endpoint 1008 - PDAM Intan Banjar Payment
  494. else if (req.url === '/dummy-pdam-pay-1008' && req.method === 'POST') {
  495. const xmlPdam1008PaymentResponse = `<?xml version="1.0" encoding="utf-8"?>
  496. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:btn="http://BTN-PDAM-INTANBANJAR/">
  497. <soapenv:Header/>
  498. <soapenv:Body>
  499. <Payment_response>
  500. <status>0000</status>
  501. <statusdesc>Successful</statusdesc>
  502. <reference>6VRSE87BFCCF36M882P55ICQH4ENZSS1</reference>
  503. <totalTagihan>168000</totalTagihan>
  504. <totalDenda>12000</totalDenda>
  505. <MTI>2210</MTI>
  506. <id>49005284</id>
  507. <name>SINTA NUR AULIA</name>
  508. <address>PERUM. NUR AISYA LESTARI IV NO. 25 RT. RW.</address>
  509. <tariffCode>05-RT.A3</tariffCode>
  510. <creditBalance>0</creditBalance>
  511. <month>0426-0426</month>
  512. <waterUsage>14</waterUsage>
  513. <amount>168000</amount>
  514. <merchantCategory>6017</merchantCategory>
  515. <partnerid>PIB008</partnerid>
  516. <trxIncrement>001</trxIncrement>
  517. <information>DIHIMBAU Pelanggan agar secara berkala memeriksa INSTALASI DALAM utk menghindari kebocoran yg mengakibatkan TAGIHAN MELONJAK. Terimakasih</information>
  518. <previousMeter>101</previousMeter>
  519. <currentMeter>115</currentMeter>
  520. <waterPrice>136000</waterPrice>
  521. <fixedCharge>20000</fixedCharge>
  522. <penalty>12000</penalty>
  523. <installment>0</installment>
  524. <othersCost>0</othersCost>
  525. <revenueStamp>0</revenueStamp>
  526. <dateTime>20260521163334</dateTime>
  527. <othersInfo>Saldo:</othersInfo>
  528. </Payment_response>
  529. </soapenv:Body>
  530. </soapenv:Envelope>`;
  531. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  532. res.end(xmlPdam1008PaymentResponse);
  533. console.log('response from '+req.url);
  534. console.log(xmlPdam1008PaymentResponse);
  535. }
  536. // Endpoint 1023 - PDAM Bandung Inquiry
  537. else if (req.url === '/dummy-pdam-inquiry-1023' && req.method === 'POST') {
  538. const xmlPdam1023InquiryResponse = `<?xml version="1.0" encoding="utf-8"?>
  539. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  540. <soap:Body>
  541. <InquiryResponse xmlns="http://BTN-PDAMBANDUNG/">
  542. <InquiryResult>
  543. <Nama>BUDI SANTOSO</Nama>
  544. <Almt>JL. SOEKARNO HATTA NO. 456</Almt>
  545. <Thbl>202501</Thbl>
  546. <Tmet>25</Tmet>
  547. <TagBulanIni>125000</TagBulanIni>
  548. <TagTunggakan>10</TagTunggakan>
  549. <Dndblnan>10</Dndblnan>
  550. <Total>125000</Total>
  551. <StatusResponse>
  552. <Status>
  553. <errorCode>000</errorCode>
  554. <statusDescription>Sukses</statusDescription>
  555. </Status>
  556. </StatusResponse>
  557. </InquiryResult>
  558. </InquiryResponse>
  559. </soap:Body>
  560. </soap:Envelope>`;
  561. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  562. res.end(xmlPdam1023InquiryResponse);
  563. console.log('response from '+req.url);
  564. console.log(xmlPdam1023InquiryResponse);
  565. }
  566. // Endpoint 1023 - PDAM Bandung Payment
  567. else if (req.url === '/dummy-pdam-pay-1023' && req.method === 'POST') {
  568. const xmlPdam1023PaymentResponse = `<?xml version="1.0" encoding="utf-8"?>
  569. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  570. <soap:Body>
  571. <PaymentResponse xmlns="http://BTN-PDAMBANDUNG/">
  572. <PaymentResult>
  573. <JmlTagihan>125000</JmlTagihan>
  574. <StatusResponse>
  575. <Status>
  576. <errorCode>000</errorCode>
  577. <statusDescription>Sukses</statusDescription>
  578. </Status>
  579. </StatusResponse>
  580. </PaymentResult>
  581. </PaymentResponse>
  582. </soap:Body>
  583. </soap:Envelope>`;
  584. res.writeHead(200, { 'Content-Type': 'text/xml; charset=utf-8' });
  585. res.end(xmlPdam1023PaymentResponse);
  586. console.log('response from '+req.url);
  587. console.log(xmlPdam1023PaymentResponse);
  588. }
  589. else {
  590. res.writeHead(404, { 'Content-Type': 'text/plain' });
  591. res.end('Not found');
  592. }
  593. });
  594. });
  595. server.listen(3004, () => {
  596. console.log('SOAP dummy running at http://localhost:3004/dummy-pemko-inquiry-4020');
  597. });