Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this be used directly in the browser? #1

Closed
atwright147 opened this issue Oct 12, 2015 · 5 comments
Closed

Can this be used directly in the browser? #1

atwright147 opened this issue Oct 12, 2015 · 5 comments

Comments

@atwright147
Copy link
Contributor

Hi,

Can this be used directly in the browser?

I have built and browserified the code which successfully brings in the weightTable etc. Can I use this directly in the browser and ideally without require.js etc?

Many thanks,

Andy

P.S. Awesome library.

@liamja
Copy link
Owner

liamja commented Oct 13, 2015

Hi Andy

I haven't tested this in the browser yet, but I'm aiming for it to be usable across both browser and headless environments.

Once this library has most of the VocaLink exceptions covered, I'll work on adding support for NPM/Bower and in-browser testing.

What you can do for now is use Browserify's standalone output.

$ npm build
$ browserify build/modcheck.js --standalone Modcheck > build/modcheck_bundle.js
<html>
    <head>
        <script src="build/modcheck_bundle.js"></script>
    </head>
    <body>
        <script>
            var modcheck = new Modcheck('66374958', '08-99-99');

            if (modcheck.check()) {
                console.log('This account number could potentially be registered to this sort code.');
            } else {
                console.log('This account number could NOT be registered to this sort code.');
            }
        </script>
    </body>
</html>

Hope that helps.

@atwright147
Copy link
Contributor Author

That is awesome! Thank you :)

@atwright147
Copy link
Contributor Author

Which exceptions are you missing?

@atwright147
Copy link
Contributor Author

If you can let me know what needs doing, I and a couple of colleagues would be interested in seeing if we can help :)

@liamja
Copy link
Owner

liamja commented Nov 16, 2015

Take a look at the attached PDF (Section 5.2) that documents all of VocaLinks "Exceptions".

These need to be implemented for 100% compatibility, otherwise checks will fail when they should pass. You'll see I've made a start on a couple of them.

Any PRs implementing these exceptions are very welcome!

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

No branches or pull requests

2 participants