-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add rake task to sync using AusPayNet API #61
Conversation
cb7aa32
to
928d5c3
Compare
928d5c3
to
d9b44dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work. Thank you @astley92.
Just a minor nitpick on the typo in the README. Otherwise, good to go.
Signed-off-by: David Looi <david@coinjar.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested the rake task, and updated the bank list with it. It worked flawlessly.
Thank you @astley92 👍
Thanks for fixing those up and merging @davelooi I did plan to come back to this tonight haha beat me to it. No problems, OOC would you be interested in the suggestion in the PR description on automating this a step further through a Github action that utilises this? Was thinking an action that runs once daily that uses this new task and makes a PR if any changes are present. It would need access to an API key stored in the repo secrets so would need an admin user to make that available. Then the only thing to do when an update is due would be to review and merge a PR Let me know, I'm happy to put something together :) |
Yes, automating this process is an excellent idea. I have added a GHA secret We don't have to run this daily though. AusPayNet only pushes updates to production once a month. Having it run weekly should be sufficient.
|
Thanks for maintaining this gem!
I recently saw that Australian Payments Network have taken down the FTP server that was previously used to update the database and bank list and have released an API that can be used to update the bsb db content. So figured I'd make this PR and see if you were interested in merging.
Why
The current process to update the bsb database file is quite manual and can be made easier, especially given Australian Payments Network have introduced an API to fetch BSB data.
What
Adds a new rake task
rake bsb:sync_bsb_db
that uses the API to fetch latest BSB data and generate a new DB along with an outline of what changes have been made.Splits the existing rake task into two. This is to ensure that the bank list task can still be run when required since it isn't updated in this PR and also to keep redundancy in case the API is down or something here breaks. There will still be a manual process to fall back to.
Updates README to reflect the above.
Discussion
This could be taken a step further again by using this rake task in a GHA that would create a PR if any changes are present. I'd be happy to put that together as well if it is something you'd be interested in?