The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Limiting the credit cards available

bjbkbjbk Member
in Bugs & Feature Requests edited November 2009
Hey all,

I may have missed something here, but is there a way to let FoxyCart know exactly what credit card numbers it should validate successfully? An issue arose today where a customer put through an order using an AMEX card on a clients store who is doing offline processing, and is unable to process AMEX cards. I've since added in logos to denote what cards are accepted, but was wondering if it was possible to go that extra step to prevent this in the future.
Comments
  • brettbrett FoxyCart Team
    Good question. With offline processing it's slightly trickier, since you're not getting the hard errors from the gateway.

    What you could do (and I'm pretty sure others have done) would be to do a function on keyup and display an error if they start it with a 3 (AmEx) or 6 (Discover). (Worth noting is that there actually is some overlap, but the vast majority of Visas and MCs start with 4 and 5, respectively. v060 actually has some neat stuff to detect exactly what card is being entered, so you could set up a test store, flip it to v060, and copy that code out to use on your current store. Might be more trouble than it's worth though.)

    As far as why this isn't built into FoxyCart: This is one of those things that would be tricky for us to truly support the way it should be, since each country has unique cards and codes and numbers. Also, there's no way to query gateways to check what cards are accepted, so it'd have to be a manual thing. We'd rather leave the flexibility in your hands than restrict you.

    Thoughts on the whole thing?
  • lukeluke FoxyCart Team
    Also worth noting, you could override FC.validator.validateCreditCard to throw an error if an AMEX card number is given.
  • Seriously? There's no simple series of checkboxes to select which payment methods are supported? That's dissappointing. I have the same situation where I don't take AMEX, but my checkout screens say I do. Are there any new developments to make this not so manual?
  • brettbrett FoxyCart Team
    In v060 the card logos are now set in the store's language settings, so it's a lot easier to remove a logo. Give that a try. It won't throw a javascript error if an AmEx is entered unless you tweak the js a little, but it'll hard error when it hits your gateway.
Sign In or Register to comment.