Odd behaviour of $psts->extend(), also appears when we use manual form to extend a blog.

Hi wpmudev team,

We're trying to code our own payment gateway for pro sites, and we're coming across some issues.

From looking at pro-sites.php line 1605, if we do something like this in our plugin:

global $psts;
$extend = strtotime("+0 Months 1 Days") - time(); // extend by one day
$psts->extend(get_current_blog_id(), $extend, 'OurGateway', 2);

We have upgraded our current blog to the 2nd level and we can confirm that with the log on the admin page
2012-12-04 2:46:10 pm Pro Site status expiration extended until December 4, 2012

If we call that function again, we'd expect a new log entry with a new time stamp extended until December 5 2012

We're also printing out get_expire before we extend, and afterwards to see if the expiry time is changing:
1358257058
extend as per above
1358170658

The difference is 86400 seconds, aka one day, everything is fine.

Now comes the next part:
http://eb-dev2.no-ip.biz/wp-admin/network/admin.php?page=psts&bid=<our blog>

The log previously showed
2012-12-04 2:46:10 pm Pro Site status expiration extended until December 4, 2012

Then we extend for one day and the log shows two entries
2012-12-04 3:03:45 pm Pro Site status expiration extended until December 4, 2012.
2012-12-04 3:03:45 pm Pro Site status expiration extended until December 4, 2012.

Notice how the timestamps have changed and the expiry time is still set to today.

So now lets try and extend for a month and see what happens in the log and with get_expire
Before 1358257058
$extend = strtotime("+1 Months 0 Days") - time();
After - 1358343458 -- difference is still 86400

And log
2012-12-04 3:08:51 pm Pro Site status expiration extended until December 4, 2012.
2012-12-04 3:08:51 pm Pro Site status expiration extended until December 4, 2012.
2012-12-04 3:08:51 pm Pro Site status expiration extended until December 4, 2012.

Ok, lets change $extend to 2629744 ~ 30.4 days
get_expire()
before 1358343458
after 1360973202

And the log
2012-12-04 3:10:59 pm Pro Site status expiration extended until December 4, 2012.
2012-12-04 3:10:59 pm Pro Site status expiration extended until December 4, 2012.
2012-12-04 3:10:59 pm Pro Site status expiration extended until December 4, 2012.
2012-12-04 3:10:59 pm Pro Site status expiration extended until December 4, 2012.

Is this a bug? Or are we incorrectly upgrading users to a pro site (if so what's the right way?)

For comparison, we created a new blog and manually updated it from the pro-sites front end http://eb-dev2.no-ip.biz/wp-admin/network/admin.php?page=psts&bid=NEW BLOG ID

First we update by one month (expiry shows December 4th), then 34 months (expiry shows December 4th) and following that we extend permanently. Here is the log for the blog:

2012-12-04 3:14:56 pm Pro Site status expiration permanently extended.
2012-12-04 3:14:56 pm Pro Site status expiration extended until December 4, 2012.
2012-12-04 3:14:56 pm Pro Site status expiration extended until December 4, 2012.

Any ideas?