active_merchant icon indicating copy to clipboard operation
active_merchant copied to clipboard

Support new Naranja validation algorithm

Open mashton opened this issue 1 year ago • 3 comments

Description: Naranja has a new bespoke validation check-digit formula. Like its predecessor, a variation on Luhn mod10. At least for now, Naranja PANs are valid if they pass exactly one of the two algorithms (legacy or new).

Unit Tests: 5938 tests, 79882 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed

Rubocop: 798 files inspected, no offenses detected

Draft Todos:

  • [ ] Verify XOR for two algos
  • [ ] Get a longer list of valid card numbers to test against
  • [ ] Add tests for negative case
  • [ ] Add tests to cover XOR case

See the algorithm description from Naranja below:

naranja_2024

mashton avatar Jun 25 '24 18:06 mashton

Ok.

I now see that this is just Luhn written in a roundabout way. That explains why the algorithm is labeled Luhn 10 😅. I'm going to keep this PR around for a minute while I triple check. I'd like to get an understanding of why this was passed off as a new bespoke algorithm. Guessing communication issues are at play here.

mashton avatar Jun 25 '24 19:06 mashton

Ok.

I now see that this is just Luhn written in a roundabout way. That explains why the algorithm is labeled Luhn 10 😅. I'm going to keep this PR around for a minute while I triple check. I'd like to get an understanding of why this was passed off as a new bespoke algorithm. Guessing communication issues are at play here.

Those cheeky Naranjarians. Taking credit for the Luhn algo.

DustinHaefele avatar Jun 25 '24 19:06 DustinHaefele

@mashton is this one okay to be closed now?

meagabeth avatar Sep 04 '24 20:09 meagabeth