Jump to content

Checkout jQuery Broken (validating wrong CVV)


gei

Recommended Posts

None of our existing clients were able to checkout since we upgraded to 7.8 - even after switching back to the standard six theme and standard_cart.

Eventually we realized that even though the client was using their "existing card" and filling in the existing card CVV field on the checkout page, WHMCS would not let them click Complete Order because it was trying to verify the CVV in the "enter new card" section.

We fixed this by editing templates/orderforms/standard_cart/js/scripts.js and moving this verification:

            if (!jQuery.payment.validateCardCVC(checkoutForm.find('#inputCardCVV').val(), cardType)) {
                checkoutForm.find('#inputCardCVV').showInputError();
                submit = false;
            }

Inside the

if (newOrExisting === 'new') {

conditional. This solved the issue. You then have to re-minify it and modify the scripts.min.js accordingly

Considering this should affect everyone, I'm surprised no one else has pointed it out yet...

Link to comment
Share on other sites

Is it possible that our own custom gateway is "requiring" the CVV for some reason? If so, how do we remove this requirement. Our payment module is very simple and I don't see any documentation in your gateway module development docs to indicate how to make the CVV an optional field.

This seems to be a similar issue to the one described here:

 

Link to comment
Share on other sites

FYI WHMCS has confirmed this is a bug:

Thank you for following up. The initial issue (the validation of the CVV field) has been confirmed and opened as case #CORE-13710 with our development team for further investigation and correction. In the meantime, the fix provided in the community thread should be sufficient to work around it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated