Centralize error handling and prune dead null-checks#9
Conversation
|
Thanks again for the cleanup work and the thoughtful approach here :) I’ll review and test the draft carefully, and most likely include it in the next update after a bit more validation. I really appreciate the effort and ideas around improving the maintainability and reliability of the project. And of course, any further feedback, suggestions or contributions are always very welcome. Happy to improve the project together |
|
Thanks :) The Management API is missing the terminal payment methods endpoint => https://saferpay.github.io/jsonapi/#rest_customers_customerId_terminals_terminalId_payment-methods It seems to me that the rest looks fine, otherwise, maybe just a couple of small things to clarify on the side. I'll open separate PRs for the terminal payment methods endpoint and a few of the smaller cleanup ideas I mentioned, so we can keep things easy to review one at a time |
|
if that works for you, I'll create issues outlining what I see as improvements to the project, and a pull request will be linked to the issue |
|
Hi @D0LBA3B I really appreciate all the contributions and feedback, thank you :) I originally built and used this library for one of my own projects, but I’m not actively using Saferpay at the moment anymore, so lately I’ve mainly been trying to keep the library aligned with the official documentation. Because of that, there will probably always be small gaps or missing pieces here and there. Having support from someone actively using the API is honestly very valuable, and I think with your contributions the library can become much more solid and useful over time. Thanks again. |
|
@viwodev Thanks, I really appreciate it I'll keep pushing stuff as I hit it on my side, makes sense to share back since it benefits both of us |
|
Absolutely 🙂 I’ve added you as a collaborator. Since you’re actively using the library, I think your feedback and contributions will help the project improve much faster and in a much more practical direction. Really appreciate all the help and effort so far. Thanks! |
Round 2 after #8, nothing functional this time, just cleanup so the lib is easier to maintain
There were two helper methods sitting in
SaferPayClientthat nobody was calling, so every request method ended up repeating the same error-handling block. I rewired everything through them pulled a couple of small helpers out, and the file shrinks a lotOn the
Channels/side I also dropped the null checks on_clientsince the field isreadonlyand always set in the ctor, which made every method a one-liner. Plus a tiny empty file inHelpers/that nobody actually usedI'm leaving this as a draft on purpose, because I'd rather we see if we can keep things clean and make them more reliable before releasing a new version with every change, so that the next one is spotless
We should also talk a bit about what's next. I'm not exactly sure how the Saferpay documentation aligns with the project, or what parts of the API still need to be implemented :)