ducky/subscriptions

Paddy 2015-06-22 Parent:56a2bef197cd Child:fe8f092cc149

3:b240b6123548 Go to Latest

ducky/subscriptions/.hgignore

Export all subscriptionStore methods. We're not going to wrap all our subscriptionStore interactions in a Context type, so we need to expose all the functions so other packages can call them. Also, it's now SubscriptionStore. Also creates a SubscriptionRequest type that is used to create a new Subscription instance, along with a Validate method on it, to detect errors when creating a SubscriptionRequest. Update our CreateSubscription function to be New, and have it take a SubscriptionRequest, a Stripe instance, and a SubscriptionStore as arguments. It'll create the Subscription in the SubscriptionStore, create a customer in Stripe, and create the subscription in Stripe, then associate the Stripe subscription with the created Subscription. Also, fix our StripeSubscriptionChange function to correctly equate a missing/zero Unix timestamp from Stripe with a missing/zero time.Time.

History
     1.1 --- a/.hgignore	Tue Jun 16 23:09:59 2015 -0400
     1.2 +++ b/.hgignore	Mon Jun 22 18:34:07 2015 -0400
     1.3 @@ -1,2 +1,3 @@
     1.4  cover.out
     1.5  .swp
     1.6 +subscriptionsd/subscriptionsd