Oct 13, 2014 04:45 AM|PatriceSc|LINK
i've coded around their deficiencies
It seems a PayPal issue ??
Newer does not always mean better
Sure but you may still want to wonder why basically ALL languages moved to exception handling.
If unecessary it is a PayPal issue. If something is wrong you should have an exception and the overhead doesn't matter as this is something that should not happen .
#1 sure but if something wrong happens it should fail by default rather than to keep running by default unless you thought to check each and every call
#2 see again how exception are working. You can handle the exception where it makes more sense.
A. Don"t know the PayPal API. The code could actually achieve the expected result even if the PayPal librairies fails to retrieve the token ?
B. IMO their doc should tell they expect a decimal. But you won't have this problem if on your side you work with numeric types rather than with strings. This is just a way to workaround this paypal issue and the doc issue is a PayPal issue as well (and
in general it's best to always work with the type that makes more sense).
If you wish you can still wrap the PayPal API and transform those exceptions into status code.
Not sure what it is but I would suggest to definitely post about the actual issues you have (maybe in a PayPal forum. You have that much exceptions? Is this because some kind of service is not reliaable and that doing exactly the same operation a bit later
will then work ?)