ingenesis/shopp — pull request #3168 by UltraSimplified (2014-12-17 23:19:36+00:00)
Title: Added an entry for Delta so it can be displayed in the SagePay Add-on. #3167

The SagePay payment gateway addon displays a list of available cards that can be used with SagePay. One of these is Visa Debit/Delta (common in the UK). Unfortunately as there is no corresponding entry in the Shopp Lookups file, this option does not appear in the Shopp Gateway settings page or in the front-end when a user makes a purchase.

I have added in an entry here as a temporary workaround. I have tested this on a production site and can confirm that it works as expected.

Please note the pattern-matching algorithm is directly copied from the entry for Visa on the line above and will match all Visa cards. This means that a user could potentially place a Visa credit card order as a debit order if they chose to.

I have looked for a suitable REGEX to use here for matching Visa Debit/Delta cards but the best I have found so far is a list of BIN prefixes. Here they are for reference:

(^413733|^413734|^413735|^413736|^413737|^4462|^453978|^453979|^454313|^454313|^454432|^454433|^454434|^454435|^454742|^456725|^456726|^456727|^456728|^456729|^45673|^456740|^456741|^456742|^456743|^456744|^456745|^46583|^46584|^46585|^46586|^46587|^484409|^484410|^49096|^49097|^492181|^492182|^498824)

taken from http://eflo.net/downloads.php (Mod10 js card number parser)