When your shoppers submit their payment details at checkout, Turbify stores the full credit card number, but only displays the last four digits. This is a standard practice in ecommerce, and is done to comply with industry security requirements. Most stores use our standard credit card validation and won’t be affected by recent changes.
However, those stores that use custom validation at checkout need to be careful--some implementations may interrupt the checkout process in a manner that interferes with payment detail storage. For example, some stores may see a checkout error:
There was an issue validating your payment information, please reenter your credit card number.
This error is caused by either issues with custom validation or the credit card field being left blank during checkout.
For example, let’s say you’ve added some custom fields to your checkout that need validation before the order can be completed. Typically this is done using a JavaScript that:
1. Interrupts the order submission;
2. Reads custom fields;
3. Validates input for those custom fields; and
4. Either stops the order submission or continues the order flow.
Problems can arise in the validation step above if the truncation described above is not taken into account.
To avoid these problems, your form input should be validated within a Javascript prehook function as defined below.
<script type="text/javascript">
window.onload = function() {
if (typeof YSBCheckout != "undefined" ){
YSBCheckout.checkoutPreHook = function(frmObj) {
// perform validation here
// return true / false
}
}
}
</script>
Exaclty how do you use the prehook? In this example, we’re collecting a shoppers’ driver's license numbers via a custom field we’ve added, customFieldDS.customfield_ROW1_value. The prehook checks this field to see if it is populated, continuing if there is a value and returning an error if it’s empty.
<script type="text/javascript">
window.onload = function() {
if (typeof YSBCheckout != "undefined" ){
YSBCheckout.checkoutPreHook = function(frmObj) {
if (frmObj["customFieldDS.customfield_ROW1_value"].value === "") {
alert("Please supply your driver's license number.");
return false;
} else {
return true;
}
}
}
}
</script>
Please note that the checkoutPreHook function is only present on the checkout step that collects shoppers’ payment information.