Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

added santander validator for account number #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clemfinanzero
Copy link

No description provided.

@clemfinanzero
Copy link
Author

Did not updated the tests cases.
Logic used from this info:
http://www.scriptcase.com.br/forum/index.php/topic%2C14020.0.html?PHPSESSID=1flgbgioduld7e435880jqn7m5

SantanderCheckNumberCalculator.prototype = {

calculateAccount: function(agencyNumber,accountNumber) {
var numbers = (agencyNumber + "00" + accountNumber).split("");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this "00" from here if you also remove the 0, 0 from the array at line 27

multiplyAccordingWeight: function(number, index) {
var weight = [9,7,3,1,0,0,9,7,1,3,1,9,7,3];
var res = number * weight[index];
return parseInt(res.toString().substr(-1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a semicolon here

@MateusAndrade
Copy link

There are any updates on this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants