brucealdridge / VendAPI

Class for accessing the api for vend on vendhq.com
Other
36 stars 22 forks source link

Support for "Too Many Requests" 429 response from Vend #23

Closed gurubobnz closed 9 years ago

gurubobnz commented 9 years ago

Rate limit responses (see https://developers.vendhq.com/documentation/ratelimiting.html) from the Vend API would previously result in the "Recieved null result from API" exception being thrown due to CURLOPT_FAILONERROR being set. Requires system time be correct otherwise cooldown does not work properly - set allow_time_slip=false to ignore this.

Note: Added public property $http_code on VendRequest so that VendAPI can determine whether it was a 400+ result and act accordingly.