WooCommerce Paya Gateway
-
I am getting this error on my checkout screen when customers enter the Expiration Date format incorrectly:
https://developer.sagepayments.com/docs/errors#400000
Detail : InvalidRequestData : request.Vault: The field CVV must be a string or array type with a maximum length of ‘4’.The format should be MM/YY but the field allows for MM/YYYY. The format is strict and if it is not exact, it will decline the transaction. I have tried adding some js code but it was not successful. The code I tried:
jQuery(function($){
$(document.body).on(‘input’, ‘#sagepaymentsusaapi-card-expiry, input[name=”sagepaymentsusaapi-card-expiry”]’, function(){
let v = this.value.replace(/\D/g, ”).slice(0, 4); // digits only, max 4 (MMYY)
if (v.length >= 3) v = v.slice(0,2) + ‘/’ + v.slice(2);
this.value = v;
});
});The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.