larafale / mangopay

Mango API Wrapper
22 stars 19 forks source link

Birthday 0 leads to error #54

Closed mstn closed 8 years ago

mstn commented 9 years ago

0 is the unix time for 01/01/1970. Hence, it is a legitimate value. However, when a user is created with birthday field set to 0, this error is raised:

 Error: parameter "Birthday" is required

The reason is obviously here https://github.com/larafale/mangopay/blob/master/lib/httpMethod.js#L34

fix commented 9 years ago

put unix time + 1 millis to each date....

mstn commented 9 years ago

It is what I did. But it is a hack. Imo the lib should handle this case. However, I understand it is a lesser issue.

godspeedelbow commented 8 years ago

Yeah, this is an easy fix. The first one who files a PR gets five karma points

godspeedelbow commented 8 years ago

fixed in 0.2.1 (but not yet in NPM)