Victoria Hall Booking for Events
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
3.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!doctype html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <title>Checkout Demo</title>
  5. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1" />
  6. <script src="https://www.paynimo.com/paynimocheckout/client/lib/jquery.min.js" type="text/javascript"></script>
  7. </head>
  8. <body>
  9. <button id="btnSubmit">Proceed to Pay</button>
  10. <h1 th:text="${token}"></h1>
  11. <script type="text/javascript" src="https://www.paynimo.com/paynimocheckout/server/lib/checkout.js"></script>
  12. <script type="text/javascript">
  13. var token = "";
  14. token = "[[${token}]]"
  15. //console.log(token);
  16. var txansactionId = "";
  17. txansactionId = "[[${txansactionId}]]"
  18. //console.log(txansactionId);
  19. var amount = "";
  20. amount = "[[${amount}]]"
  21. //console.log(amount);
  22. var merchantId = "";
  23. merchantId = "[[${merchantId}]]"
  24. //console.log(merchantId);
  25. $(document).ready(function () {
  26. function handleResponse(res) {
  27. if (typeof res != "undefined" && typeof res.paymentMethod != "undefined" && typeof res.paymentMethod.paymentTransaction != "undefined" && typeof res.paymentMethod.paymentTransaction.statusCode != "undefined" && res.paymentMethod.paymentTransaction.statusCode == "0300") {
  28. // success block
  29. //console.log("Success ");
  30. //console.log(res);
  31. } else if (typeof res != "undefined" && typeof res.paymentMethod != "undefined" && typeof res.paymentMethod.paymentTransaction != "undefined" && typeof res.paymentMethod.paymentTransaction.statusCode != "undefined" && res.paymentMethod.paymentTransaction.statusCode == "0398") {
  32. // initiated block
  33. //console.log("Initiated ");
  34. //console.log(res);
  35. } else {
  36. //console.log("error ");
  37. //console.log(res);
  38. // error block
  39. }
  40. };
  41. $(document).off("click", "#btnSubmit").on("click", "#btnSubmit", function (e) {
  42. e.preventDefault();
  43. var reqJson = {
  44. "features": {
  45. "enableAbortResponse": true,
  46. "enableExpressPay": true,
  47. "enableInstrumentDeRegistration": true,
  48. "enableMerTxnDetails": true,
  49. "enableNewWindowFlow": true //for hybrid applications please disable this by passing false
  50. },
  51. "consumerData": {
  52. "deviceId": "WEBSH2", //possible values "WEBSH1" or "WEBSH2"
  53. "token": token,
  54. "returnUrl": "/payment/response", //merchant response page URL
  55. "responseHandler": handleResponse,
  56. "paymentMode": "all",
  57. "merchantLogoUrl": "https://upload.wikimedia.org/wikipedia/commons/a/a8/Chennai_Corporation_Emblem.png", //provided merchant logo will be displayed
  58. "merchantName": "Greater Chennai Corporation",
  59. "merchantMsg": "Victoria Hall Booking",
  60. "merchantId": merchantId,
  61. "currency": "INR",
  62. "consumerId": "c964634",
  63. "consumerMobileNo": "7845014181",
  64. "consumerEmailId": "mohammedthaqi@bontonsoftwares.com",
  65. "txnId": txansactionId, //Unique merchant transaction ID
  66. "items": [{
  67. "itemId": "FIRST",
  68. "amount": amount,
  69. "comAmt": "0"
  70. }],
  71. "customStyle": {
  72. "PRIMARY_COLOR_CODE": "#45beaa", //merchant primary color code
  73. "SECONDARY_COLOR_CODE": "#FFFFFF", //provide merchant's suitable color code
  74. "BUTTON_COLOR_CODE_1": "#2d8c8c", //merchant's button background color code
  75. "BUTTON_COLOR_CODE_2": "#FFFFFF" //provide merchant's suitable color code for button text
  76. }
  77. }
  78. };
  79. $.pnCheckout(reqJson);
  80. if (reqJson.features.enableNewWindowFlow) {
  81. pnCheckoutShared.openNewWindow();
  82. }
  83. });
  84. });
  85. </script>
  86. </body>
  87. </html>