- I unified where in file the name of `NotificationProvider.name` is placed
- I made sure that all the providers adhere to the signature of `NotificationProvider.send()`
- I made sure that all the providers use `okMsg` if returning success messages directly from the function.
Here a discussion should be had:
Should this be refactored into a constant of `NotificationProvider`? I could imagine that `NotificationProvider.SENDING_SUCCESSFULL` could be a suitable alternative.
- I made sure all providers have the URL they `POST`/`GET` to be extraced into a variable.
=> refactored this way due to Nelsons suggestion
The legacy octopush API includes an error code with all responses. A
code other than 000 is an error.
Signed-off-by: Matthew Nickson <[email protected]>
The octopush legacy API does not return a HTTP error code and instead
always returns a HTTP 200. This means that no error it thrown even if
something like the parameters are incorrect.
Instead the error code is given in the json response data.
Therefore we must look at the response data and check for the presence
of the "error_code" key in the response data.
Signed-off-by: Matthew Nickson <[email protected]>
The version number was passed as a string from the frontend but was
checked against a number in the backend provider. This caused the if else
if to fall through into an error. The literal it is now being compared
has been changed to a string and the unknown version error is no longer
encountered.
Signed-off-by: Matthew Nickson <[email protected]>