Closed Sup3r-Us3r closed 2 years ago
Hey @Sup3r-Us3r thanks a lot for your contribution. Many thanks also to everyone who is watching this discussion. @andreeluis, @joaovdl, @marcelocruzsilverio, @lucasfelype, @cinthia-tondinelli @anderson101251 and @isaoliveira003
Sorry for the delay in reviewing and approving your PR, I recently had some personal issues that prevented me from reviewing this library. For a payment library this time is an eternity, it won't happen again!
I've already approved your PR and updated some deprecated dependencies, also released version v1.0.13 here on github and published on npm.
I'm also Brazilian :brazil: :brazil: :brazil: and I really liked your idea of translating the error messages into Brazilian Portuguese, what do you think about including this and other language translations into the library? We can receive the language as a parameter when creating the gateway and return the translated friendly message, the call to instantiate the gateway would look something like:
var mpGateway = maxipago.buildGateway(maxiPagoID, maxiPagoKEY, maxiPagoEnv, "pt-br");
- for Brazilian Portuguese
or
var mpGateway = maxipago.buildGateway(maxiPagoID, maxiPagoKEY, maxiPagoEnv, "fr");
- for French
or
var mpGateway = maxipago.buildGateway(maxiPagoID, maxiPagoKEY, maxiPagoEnv, "de");
- for German
etc...
Remembering that this parameter would be optional to prevent not to break for those who already use this library. What do you all think? Shall we open an issue to work on this?
Thank you very much and see you later!
Some errors I had when using this SDK were not returned in a way that was easy to identify, very generic errors for example:
errorCode 1
and no message.With the addition of this attribute, it became much easier to identify which error was returned, for example:
I also had a need to translate these error messages that are in English into Portuguese, to return in a friendly way to the end user, a deal like this:
And to use and treat the value that comes from this attribute I would do:
It would be very interesting if you can accept the pull request, I'm currently using this lib to perform this integration, but I needed to add this
errorXML
attribute to satisfy the error handling, and to get around this problem temporarily I used the patch-package.