Is it possible to encrypt our credit card information entered by user on my website's payment form?
<form method="post" action="/doDirect" enctype="application/x-www-form-urlencoded">
Card Number:<br>
<input type="text" name="card_number" placeholder="CARD NUMBER" id="ccnum" ><br>
First Name:<br>
<input type="text" name="firstName" placeholder="FIRST NAME"><br>
Last Name:<br>
<input type="text" name="lastName" placeholder="LAST NAME"><br>
Card Type:<br>
<select name="ctype" id="ctype" required="required">
<option value="visa">VISA</option>
<option value="master">MASTER</option>
<option value="maestro">MASTERO</option>
<option value="americanexpress">AmericanExpress</option>
</select>
<br>
Expire Date:
<br>
<select name="exmonth" required="required">
<option value="">Month</option>
#for(i<-1 to 12){
#if(i<10){
<option value="0#i">0#i</option>
}else{
<option value="#i">#i</option>
}
}
</select>
/
<select name="exyear" required="required">
<option value="">Year</option>
#for(i<-1990 to 2033){
<option value="#i">#i</option>
}
</select> <br>
CVV2:<br>
<input type="text" name="cvv2" max="999" maxlength="3" required="required">
</div>
}
<input type="submit" value="Checkout" onclick="return isValidCreditCard()">
</form>
If we see, Braintree provides the encryption javascripti so then we won't get the real human readable entry.
Braintree example to do so
<h1>Braintree Credit Card Transaction Form</h1>
<div>
<form action="/create_transaction" method="POST" id="braintree-payment-form">
<p>
<label>Card Number</label>
<input type="text" size="20" autocomplete="off" data-encrypted-name="number" />
</p>
<p>
<label>CVV</label>
<input type="text" size="4" autocomplete="off" data-encrypted-name="cvv" />
</p>
<p>
<label>Expiration (MM/YYYY)</label>
<input type="text" size="2" name="month" /> / <input type="text" size="4" name="year" />
</p>
<input type="submit" id="submit" />
</form>
</div>
And here is the Js
<script src="https://js.braintreegateway.com/v1/braintree.js"></script>
<script>
var braintree = Braintree.create('MIIBCgKCAQEA2ob0KfqpQ2xuy0zlq2a/amOuu0zkVdNHo45xSQVDErJEf2e/8rrAq40eh3C1sjm8DTFt8HLMvPDwi+nmOimuXQwdtkmszmMnJI5HLlvOCPyEgIxPgjKeyE3wzLOtDCMuQ3zKX2yU/v0rhqu4bng5knFoNLjjN6eet00u4Z5Jp84eDeZgevh1+Yb6Ca6P2iLQQherBupxmiKzAtImeyoeUoLDmBO68CFZd0rvxaKbUQ9yW+pHywpQrkSoQs9Z9J9W6HZ+w2YpYWmV0z2tJmYo8RvnKwyplFEC0EPZ+IPXJatcqQlTjQXhboXnCx2WZDQuVdzIRudmxLOM6m+hGetG1wIDAQAB');
braintree.onSubmitEncryptForm('braintree-payment-form');
</script>
Is there any way given by the paypal to encrytp the data using JS or any other tool?
Hope for the positive response
Honest answer.
Don't.
Just ... don't.
PCI compliance is a nasty, hairy beast.
If you handle any Card Holder data, there is LOT that you have to do.
Most folks will "call out" to a credit card server provider who will handle the data then call your website back with a simple "accept/reject" code that you can then respond to.
For a quick overview, see:
http://www.pcicomplianceguide.org/pcifaqs.php
Related
I am importing a form written in GoogleApps Script into an iframe on a page built with Squarespace but for the life of me cannot prevent the form from submitting. I am using:
window.addEventListener( 'load', preventFormSubmit );
as suggested in GAS documentation but this does not seem to be triggering the preventFormSubmit function. Instead, when the submit button is clicked the form submits and goes to a blank google page. Also the alerts in the preventFormSubmit function (now commented out) never display which suggests that the form is never called.
I have spent days on this, cannot find an answer anywhere and can no longer see the woods for the trees. Any clues as to what I am doing wrong?
Squarespace is a website builder which enables one to embed code, in this case as an iframe.
My code:
js.html:
<script>
function preventFormSubmit() {
//alert( "prevent form submit triggered" );
var forms = document.querySelectorAll('form');
for (var i = 0; i < forms.length; i++) {
forms[i].addEventListener('submit', function(event) {
event.preventDefault();
});
}
//alert( "forms prevented from submitting: " = forms.length );
}
window.addEventListener( "ready", preventFormSubmit );
function handleFormSubmit(formObject) {
google.script.run
.withSuccessHandler( showSuccess )
.withFailureHandler( showError )
.processForm_1( formObject );
}
</script>
html:
<!DOCTYPE html >
<head>
<base target="_top" >
<?!= include('css'); ?>
<?!= include('js'); ?>
</head>
<body>
<div id="formDiv" class="card" >
<h2 id="title" >Alternative Booking form</h2>
<form id="alternative-booking-form-1" onsubmit="handleFormSubmit(this)" >
<fieldset>
<legend>About You</legend>
<p>Please tell us a bit about yourself.
</p>
<input type="text" id="firstName" name="firstName" form="alternative-booking-form-1"
placeholder="your first name" value="" required
/><br />
<input type="text" id="lastName" name="lastName" form="alternative-booking-form-1"
placeholder="your last name" value="" required
/><br />
<input type="text" id="title" name="title" form="alternative-booking-form-1"
placeholder="your title, eg: mr, mrs, ms etc" value="" /><br>
</fieldset>
<fieldset>
<legend>Your Contact Details</legend>
<p>We will only use your contact details in case we need to contact you with regard to
this booking, unless you consent
to further communications, as offered later in this booking process.</p>
<input type="email" id="email" name="email" form="alternative-booking-form-1"
placeholder="your email address" value=""
required /><br />
<input type="tel" id="phone" name="phone" form="alternative-booking-form-1"
placeholder="phone" value="" required /><br />
</fieldset>
<fieldset>
<input type="hidden" id="form" name="form" form="alternative-booking-form-1" value="1" />
<br />
<input type="submit" id="submit" name="submit" form="alternative-booking-form-1"
class="red" value="Next →" />
<br />
<br />
</fieldset>
</form>
</div>
<div id="output" name="output" ></div>
</body>
<!DOCTYPE html >
<head>
<base target="_top" >
<?!= include('css'); ?>
<?!= include('js'); ?>
</head>
<body>
<div id="formDiv" class="card" >
<h2 id="title" >Alternative Booking form</h2>
<form id="alternative-booking-form-1" >
<fieldset>
<legend>About You</legend>
<p>Please tell us a bit about yourself.
</p>
<input type="text" id="firstName" name="firstName" form="alternative-booking-form-1"
placeholder="your first name" value="" required
/><br />
<input type="text" id="lastName" name="lastName" form="alternative-booking-form-1"
placeholder="your last name" value="" required
/><br />
<input type="text" id="title" name="title" form="alternative-booking-form-1"
placeholder="your title, eg: mr, mrs, ms etc" value="" /><br>
</fieldset>
<fieldset>
<legend>Your Contact Details</legend>
<p>We will only use your contact details in case we need to contact you with regard to
this booking, unless you consent
to further communications, as offered later in this booking process.</p>
<input type="email" id="email" name="email" form="alternative-booking-form-1"
placeholder="your email address" value=""
required /><br />
<input type="tel" id="phone" name="phone" form="alternative-booking-form-1"
placeholder="phone" value="" required /><br />
</fieldset>
<fieldset>
<input type="hidden" id="form" name="form" form="alternative-booking-form-1" value="1" />
<br />
<input type="button" id="submit" name="submit" form="alternative-booking-form-1"
class="red" value="Next →" />
<br />
<br />
</fieldset>
</form>
</div>
<div id="output" name="output" ></div>
<script>
window.onload = function() {
document.getElementById("alternative-booking-form-1").addEventListener( "ready", handleFormSubmit );
}
function handleFormSubmit(formObject) {
google.script.run
.withSuccessHandler( showSuccess )
.withFailureHandler( showError )
.processForm_1( formObject );
}
</script>
</body>
hey here is the code whenever my site is converted into the mobile view then mailto function is not working? can anyone suggest to me a solution to how he is works in mobile-view?
<form id="myForm" action="mailto:syedali6097#gmail.com" method="post" enctype="text/plain">
<h2>Win</h2>
<input name="name" type="text" placeholder="Enter Name">
<br><br>
<input name="subject" type="text" placeholder=" Subject">
<br><br>
<!-- <label>Email:-</label> -->
<input name="email" type="text" placeholder="Enter Email">
<br><br>
<input name="number" type="number" placeholder=" Enter Phone Number">
<br><br>
<p class="text-center">Fave Vape Flavour:-</p>
<textarea type="text" name="Description" size="50" rows="5" placeholder="Type Message"></textarea>
<br><br>
<input type="submit" value="Send" onclick="myFunction()">
<input type="reset" value="Reset">
</form>
I'm trying to implement Auto-fill Paypal checkout in my website, but it is not getting the country I provide. It can only get the quantity after submit. Please see the code below:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<div class="form-group">
<input type="hidden" name="on0" value="Country">
<label class="control-label">Country</label>
<select name="os0" class="form-control">
<option value="US">US</option>
</select>
</div>
<div class="form-group">
<input type="hidden" name="on0" value="Quantity">
<label class="control-label">Quantity</label>
<select name="os0" class="form-control">
<option value="11 units">11 units $3,000.00</option>
<option value="21 units">21 units $6,000.00</option>
<option value="51 units">51 units $12,500.00</option>
</select>
</div>
</form>
I just want a simple form that sends the user to an adress with a added value from the form. Like http://example.com(value from input name "epost")
Is it possible to do that without any script etc?
<form method="get" action="http://google.com">
E-post:<br>
<input type="text" name="epost">
<p>
Organisation
<select name="organisation">
<option value="1">org 1</option>
<option value="2">org 2 Korset</option>
</p>
</br>
<input type="submit" value="Done">
</form>
You can send params in url using GET:
<form action="http://www.google.com/search" target='_blank'>
Key word:
<input type='text' name='q' value='Rob' />
<input type='submit' />
</form>
<a href="http://www.google.com/search?q=Rob" target='_blank'>Search for Rob</a>
is there anyway at all that i can get the number of lessons chosen to be multiplied by the lesson type and then displayed as a total near the form? It would be far easier for people filling out the form to have an automated calculation rather than having to have to calculate it themselves.
<h4>Lesson Form</h4>
<form action="mailer.php" data-validate="parsley" method="post" >
<p><strong>Full Name<span class="red">*</span></strong></p>
<input name="cf_name" data-required="true" class="send" type="text" />
<p><strong>Email Address<span class="red">*</span></strong></p>
<input name="cf_email" data-required="true" data-type="email" class="send" type="text" />
<p><strong>Cellphone No.<span class="red">*</span></strong></p>
<input name="cf_cell" data-required="true" class="send" type="text" />
<p><strong>Instrument Type<span class="red">*</span></strong></p>
<select name="cf_instrument" size="1" class="option" >
<option value="Piano">Piano</option>
<option value="Vocals">Vocals</option>
<option value="Guitar">Guitar</option>
<option value="Bass">Bass</option>
<option value="Flute">Flute</option></select>
<p><strong>Lesson Type<span class="red">*</span></strong></p>
<select name="cf_package_type" size="1" class="option">
<option value="Beginner Lesson - R100">Beginner Lesson - R100</option>
<option value="Advanced Lesson - R130">Advanced Lesson - R130</option>
<option value="Professional Lesson - R160">Professional Lesson - R160</option></select>
<p><strong>No. of Lessons<span class="red">*</span></strong></p>
<select id="number-of-lessons" name="cf_number" size="1" class="option" onchange='test()'>
<option value="1" selected="selected">1</option>
<option name="2" value="2">2</option>
<option name="3" value="3">3</option>
<option name="4" value="4">4</option></select>
<script src="js/datepair.js"></script>
<p><strong>Lesson Date & Time<span class="red">*</span></strong></p>
<p class="datepair" data-language="javascript">
<input type="text" name="cf_booking_date" class="date start" data-required="true" />
<input type="text" name="cf_start_time" class="time start" data-required="true" /> to
<input type="text" name="cf_end_time" class="time end" data-required="true" /></p>
<script src="js/datepair.js"></script>
<p id="lesson-2" class="datepair" data-language="javascript">
<input type="text" name="cf_booking_date" class="date start" data-required="true" />
<input type="text" name="cf_start_time" class="time start" data-required="true" /> to
<input type="text" name="cf_end_time" class="time end" data-required="true" /></p>
<script src="js/datepair.js"></script>
<p id="lesson-3" class="datepair" data-language="javascript">
<input type="text" name="cf_booking_date" class="date start" data-required="true" />
<input type="text" name="cf_start_time" class="time start" data-required="true" /> to
<input type="text" name="cf_end_time" class="time end" data-required="true" /></p>
<script src="js/datepair.js"></script>
<p id="lesson-4" class="datepair" data-language="javascript">
<input type="text" name="cf_booking_date" class="date start" data-required="true" />
<input type="text" name="cf_start_time" class="time start" data-required="true" /> to
<input type="text" name="cf_end_time" class="time end" data-required="true" /></p>
<!-- HIDDEN FIELD - HONEYPOT ANTI_SPAM -->
<input id="website" class="using" name="website" type="text" />
<!-- END -->
<input name="Submit" class="submit" value="Book Now" type="submit" /></form>
Would you so great if you could help me with this!
Here's a solution using Javascript.
explanation:
every time the option changes, I'm recalculating the multiplication of the chosen values.
HTML (simplified version of what you have. Notice how I changed the value of your options.)
<select id="lesson-type" onchange='calculate()'>
<option value="100">Beginner Lesson - R100</option>
<option value="130">Advanced Lesson - R130</option>
<option value="160">Professional Lesson - R160</option>
</select>
<select id="number-of-lessons" onchange='calculate()'>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<label id="result"></label>
JS:
function calculate() {
var l_type = document.getElementById("lesson-type").value;
var num_lessons = document.getElementById("number-of-lessons").value;
document.getElementById("result").innerHTML = l_type * num_lessons;
}
Edit:
in this Example I also call the function once the page loads.
If you want to create simple web calculator with Javascript I would recommend you to take a look at “Appizy”.
It converts instantly a spreadsheet into a standalone web calculation tool in HTML+CSS+JAVASCRIPT. You don’t need to hardcode the whole interface and calculation formulas!
Just create your working calculator with Open- or LibreOffice and then use Appizy.
I hope it can help. Best,
Nicolas