rebelidealist/stripe-ruby-mock — pull request #64 by gyardley (2014-02-18 11:55:25+00:00)
Title: Clean-up - trial subscription creation and cancellation

This pull request makes sure that when a subscription is canceled with at_period_end set to true, the subscription's current status is preserved, whether it's 'active' or 'trialing'.

Before, it was just returning 'active' for the current status, which was incorrect behavior for accounts still in the trial period who canceled.

It also makes sure the trial_start and trial_end dates are set correctly on customer creation for accounts with a trial period.

There's some repeated code in the customer and subscription request handlers, which I don't love, but I didn't want to just stash it somewhere else and include it in both handlers without chatting about how you'd like to organize the code first.