Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.96 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>3D</title>
  4. </head>
  5. <body>
  6. <form name="fo" id="a" method="POST" action="{url}">
  7.     <button type="submit">Finalize payment</button>
  8.     <input id="b" type="hidden" name="PaReq" value="{data}"/>
  9.     <input id="c" type="hidden" name="TermUrl" value="{callback}"/>
  10.     <input id="d" type="hidden" name="MD" value="{your_identifier}"/>
  11. </form>
  12. <script>
  13. function x(variable) {
  14.     const query = window.location.search.substring(1);
  15.     const vars = query.split('&');
  16.     for (let i = 0; i < vars.length; i++) {
  17.         const pair = vars[i].split('=');
  18.         if (decodeURIComponent(pair[0]) === variable) {
  19.             return decodeURIComponent(pair[1]);
  20.         }
  21.     }
  22. }
  23.  
  24. const obj = JSON.parse(sessionStorage.getItem('3d'));
  25. document.querySelector('#a').action = x('url');
  26. document.querySelector('#b').value = x('data');
  27. document.querySelector('#c').value = x('callback');
  28. document.querySelector('#d').value = x('orderId');
  29. document.fo.submit();
  30. </script>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement