Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @import models.user.InappTransaction
- @import models.user.LenderPaymentOptions
- @import models.Lender
- @(inappTransaction: InappTransaction, lender: Lender, lenderMappings: Map[String,Array[Long]])
- <!DOCTYPE html>
- <html>
- <head>
- <title>
- SmartCoin Payment Page
- </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
- <style>
- body {
- background: #ebeff2;
- font-family: sans-serif;
- margin: 0px;
- }
- body .loader-wrapper {
- background-color: rgba(0, 0, 0, 0.7);
- position: fixed;
- z-index: 10;
- height: 100vh;
- top: 0px;
- left: 0px;
- width: 100vw;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- body .is-hidden {
- display: none;
- }
- body .lds-ripple {
- display: inline-block;
- position: relative;
- width: 64px;
- height: 64px;
- }
- body .lds-ripple div {
- position: absolute;
- border: 4px solid #fff;
- opacity: 1;
- border-radius: 50%;
- animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
- }
- body .lds-ripple div:nth-child(2) {
- animation-delay: -0.5s;
- }
- @@keyframes lds-ripple {
- 0% {
- top: 28px;
- left: 28px;
- width: 0;
- height: 0;
- opacity: 1;
- }
- 100% {
- top: -1px;
- left: -1px;
- width: 58px;
- height: 58px;
- opacity: 0;
- }
- }
- .payment-page .header-bar {
- background: #343c52;
- color: #fff;
- display: flex;
- text-align: center;
- justify-content: center;
- align-items: center;
- padding: 8px 0px;
- width: 100%;
- }
- .payment-page .header-bar .smart-logo {
- margin-right: 15px;
- }
- .payment-page .payment-options {
- margin-top: 16px;
- display: flex;
- text-align: center;
- justify-content: center;
- }
- .payment-page .payment-options .options-card {
- max-width: 400px;
- border-radius: 3px;
- background-color: #ffffff;
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.14);
- padding: 15px;
- padding-top: 0px;
- }
- .payment-page .payment-options .options-card .top-announce {
- background: #343c52;
- color: #fff;
- justify-content: center;
- margin-left: -15px;
- margin-right: -15px;
- padding: 32px;
- margin-bottom: 10px;
- }
- .payment-page .payment-options .options-card .amount-bar {
- display: flex;
- justify-content: space-between;
- padding-bottom: 16px;
- padding-top: 12px;
- margin-bottom: 16px;
- }
- .payment-page .payment-options .options-card .amount-bar .p-value {
- color: #343c52;
- width: 100%;
- font-size: 32px;
- }
- .payment-page .payment-options .options-card .p-header {
- font-size: 12px;
- color: #bcbcbc;
- margin-top: 16px;
- text-align: left;
- margin-bottom: 10px;
- }
- .payment-page .payment-options .options-card .payment-option {
- display: flex;
- padding-top: 10px;
- text-align: center;
- justify-content: center;
- flex-direction: row;
- }
- .payment-page .payment-options .options-card .payment-option .sec-img {
- display: flex;
- color: #fff;
- align-items: center;
- background: #33b5e6;
- border-radius: 50px;
- height: 40px;
- width: 40px;
- justify-content: center;
- margin-right: 8px;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank {
- display: flex;
- border-bottom: solid 1px #e0e0e0;
- flex-direction: column;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options {
- text-align: left;
- max-height: 0px;
- overflow: hidden;
- transition: max-height 0.15s ease-out;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options.open {
- max-height: 200px;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options .section-box {
- border-bottom: solid 1px #e0e0e0;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options .section-box.account-type {
- border-bottom: none;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options .section-box.account-type {
- display: flex;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options .section-box.account-type .mode {
- margin-right: 60px;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options .section-box .title {
- color: #757575;
- text-transform: uppercase;
- font-size: 10px;
- margin-top: 8px;
- font-weight: 600;
- color: #0c264f;
- }
- .payment-page .payment-options .options-card .payment-option .sec-parent-bank #bank-options .section-box .options {
- color: #757575;
- margin-top: 12px;
- margin-bottom: 12px;
- font-size: 12px;
- }
- .payment-page .payment-options .options-card .payment-option .sec-name-select {
- border-bottom: solid 1px #e0e0e0;
- display: flex;
- flex-direction: row;
- align-items: center;
- padding-bottom: 10px;
- }
- .payment-page .payment-options .options-card .payment-option .sec-name-select.bank-toggle {
- cursor: pointer;
- border-bottom: none;
- }
- .payment-page .payment-options .options-card .payment-option .sec-name-select .sec-name {
- min-width: 230px;
- text-align: left;
- color: #757575;
- }
- .payment-page .payment-options .options-card .payment-option .sec-name-select .sec-name .title {
- font-weight: 600;
- color: #0c264f;
- }
- @@media (max-width: 768px) {
- .payment-page .payment-options .options-card .payment-option .sec-name-select .sec-name {
- min-width: 130px;
- }
- }
- .payment-page .payment-options .options-card .payment-option .sec-name-select .sec-name .charges {
- text-transform: uppercase;
- font-size: 10px;
- color: #bcbcbc;
- margin-top: 8px;
- }
- .payment-page .payment-options .options-card .payment-option .sec-name-select .sec-name .charges .amount {
- font-size: 12px;
- color: #0c264f;
- }
- .payment-page .payment-options .options-card .payment-option .sec-name-select .sec-select {
- min-width: 100px;
- justify-content: flex-end;
- color: #eea83b;
- display: flex;
- align-items: center;
- cursor: pointer;
- }
- .payment-page .payment-options .options-card .payment-option:last-child .sec-name-select {
- border-bottom: none;
- }
- .box {
- display:none
- }
- .payment-page .payment-options .options-card .payment-option .box .section-box {
- border-bottom: solid 1px #e0e0e0;
- }
- .payment-page .payment-options .options-card .payment-option .box .section-box.account-type {
- border-bottom: none;
- }
- .payment-page .payment-options .options-card .payment-option .box .section-box.account-type {
- display: flex;
- }
- .payment-page .payment-options .options-card .payment-option ..box .section-box.account-type .mode {
- margin-right: 60px;
- }
- .payment-page .payment-options .options-card .payment-option .box .section-box .title {
- color: #757575;
- text-transform: uppercase;
- font-size: 10px;
- margin-top: 8px;
- font-weight: 600;
- color: #0c264f;
- }
- .payment-page .payment-options .options-card .payment-option .box .section-box .options {
- color: #757575;
- margin-top: 12px;
- margin-bottom: 12px;
- font-size: 12px;
- }
- @@media (max-width: 768px) {
- .payment-page .payment-options .options-card {
- max-width: 95%;
- }
- }
- <!--.payment-page .custom-radio {-->
- <!--/* Hide the browser's default radio button */-->
- <!--}-->
- <!--.payment-page .custom-radio .container {-->
- <!--position: relative;-->
- <!--padding-left: 23px;-->
- <!--padding-top: 2px;-->
- <!--margin-right: 30px;-->
- <!--cursor: pointer;-->
- <!-- -webkit-user-select: none;-->
- <!-- -moz-user-select: none;-->
- <!-- -ms-user-select: none;-->
- <!--user-select: none;-->
- <!--}-->
- <!--.payment-page .custom-radio .container input {-->
- <!--position: absolute;-->
- <!--opacity: 0;-->
- <!--cursor: pointer;-->
- <!--}-->
- <!--.payment-page .custom-radio .checkmark {-->
- <!--position: absolute;-->
- <!--top: 0;-->
- <!--left: 0;-->
- <!--height: 16px;-->
- <!--width: 16px;-->
- <!--background-color: #eee;-->
- <!--border-radius: 50%;-->
- <!--}-->
- <!--.payment-page .custom-radio .container:hover input ~ .checkmark {-->
- <!--background-color: #ccc;-->
- <!--}-->
- <!--.payment-page .custom-radio .container input:checked ~ .checkmark {-->
- <!--background-color: white;-->
- <!--border: solid 1px black;-->
- <!--}-->
- <!--.payment-page .custom-radio .checkmark:after {-->
- <!--content: "";-->
- <!--position: absolute;-->
- <!--display: none;-->
- <!--}-->
- <!--.payment-page .custom-radio .container input:checked ~ .checkmark:after {-->
- <!--display: block;-->
- <!--}-->
- <!--.payment-page .custom-radio .container .checkmark:after {-->
- <!--top: 1px;-->
- <!--left: 1px;-->
- <!--width: 14px;-->
- <!--height: 14px;-->
- <!--border-radius: 50%;-->
- <!--background: #fa8f59;-->
- <!--}-->
- </style>
- </head>
- <body>
- <div class="payment-page">
- <div class="header-bar">
- <img class="smart-logo" src="https://admin.smartcoin.co.in/assets/images/edbe4153e7db44a8a910ca2d34b69096-launcher.png"></img>
- <div>Smartcoin Loan Payment</div>
- </div>
- <div class="payment-options">
- <div class="options-card">
- <div class="top-announce">Dear @inappTransaction.getName().toUpperCase(), please select one of the following options to make the payment</div>
- <div class="amount-bar">
- <div class="p-value">₹ @inappTransaction.getAmount</div>
- </div>
- <div class="payment-option">
- <div class="sec-img"><i class="material-icons md-48">account_balance</i></div>
- <div class="sec-parent-bank">
- <div class="sec-name-select bank-toggle closed" onclick="toggleBankMode(event)">
- <div class="sec-name">
- <div>Bank Transfer</div>
- <div class="charges">Charges <span class="amount">₹ 0</span></div>
- </div>
- <div class="sec-select" data-type="BANK_TRANSFER">
- <span class="inner-text">Select</span>
- <i class="material-icons md-48">keyboard_arrow_down</i>
- </div>
- </div>
- <div class="" id="bank-options">
- <!-- <div class="payment-mode section-box">
- <div class="title">Payment Mode</div>
- <div class="options custom-radio">
- <label class="container">NEFT
- <input type="radio" checked="checked" name="payment-mode">
- <span class="checkmark"></span>
- </label>
- <label class="container">UPI
- <input type="radio" name="payment-mode">
- <span class="checkmark"></span>
- </label>
- <label class="container">IMPS
- <input type="radio" name="payment-mode">
- <span class="checkmark"></span>
- </label> -->
- <!-- <input type="radio" value="NEFT" name="payment-mode">NEFT
- <input type="radio" value="UPI" name="payment-mode">UPI
- <input type="radio" value="IMPS" name="payment-mode">IMPS -->
- <!-- </div>
- </div> -->
- <div class="account-number section-box">
- <div class="title">Bank Account Holder</div>
- <div class="options">
- <div>@lender.getName()</div>
- </div>
- </div>
- <div class="account-number section-box">
- <div class="title">Account Number</div>
- <div class="options">
- <div>@lender.getAcNo()</div>
- </div>
- </div>
- <div class="account-type section-box">
- <div class="mode">
- <div class="title">Payment Mode</div>
- <div class="options">
- <div>@lender.getIfsc()</div>
- </div>
- </div>
- <div>
- <div class="title">Account Type</div>
- <div class="options">
- <div>@lender.getAccType()</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="payment-option">
- <div class="sec-img"><i class="material-icons md-48">account_balance</i></div>
- <div class="sec-parent-bank">
- <div class="sec-name-select bank-toggle">
- <div class="sec-name">
- <div>Bank Transfer</div>
- <div class="charges">Charges <span class="amount">₹ 0</span></div>
- </div>
- <div type="text" class="slide-toggle">
- Select
- <i class="material-icons md-48">keyboard_arrow_right</i>
- </div>
- </div>
- </div>
- <div class="box">
- <div class="account-number section-box">
- <div class="title">Bank Account Holder</div>
- <div class="options">
- <div>@lender.getName()</div>
- </div>
- </div>
- <div class="account-number section-box">
- <div class="title">Account Number</div>
- <div class="options">
- <div>@lender.getAcNo()</div>
- </div>
- </div>
- <div class="account-type section-box">
- <div class="mode">
- <div class="title">Payment Mode</div>
- <div class="options">
- <div>@lender.getIfsc()</div>
- </div>
- </div>
- <div>
- <div class="title">Account Type</div>
- <div class="options">
- <div>@lender.getAccType()</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!--<div class="payment-option">-->
- <!--<div class="sec-img"><i class="material-icons md-48">account_balance</i></div>-->
- <!--<div class="sec-name-select">-->
- <!--<div class="sec-name">-->
- <!--<div>Bank Transfer</div>-->
- <!--<div class="charges">Charges <span class="amount">₹ </span></div>-->
- <!--</div>-->
- <!--<div class="sec-select" data-type="BANK_TRANSFER" onclick="redirectToGateway(event)">-->
- <!--Select-->
- <!--<i class="material-icons md-48">keyboard_arrow_right</i>-->
- <!--</div>-->
- <!--</div>-->
- <!--</div>-->
- @if(lenderMappings != null) {
- @for((key, value) <- lenderMappings) {
- @if(key == "CREDITDEBIT") {
- @for(lenderId <- value) {
- @if(lenderId == inappTransaction.getLenderId()) {
- <div class="payment-option">
- <div class="sec-img"><i class="material-icons md-48">credit_card</i></div>
- <div class="sec-name-select">
- <div class="sec-name">
- <div>Debit/Credit Card</div>
- <div class="charges">Charges <span class="amount">₹ @inappTransaction.getDebitCreditCharges()</span></div>
- </div>
- <div class="sec-select" data-type="C" onclick="redirectToGateway(event)">
- Select
- <i class="material-icons md-48">keyboard_arrow_right</i>
- </div>
- </div>
- </div>
- }
- }
- }
- }
- }
- @if(lenderMappings != null) {
- @for((key, value) <- lenderMappings) {
- @if(key == "NET_BANKING") {
- @for(lenderId <- value) {
- @if(lenderId == inappTransaction.getLenderId()) {
- <div class="payment-option">
- <div class="sec-img"><i class="material-icons md-48">account_balance</i></div>
- <div class="sec-name-select">
- <div class="sec-name">
- <div>Net Banking</div>
- <div class="charges">Charges <span class="amount">₹ @inappTransaction.getNetbankingCharges()</span></div>
- </div>
- <div class="sec-select" data-type="NB" onclick="redirectToGateway(event)">
- Select
- <i class="material-icons md-48">keyboard_arrow_right</i>
- </div>
- </div>
- </div>
- }
- }
- }
- }
- }
- @if(lenderMappings != null) {
- @for((key, value) <- lenderMappings) {
- @if(key == "WALLET") {
- @for(lenderId <- value) {
- @if(lenderId == inappTransaction.getLenderId()) {
- <div class="payment-option">
- <div class="sec-img"><i class="material-icons md-48">account_balance_wallet</i></div>
- <div class="sec-name-select">
- <div class="sec-name">
- <div>Wallet</div>
- <div class="charges">Charges <span class="amount">₹ @inappTransaction.getWalletCharges</span></div>
- </div>
- <div class="sec-select" data-type="W" onclick="redirectToGateway(event)">
- Select
- <i class="material-icons md-48">keyboard_arrow_right</i>
- </div>
- </div>
- </div>
- }
- }
- }
- }
- }
- @if(lenderMappings != null) {
- @for((key, value) <- lenderMappings) {
- @if(key == "UPI") {
- @for(lenderId <- value) {
- @if(lenderId == inappTransaction.getLenderId()) {
- <div class="payment-option">
- <div class="sec-img"><i class="material-icons md-48">phonelink_ring</i></div>
- <div class="sec-name-select">
- <div class="sec-name">
- <div>UPI</div>
- <div class="charges">Charges <span class="amount">₹ @inappTransaction.getUpiCharges</span></div>
- </div>
- <div class="sec-select" data-type="U" onclick="redirectToGateway(event)">
- Select
- <i class="material-icons md-48">keyboard_arrow_right</i>
- </div>
- </div>
- </div>
- }
- }
- }
- }
- }
- </div>
- </div>
- </div>
- <div class="loader-wrapper is-hidden">
- <div class="lds-ripple"><div></div><div></div></div>
- </div>
- <script src="https://code.jquery.com/jquery-3.4.0.min.js"
- integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg="
- crossorigin="anonymous">
- </script>
- <script src="https://checkout.razorpay.com/v1/checkout.js"></script>
- <script>
- $(document).ready(function(){
- $(".slide-toggle").click(function(){
- $(".box").slideToggle();
- });
- });
- </script>
- <script>
- function toggleBankMode(e) {
- var targetElem = e.currentTarget;
- var currentClass = targetElem.classList;
- var iconElem = document.querySelector('.bank-toggle .material-icons');
- // console.log(iconElem.innerHTML);
- var bankOptions = document.querySelector('#bank-options');
- var iconElemText = document.querySelector('.bank-toggle .inner-text');
- if(currentClass.contains('closed')) {
- currentClass.add('open');
- currentClass.remove('closed');
- iconElemText.innerText = '';
- iconElem.innerHTML = 'keyboard_arrow_up';
- bankOptions.classList.add('open');
- } else {
- currentClass.remove('open');
- currentClass.add('closed');
- iconElemText.innerText = 'Select';
- iconElem.innerHTML = 'keyboard_arrow_right';
- bankOptions.classList.remove('open');
- }
- }
- function razorPay (receivedData) {
- var values = receivedData;
- var options = {
- "key": "rzp_live_dvUP9jh2Syuc6q",
- "amount": values["amount"], // INR 299.35
- "name": "SmartCoin Financials",
- "description": "Total payable",
- "image": values["imageUrl"],
- "currency": "INR",
- "handler": function (response){
- <!--alert(response.razorpay_payment_id);-->
- window.location.href = '/pay/successfull?reference=' + response.razorpay_payment_id;
- },
- "prefill": {
- "name": values["name"],
- "email": values["email"],
- "contact":values["contact"],
- "method":values["methodName"]
- },
- "notes": {
- "merchant_order_id": values["merchant_order_id"] || '',
- "user_payment_id": values["user_payment_id"] || '',
- "settelment_amount": values["settelment_amount"] || ''
- },
- "theme": {
- "color": "#343c52",
- "hide_topbar": "true"
- }
- };
- var rzp1 = new Razorpay(options);
- rzp1.open();
- }
- function redirectToGateway(e) {
- var loader = document.querySelector('.loader-wrapper');
- loader && loader.classList.remove('is-hidden');
- // console.log(e.target.dataset.type)
- var paymentType = e && e.target.dataset.type;
- var gatewayPath = '/pay/redirect?type=' + paymentType+'&userId=' + @inappTransaction.getUserId() + '&tag=' + "@inappTransaction.getNotes()";
- $.ajax({
- type: 'GET', url: gatewayPath,
- success: function(data){
- loader && loader.classList.add('is-hidden');
- if(data) {
- razorPay(data);
- }
- },
- error: function(data){
- loader && loader.classList.add('is-hidden');
- alert('Some error occurred while loading payment page');
- }
- });
- }
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment