» Click to show Spoiler - click again to hide... «
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="jquery.min.js"></script>
<link rel="stylesheet" href="default.css" type="text/css" />
<script language="javascript" src="default.js"></script>
<script language="javascript">
var fee = "0";
function calc_fee() {
total = 0;
for(i=1;i<=7;i++) {
o = _get("amount_"+i);
if(isNaN(o.value) || o.value<0) {
o.value = 0;
}
total = total + (o.value)*1;
}
amount = _get("amount");
amount.value = format_currency(total,2);
_get("amount_final").innerHTML = "MYR "+format_currency(total,2);
}
function get_symbol(c) {
switch (c.toLowerCase()) {
case "usd": return "$";
case "inr": return "Rs ";
case "eur": return "€";
case "myr": return "MYR ";
}
}
var units = new Array();
units["B"] = ["01-01","01-02","01-03","01-04","01-05","01-06","01-07","01-08","02-01","02-02","02-03","02-04","02-05","02-06","02-07","02-08","03-01","03-02","03-03","03-04","03-05","03-06","03-07","03-08","04-01","04-02","04-03","04-04","04-05","04-06","04-07","04-08","05-01","05-02","05-03","05-04","05-05","05-06","05-07","05-08","06-01","06-02","06-03","06-04","06-05","06-06","06-07","06-08","07-01","07-02","07-03","07-04","07-05","07-06","07-07","07-08","08-01","08-02","08-03","08-04","08-05","08-06","08-07","08-08","09-01","09-02","09-03","09-04","09-05","09-06","09-07","09-08","10-01","10-02","10-03","10-04","10-05","10-06","10-07","10-08","11-01","11-02","11-03","11-04","11-05","11-06","11-07","11-08","12-01","12-02","12-03","12-04","12-05","12-06","12-07","12-08","13-01","13-02","13-03","13-04","13-05","13-06","13-07","13-08","13A-01","13A-02","13A-03","13A-04","13A-05","13A-06","13A-07","13A-08","15-02","15-03","15-04","15-05","15-06","15-07","15-08","16-01","16-02","16-03","16-04","16-05","16-06","16-07","16-08","17-01","17-02","17-03","17-04","17-05","17-06","17-07","17-08","18-01","18-02","18-03","18-04","18-05","18-06","18-07","18-08","19-01","19-02","19-03","19-04","19-05","19-06","19-07","19-08","20-01","20-02","20-03","20-04","20-05","20-06","20-07","20-08""];
units["B1"] = ["01-01","01-02","01-03","01-04","01-05","01-06","01-07","01-08","02-01","02-02","02-03","02-04","02-05","02-06","02-07","02-08","03-01","03-02","03-03","03-04","03-05","03-06","03-07","03-08","05-01","05-02","05-03","05-04","05-05","05-06","05-07","05-08","06-01","06-02","06-03","06-04","06-05","06-06","06-07","06-08","07-01","07-02","07-03","07-04","07-05","07-06","07-07","07-08","08-01","08-02","08-03","08-04","08-05","08-06","08-07","08-08","09-01","09-02","09-03","09-04","09-05","09-06","09-07","09-08","10-01","10-02","10-03","10-04","10-05","10-06","10-07","10-08","11-01","11-02","11-03","11-04","11-05","11-06","11-07","11-08","12-01","12-02","12-03","12-04","12-05","12-06","12-07","12-08","13-01","13-02","13-03","13-04","13-05","13-06","13-07","13-08","13A-01","13A-02","13A-03","13A-04","13A-05","13A-06","13A-07","13A-08","15-01","15-02","15-03","15-04","15-05","15-06","15-07","15-08","16-01","16-02","16-03","16-04","16-05","16-06","16-07","16-08","17-03","17-04","17-05","17-06","18-03","18-04","18-05","18-06","3A-01","3A-02","3A-03","3A-04","3A-05","3A-06","3A-07","3A-08"];
units["B2"] = ["01-01","01-02","01-03","01-04","01-05","01-06","01-07","01-08","02-01","02-02","02-03","02-04","02-05","02-06","02-07","02-08","03-01","03-02","03-03","03-04","03-05","03-06","03-07","03-08","05-01","05-02","05-03","05-04","05-05","05-06","05-07","05-08","06-01","06-02","06-03","06-04","06-05","06-06","06-07","06-08","07-01","07-02","07-03","07-04","07-05","07-06","07-07","07-08","08-01","08-02","08-03","08-04","08-05","08-06","08-07","08-08","09-01","09-02","09-03","09-04","09-05","09-06","09-07","09-08","10-01","10-02","10-03","10-04","10-05","10-06","10-07","10-08","11-01","11-02","11-03","11-04","11-05","11-06","11-07","11-08","12-01","12-02","12-03","12-04","12-05","12-06","12-07","12-08","13-01","13-02","13-03","13-04","13-05","13-06","13-07","13-08","13A-01","13A-02","13A-03","13A-04","13A-05","13A-06","13A-07","13A-08","15-01","15-02","15-03","15-04","15-05","15-06","15-07","15-08","16-01","16-02","16-03","16-04","16-05","16-06","16-07","16-08","17-03","17-04","17-05","17-06","18-03","18-04","18-05","18-06","3A-01","3A-02","3A-03","3A-04","3A-05","3A-06","3A-07","3A-08"];
function loadSubBlocks() {
$("#unit_id").empty().append("<option value=''>(Select Unit)</option>");
units[$("#block_id").val()].forEach(function(entry){
$("#unit_id").append("<option value='"+entry+"'>"+entry+"</option>");
});
}
$(document).ready(function(){
$("#block_id").bind("change",loadSubBlocks);
});
</script>
<title>Pay Online to Condo XYZ</title>
</head>
<body>
<div id="wrapper">
<div id="header">
<h1>Condo XYZ</h1>
</div>
<div id="content">
<h2>Online Payment</h2>
<form method="post">
<fieldset>
<legend>Payment Information</legend>
<p>
<label>* Unit Number:</label>
<select id="block_id" name="block_id">
<option value="">(Select Block)</option>
<option value="B">Block B</option>
<option value="B1">Block B1</option>
<option value="B2">Block B2</option>
</select>
<select id="unit_id" title='Unit Number' name='unit_id'>
<option>(Select Unit)</option>
</select>
</p>
<p>
<label>Instruction/Notes:</label>
<input type="text" name="instruction" title="Instruction" size="40" />
</p>
</fieldset>
<fieldset>
<legend>Amount Paying</legend>
<p>
<label>Service Charge:</label>
MYR
<input name="amount_1" id="amount_1" type="text" value="0" size="8" maxlength="8" title="Service Charge" onkeyup="javascript:calc_fee();" />
</p>
<p>
<label>Sinking Fund:</label>
MYR
<input name="amount_2" id="amount_2" type="text" value="0" size="8" maxlength="8" title="Sinking Fund" onkeyup="javascript:calc_fee();" />
</p>
<p>
<label>Water Charges:</label>
MYR
<input name="amount_3" id="amount_3" type="text" value="0" size="8" maxlength="8" title="Water Charges" onkeyup="javascript:calc_fee();" />
</p>
<p>
<label>Interest Charges:</label>
MYR
<input name="amount_4" id="amount_4" type="text" value="0" size="8" maxlength="8" title="Interest Charges" onkeyup="javascript:calc_fee();" />
</p>
<p>
<label>Insurance Charges:</label>
MYR
<input name="amount_5" id="amount_5" type="text" value="0" size="8" maxlength="8" title="Insurance Charges" onkeyup="javascript:calc_fee();" />
</p>
<p>
<label>Quit Rent:</label>
MYR
<input name="amount_6" id="amount_6" type="text" value="0" size="8" maxlength="8" title="Quit Rent" onkeyup="javascript:calc_fee();" />
</p>
<p>
<label>* Total Amount Paying:</label>
<select name="currency" id="currency" onchange="javascript:calc_fee()" style="display:none;">
<option selected="selected" value="myr">MYR</option>
</select>
MYR
<input name="amount" id="amount" type="text" value="0" size="8" maxlength="8" title="Total Amount Paying" onkeyup="javascript:calc_fee();" readonly />
</p>
</fieldset>
<fieldset>
<legend>Payee's details</legend>
<p>
<label>* Your Full Name:</label>
<select name="prefix_name" id="prefix_name" name="Prefix" title="Prefix">
<option value="">(Select Prefix)</option>
<option>Mr</option>
<option>Mrs</option>
<option>Ms</option>
</select>
<input name="full_name" type="text" id="full_name" size="40" maxlength="128" title="Full Name" />
</p>
<p>
<label>* Your Email Address:</label>
<input name="email" type="text" id="email" size="40" maxlength="128" title="Email Address" />
<span class="hint">Receipt would be sent on this email address.</span>
</p>
<p>
<label>* Phone Number:</label>
<input type="text" name="phone" title="Phone Number" size="20" />
<span class="hint">including code, eg. Code (012) 123 4567</span>
</p>
</fieldset>
<fieldset>
<legend>Payment Type</legend>
<p>
<label>Date of Payment:</label>
<span style="font-weight:bold;">19 November 2018</span>
</p>
<p>
<label>Amount Paying</label>
<span style="font-weight:bold; font-size:16px;"><span id="amount_final">0.00</span>
</span>
</p>
<p>
<label>* Credit Card Type:</label>
<select name='cc_type' id="cc_type" title="Credit Card Type">
<option value="">(Select)</option>
<option>Visa</value>
<option>Mastercard</value>
</select>
</p>
<p>
<label>* Credit Card Number:</label>
<input name="cc_num" type="text" id="cc_num" size="20" maxlength="16" title="Credit Card Number" />
<span class='hint'>16 digit number without space or dash.</span>
</p>
<p>
<label>* Credit Card Expiry:</label>
<select name='cc_mm' id="cc_mm" title="Credit Card Expiry (Month)">
<option value="">(Month)</option>
<option value="01">01</value>
<option value="02">02</value>
<option value="03">03</value>
<option value="04">04</value>
<option value="05">05</value>
<option value="06">06</value>
<option value="07">07</value>
<option value="08">08</value>
<option value="09">09</value>
<option value="10">10</value>
<option value="11">11</value>
<option value="12">12</value>
</select>
<select name='cc_yy' id="cc_yy" title="Credit Card Expiry (Year)">
<option value="">(Year)</option>
<option>2018</option><option>2019</option><option>2020</option><option>2021</option><option>2022</option><option>2023</option><option>2024</option><option>2025</option><option>2026</option><option>2027</option> </select>
</p>
<p>
<label>* CVV2:</label>
<input name="cc_cvv" type="password" id="cc_cvv" size="4" maxlength="3" title="Credit Card CVV2" />
<span class='hint'>3 digit number found on the back of your Credit Card</span>
</p>
</fieldset>
<p class="buttons">
<input type="submit" onclick="
MM_validateForm(
'unit_id','','isSelect',
'prefix_name','','isSelect',
'full_name','','R',
'email','','RisEmail',
'phone','','RisNum',
'cc_type','','isSelect',
'cc_num','','RisNum',
'cc_mm','','isSelect',
'cc_yy','','isSelect',
'cc_cvv','','RisNum'
); return document.MM_returnValue" value="PAY"
/>
</p>
</form>
</div>
<div id="footer">
<div class="copyright">© Copyright <a href="#">Condo XYZ</a>, 2008 - 18. All rights reserved.</div>
<div class="footer-link">Powered by <a href="http://www.abc.com/?_ref=vkw" title="abc: Application Developer ">ABC</a></div>
</div>
</div>
</body>
</html>
My condo management got someone to set up an online payment form to facilitate credit card payments instead of using one of the payment gateways. The full webpage code is in the spoiler above.
Can someone familiar with html / javascript explain how the info submitted is passed to the payment gateway / bank for processing? Which part(s) of the code does that?
For information, this form is implemented on our building manager's website (non-https). I myself don't dare use it because I think my CC# and CVV can be hijacked during transmission (no https) as well as captured by the building manager.
Any web developers here? TIA
>>Mods - apologies if wrong place to post
This post has been edited by okuribito: Nov 19 2018, 05:52 PM
Nov 19 2018, 05:50 PM, updated 8y ago
Quote
0.0164sec
0.58
6 queries
GZIP Disabled