Last active
February 21, 2017 18:28
Revisions
-
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ <div class="form-row cardInfo__cc-num"> <label for="cc-num"><abbr title="required">*</abbr><span>Card Number</span></label> <div class="cc-num__wrap"> <!-- using type="tel" because type="number" doesn’t pass HTML5 form validation with jQuery.payment formatting --> <input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required"> <span class="card" aria-hidden="true"></span> </div> @@ -24,6 +25,7 @@ <input class="button" name="commit" type="submit" value="Make Payment"> <a class="cancel-link" href="/">Cancel</a> </div> </fieldset> </form> -
gosseti revised this gist
Jan 30, 2014 . 2 changed files with 8 additions and 36 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,5 @@ <form accept-charset="UTF-8" action="/payment" class="cardInfo" method="post"> <fieldset class="cardInfo__cardDetails"> <div class="form-row cardInfo__cc-num"> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,14 @@ .paymentInput.identified{ border-color:#2ecc71; } .paymentInput.identified:focus{ border-color:#2ecc71; box-shadow: 0 0 .1875em #2ecc71; } .cc-num__wrap{ position:relative; } .card{ @@ -28,8 +24,7 @@ } .cardInfo__cc-exp, .cardInfo__cc-cvc{ float:left; max-width:4.875em; } @@ -56,13 +51,4 @@ .cc-num.discover + .card{ background:url('discover.png') no-repeat center center; } -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ <label for="cc-num"><abbr title="required">*</abbr><span>Card Number</span></label> <div class="cc-num__wrap"> <input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required"> <span class="card" aria-hidden="true"></span> </div> </div> -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ $(function() { $('.cc-cvc').removeClass('identified'); } } // this runs the above function every time stuff is entered into the card inputs $('.paymentInput').bind('change paste keyup', function() { validateDetails(); }); -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,6 @@ $(function() { var expiry = $('.cc-exp').payment('cardExpiryVal'); var validateExpiry = $.payment.validateCardExpiry(expiry["month"], expiry["year"]); var validateCVC = $.payment.validateCardCVC($('.cc-cvc').val()); // if statement on whether the card’s expiry is valid or not if (validateExpiry) { // if the expiry is valid add the identified class -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,6 @@ $(function() { var validateDetails = function() { // set variables for the expiry date validation, cvc validation and expiry date 'splitter' var expiry = $('.cc-exp').payment('cardExpiryVal'); var validateExpiry = $.payment.validateCardExpiry(expiry["month"], expiry["year"]); @@ -25,7 +24,6 @@ $(function() { // remove again if the cvc becomes invalid $('.cc-cvc').removeClass('identified'); } } // this runs the above function every time stuff is entered into this expiry input $('.paymentInput').bind('change paste keyup', function() { -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 68 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ .cc-num__wrap{ position:relative; } .cardInfo_firstname, .cardInfo_surname{ width:48.75%; } .cardInfo_firstname{ float:left; } .cardInfo_surname{ float:right; } .card{ position:absolute; display:block; right:.375em; top:50%; margin-top:-10px; width:28px; height:19px; background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjEwMHB4IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwIDEwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPGc+CgkJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjExMSw3Ni4yOTZjMCwyLjg0NCwyLjMwNSw1LjE0OCw1LjE0Nyw1LjE0OGg4MS44OTEgICAgYzIuODQxLDAsNS4xNDctMi4zMDUsNS4xNDctNS4xNDh2LTMyLjg5SDMuMTExVjc2LjI5NnogTTY5LjY3OSw1NS42OTdoMTUuOTE0djE1LjkxNEg2OS42NzlWNTUuNjk3eiBNOTAuMTQ5LDE3LjUwM0g4LjI1OCAgICBjLTIuODQyLDAtNS4xNDcsMi4zMDUtNS4xNDcsNS4xNDd2Ny42OTNoOTIuMTg2VjIyLjY1Qzk1LjI5NywxOS44MDgsOTIuOTksMTcuNTAzLDkwLjE0OSwxNy41MDN6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+) no-repeat center center; background-size: 100%; } .cardInfo__cc-exp, .cardInfo__cc-cvc, .cc-exp__live{ float:left; max-width:4.875em; } .cardInfo__cc-exp{ margin-right:.75em; } .cc-num.visa + .card{ background:url('visa.png') no-repeat center center; } .cc-num.amex + .card{ background:url('amex.png') no-repeat center center; } .cc-num.mastercard + .card{ background:url('mastercard.png') no-repeat center center; } .cc-num.diners + .card{ background:url('diners.png') no-repeat center center; } .cc-num.discover + .card{ background:url('discover.png') no-repeat center center; } .paymentInput.identified{ border-color:#2ecc71; } .paymentInput.identified:focus{ border-color:#2ecc71; box-shadow: 0 0 .1875em #2ecc71; } -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 6 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,16 +3,12 @@ <fieldset class="cardInfo__personalDetails"> <div class="input string required cardInfo_firstname form-row"> <label class="string required" for="cardInfo_firstname"><abbr title="required">*</abbr> First Name</label> <input aria-required="true" id="cardInfo_firstname" maxlength="60" name="cardInfo[firstname]" placeholder="e.g. Joe" required="required" type="text"> </div> <div class="input string required cardInfo_surname form-row"> <label class="string required" for="cardInfo_surname"><abbr title="required">*</abbr> Surname</label> <input aria-required="true" id="cardInfo_surname" maxlength="60" name="cardInfo[surname]" placeholder="e.g. Bloggs" required="required" type="text"> </div> @@ -21,29 +17,20 @@ <fieldset class="cardInfo__cardDetails"> <div class="form-row cardInfo__cc-num"> <label for="cc-num"><abbr title="required">*</abbr><span>Card Number</span></label> <div class="cc-num__wrap"> <input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required"> <span class="card"></span> </div> </div> <div class="form-row cardInfo__cc-exp"> <label for="cc-exp"><abbr title="required">*</abbr><span>Expires</span></label> <input id="cc-exp" type="tel" class="paymentInput cc-exp" placeholder="MM / YY" autocompletetype="cc-exp" required="required"> </div> <div class="form-row cardInfo__cc-cvc"> <label for="cc-cvc"><abbr title="required">*</abbr><span>CVC</span></label> <input id="cc-cvc" type="tel" class="paymentInput cc-cvc" placeholder="CVC" autocompletetype="cc-cvc" required="required"> </div> @@ -52,5 +39,5 @@ <a class="cancel-link" href="/">Cancel</a> </div> </fieldset> </form> -
gosseti revised this gist
Jan 30, 2014 . No changes.There are no files selected for viewing
-
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 55 additions and 45 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,46 +1,56 @@ <form accept-charset="UTF-8" action="/payment" class="cardInfo" method="post"> <fieldset class="cardInfo__personalDetails"> <div class="input string required cardInfo_firstname form-row"> <label class="string required" for="cardInfo_firstname"> <abbr title="required">*</abbr> First Name </label> <input aria-required="true" id="cardInfo_firstname" maxlength="60" name="cardInfo[firstname]" placeholder="e.g. Joe" required="required" type="text"> </div> <div class="input string required cardInfo_surname form-row"> <label class="string required" for="cardInfo_surname"> <abbr title="required">*</abbr> Surname </label> <input aria-required="true" id="cardInfo_surname" maxlength="60" name="cardInfo[surname]" placeholder="e.g. Bloggs" required="required" type="text"> </div> </fieldset> <fieldset class="cardInfo__cardDetails"> <div class="form-row cardInfo__cc-num"> <label for="cc-num"> <abbr title="required">*</abbr> <span>Card Number</span> </label> <div class="cc-num__wrap"> <input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required"> <span class="card"></span> </div> </div> <div class="form-row cardInfo__cc-exp"> <label for="cc-exp"> <abbr title="required">*</abbr> <span>Expires</span> </label> <input id="cc-exp" type="tel" class="paymentInput cc-exp" placeholder="MM / YY" autocompletetype="cc-exp" required="required"> </div> <div class="form-row cardInfo__cc-cvc"> <label for="cc-cvc"> <abbr title="required">*</abbr> <span>CVC</span> </label> <input id="cc-cvc" type="tel" class="paymentInput cc-cvc" placeholder="CVC" autocompletetype="cc-cvc" required="required"> </div> <div class="cardInfo__submission"> <input class="button" name="commit" type="submit" value="Make Payment"> <a class="cancel-link" href="/">Cancel</a> </div> </fieldset> </form> -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 19 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,23 +2,34 @@ $(function() { var validateDetails = function() { // set variables for the expiry date validation, cvc validation and expiry date 'splitter' var expiry = $('.cc-exp').payment('cardExpiryVal'); var validateExpiry = $.payment.validateCardExpiry(expiry["month"], expiry["year"]); var validateCVC = $.payment.validateCardCVC($('.cc-cvc').val()); // if statement on whether the card’s expiry is valid or not if (validateExpiry) { // if the expiry is valid add the identified class $('.cc-exp').addClass('identified'); } else { // remove again if the expiry becomes invalid $('.cc-exp').removeClass('identified'); } // if statement on whether the card’s cvc is valid or not if (validateCVC) { // if the cvc is valid add the identified class $('.cc-cvc').addClass('identified'); } else { // remove again if the cvc becomes invalid $('.cc-cvc').removeClass('identified'); } } // this runs the above function every time stuff is entered into this expiry input $('.paymentInput').bind('change paste keyup', function() { validateDetails(); }); }); -
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 46 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,46 @@ <form accept-charset="UTF-8" action="/demos/a-better-card-payment-form" class="simple_form cardInfo" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="sRAFn6dZZqUbp7PpT7RjFb7VQM8VBA1TnivwPQJX7Ak="></div> <fieldset class="cardInfo__personalDetails"> <div class="input string required cardInfo_firstname form-row"><label class="string required" for="cardInfo_firstname"><abbr title="required">*</abbr> First Name</label><input aria-required="true" class="string required" id="cardInfo_firstname" maxlength="60" name="cardInfo[firstname]" placeholder="e.g. Joe" required="required" size="60" type="text"></div> <div class="input string required cardInfo_surname form-row"><label class="string required" for="cardInfo_surname"><abbr title="required">*</abbr> Surname</label><input aria-required="true" class="string required" id="cardInfo_surname" maxlength="60" name="cardInfo[surname]" placeholder="e.g. Bloggs" required="required" size="60" type="text"></div> </fieldset> <fieldset class="cardInfo__cardDetails"> <span class="payment-errors"></span> <div class="form-row cardInfo__cc-num"> <label for="cc-num"> <abbr title="required">*</abbr> <span>Card Number</span> </label> <div class="cc-num__wrap"> <input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required"> <span class="card"></span> </div> </div> <div class="form-row cardInfo__cc-exp"> <label for="cc-exp"> <abbr title="required">*</abbr> <span>Expires</span> </label> <input id="cc-exp" type="tel" class="paymentInput cc-exp" placeholder="MM / YY" autocompletetype="cc-exp" required="required"> </div> <div class="form-row cardInfo__cc-cvc"> <label for="cc-cvc"> <abbr title="required">*</abbr> <span>CVC</span> </label> <input id="cc-cvc" type="tel" class="paymentInput cc-cvc" placeholder="CVC" autocompletetype="cc-cvc" required="required"> </div> <div class="cardInfo__submission"> <input class="button" name="commit" type="submit" value="Make Payment"> <a class="cancel-link" href="/">Cancel</a> </div> </fieldset> </form> -
gosseti revised this gist
Jan 30, 2014 . No changes.There are no files selected for viewing
-
gosseti revised this gist
Jan 30, 2014 . No changes.There are no files selected for viewing
-
gosseti revised this gist
Jan 30, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ $(function() { } // this runs the above function every time stuff is entered into this expiry input $('.cc-exp').bind('change paste keyup', function() { validateExpiry(); }); -
gosseti revised this gist
Jan 30, 2014 . 2 changed files with 12 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ <!-- this should be inside as part of your <form> element --> <div class="form-row cardInfo__cc-exp"> <label for="cc-exp"> <abbr title="required">*</abbr> <span>Expires</span> </label> <!-- we set type="tel" because HTML5 validations don’t play well with type="number" --> <input id="cc-exp" type="tel" data-stripe="expiry" class="cc-exp" placeholder="MM / YY" autocompletetype="cc-exp" required="required"> </div> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,15 +4,15 @@ $(function() { var validateExpiry = function() { // set variables for the expiry date validation and expiry 'splitter' object var expiry = $('.cc-exp').payment('cardExpiryVal'); var validateExpiry = $.payment.validateCardExpiry(expiry["month"], expiry["year"]); // perform an if statement on whether the card’s expiry is valid or not if (validateExpiry) { // if the expiry is valid add the identified class $('.cc-exp').addClass('identified'); } else { // remove is again if the expiry becomes invalid $('.cc-exp').removeClass('identified'); } } -
gosseti created this gist
Jan 30, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ // include jquery and jquery.payment before here $(function() { var validateExpiry = function() { // set variables for the expiry date validation and expiry 'splitter' object var expiry = $('.cc-exp__live').payment('cardExpiryVal'); var validateExpiry = $.payment.validateCardExpiry(expiry["month"], expiry["year"]); // perform an if statement on whether the card’s expiry is valid or not if (validateExpiry) { // if the expiry is valid add the identified class $('.cc-exp__live').addClass('identified'); } else { // remove is again if the expiry becomes invalid $('.cc-exp__live').removeClass('identified'); } } // this runs the above function every time stuff is entered into this expiry input $('.cc-exp__live').bind('change paste keyup', function() { validateExpiry(); }); });