diff --git a/MangoPay/Libraries/RestTool.php b/MangoPay/Libraries/RestTool.php index a6c6263a..0f91a47b 100644 --- a/MangoPay/Libraries/RestTool.php +++ b/MangoPay/Libraries/RestTool.php @@ -268,9 +268,9 @@ private function ReadResponseHeader($headers) $updatedRateLimits = $this->initRateLimits(); } $rateLimit = $this->findFirstRateLimitMatchingPredicate($updatedRateLimits, function ($rate) { - return $rate->ResetTimeMillis == null; + return $rate->ResetTimeTimestamp == null; }); - $rateLimit->ResetTimeMillis = (int)trim(str_replace('x-ratelimit-reset:', '', $lowercaseHeader)); + $rateLimit->ResetTimeTimestamp = (int)trim(str_replace('x-ratelimit-reset:', '', $lowercaseHeader)); } } diff --git a/MangoPay/RateLimit.php b/MangoPay/RateLimit.php index 2997e532..6a9861b4 100644 --- a/MangoPay/RateLimit.php +++ b/MangoPay/RateLimit.php @@ -23,9 +23,9 @@ class RateLimit public $CallsRemaining; /** - * @var integer the time in millis when the number of allowed calls in this time interval will be reset. + * @var integer the time in unix timestamp when the number of allowed calls in this time interval will be reset. */ - public $ResetTimeMillis; + public $ResetTimeTimestamp; /** * RateLimit constructor. diff --git a/MangoPay/Shipping.php b/MangoPay/Shipping.php index ef4402ea..87da66f3 100644 --- a/MangoPay/Shipping.php +++ b/MangoPay/Shipping.php @@ -4,7 +4,7 @@ namespace MangoPay; -class Shipping +class Shipping extends Libraries\Dto { /** * The First Name for Billing Address diff --git a/README.md b/README.md index eb8cca43..3fdc9d41 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,7 @@ So there are 4 groups of rate limits available: 4. Last 24 hours This information is available from the MangoPayApi instance, like in the following example: + ```php mangoPayApi->RateLimits; print "There were " . $rateLimits[0]->CallsMade . " calls made in the last 15 minutes\n"; print "You can do " . $rateLimits[0]->CallsRemaining . " more calls in the next 15 minutes\n"; - print "The 15 minutes counter will reset in " . $rateLimits[0]->ResetTimeMillis . " ms\n\n"; + print "The 15 minutes counter will reset in " . $rateLimits[0]->ResetTimeTimestamp . " ms\n\n"; print "There were " . $rateLimits[2]->CallsMade . " calls made in the last 60 minutes\n"; print "You can do " . $rateLimits[2]->CallsRemaining . " more calls in the next 60 minutes\n"; - print "The 60 minutes counter will reset in " . $rateLimits[1]->ResetTimeMillis . " ms\n\n"; + print "The 60 minutes counter will reset in " . $rateLimits[1]->ResetTimeTimestamp . " ms\n\n"; } }